diff --git a/build.gradle.kts b/build.gradle.kts index 598002d..6d4ffce 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "scientifik" -version = "0.3.1" +version = "0.3.2" repositories { gradlePluginPortal() diff --git a/src/main/kotlin/scientifik/ScientifikJSPlugin.kt b/src/main/kotlin/scientifik/ScientifikJSPlugin.kt index 9475f4d..14b262e 100644 --- a/src/main/kotlin/scientifik/ScientifikJSPlugin.kt +++ b/src/main/kotlin/scientifik/ScientifikJSPlugin.kt @@ -45,11 +45,12 @@ open class ScientifikJSPlugin : Plugin { outputFileName = "main.bundle.js" } - afterEvaluate { - val installJsDist by creating(Copy::class) { - group = "distribution" - dependsOn(browserWebpack) - from(fileTree("src/main/web")) + + val installJsDist by creating(Copy::class) { + group = "distribution" + dependsOn(browserWebpack) + from(fileTree("src/main/web")) + afterEvaluate { into(browserWebpack.destinationDirectory!!) doLast { val indexFile = File(browserWebpack.destinationDirectory!!, "index.html") @@ -58,10 +59,10 @@ open class ScientifikJSPlugin : Plugin { } } } - - findByName("assemble")?.dependsOn(installJsDist) - } + + findByName("assemble")?.dependsOn(installJsDist) + } } diff --git a/src/main/kotlin/scientifik/ScientifikMPPlugin.kt b/src/main/kotlin/scientifik/ScientifikMPPlugin.kt index 6e5680c..ca92f4f 100644 --- a/src/main/kotlin/scientifik/ScientifikMPPlugin.kt +++ b/src/main/kotlin/scientifik/ScientifikMPPlugin.kt @@ -115,17 +115,18 @@ open class ScientifikMPPlugin : Plugin { tasks.apply { val jsBrowserWebpack by getting(KotlinWebpack::class) { afterEvaluate { - val destination = listOf(name, version.toString()).joinToString("-") + val destination = listOf(name, "js", version.toString()).joinToString("-") destinationDirectory = destinationDirectory?.resolve(destination) } outputFileName = "main.bundle.js" } - afterEvaluate { - val installJsDist by creating(Copy::class) { - group = "distribution" - dependsOn(jsBrowserWebpack) - from(project.fileTree("src/jsMain/web")) + + val installJsDist by creating(Copy::class) { + group = "distribution" + dependsOn(jsBrowserWebpack) + from(project.fileTree("src/jsMain/web")) + afterEvaluate { into(jsBrowserWebpack.destinationDirectory!!) doLast { val indexFile = File(jsBrowserWebpack.destinationDirectory!!, "index.html") @@ -134,10 +135,10 @@ open class ScientifikMPPlugin : Plugin { } } } - - findByName("assemble")?.dependsOn(installJsDist) } + findByName("assemble")?.dependsOn(installJsDist) + // withType(){ // useJUnitPlatform() // }