kotlin-jupyter icon indicating copy to clipboard operation
kotlin-jupyter copied to clipboard

Add plugin option to automatically add JS executable as a resource

Open altavir opened this issue 3 years ago • 0 comments

The next step for #148.

This requires three things:

  • Specify the name of the bundle JS (and maybe css) like this:
    js{
        browser {
            webpackTask {
                this.outputFileName = "js/jupyter-bundle.js"
            }
        }
        binaries.executable()
    }
  • Add resource dependency on the bundle like
    afterEvaluate {
        val jsBrowserDistribution by tasks.getting

        tasks.getByName<ProcessResources>("jvmProcessResources") {
            dependsOn(jsBrowserDistribution)
            afterEvaluate {
                from(jsBrowserDistribution)
            }
        }
    }
  • Add the resourceFromJsTarget function in the resource builder to load a class-path resource.

Willing to contribute to this one as well as soon as I have time.

altavir avatar Mar 10 '21 06:03 altavir