diff --git a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/GenerateKotlinJsBrowserWebrootForVertxWebPlugin.kt b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/GenerateKotlinJsBrowserWebrootForVertxWebPlugin.kt index cf9499c..df918c7 100644 --- a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/GenerateKotlinJsBrowserWebrootForVertxWebPlugin.kt +++ b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/GenerateKotlinJsBrowserWebrootForVertxWebPlugin.kt @@ -19,16 +19,20 @@ class GenerateKotlinJsBrowserWebrootForVertxWebPlugin : Plugin { /*val jsBrowserDistributionTask by lazy { tasks.getByPath(extension.webFrontendProjectPath.get() + ":jsBrowserDistribution") as KotlinWebpack }*/ - val jsBrowserProductionWebpack by lazy { - tasks.getByPath(extension.webFrontendProjectPath.get() + ":jsBrowserProductionWebpack") as KotlinWebpack + val jsBrowserWebpack by lazy { + tasks.getByPath( + extension.webFrontendProjectPath.get() + + if (extension.production.get()) ":jsBrowserProductionWebpack" else ":jsBrowserDevelopmentWebpack" + ) as KotlinWebpack } val copyJsBrowserDistributionToResourcesWebroot = "copyJsBrowserDistributionToResourcesWebroot" val browserDistributionResourcesDirectory = buildDir.resolve("browserDistributionResources") tasks.register(copyJsBrowserDistributionToResourcesWebroot) { - dependsOn(jsBrowserProductionWebpack) - from(jsBrowserProductionWebpack.destinationDirectory) - include("*.html", "*.css", "*.js") + dependsOn(jsBrowserWebpack) + from(jsBrowserWebpack.destinationDirectory) + if (extension.production.get()) + include("*.html", "*.css", "*.js") into(browserDistributionResourcesDirectory.resolve("webroot")) } @@ -41,5 +45,6 @@ class GenerateKotlinJsBrowserWebrootForVertxWebPlugin : Plugin { interface Extension { val webFrontendProjectPath: Property + val production: Property } } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/plugin-conventions.gradle.kts b/buildSrc/src/main/kotlin/plugin-conventions.gradle.kts index 789bb1a..2c20595 100644 --- a/buildSrc/src/main/kotlin/plugin-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/plugin-conventions.gradle.kts @@ -8,7 +8,7 @@ dependencies { implementation(kotlin("gradle-plugin", "1.6.10")) } -version = "0.1.5-kotlin-1.6.10" +version = "0.1.6-kotlin-1.6.10" pluginBundle { website = "https://github.com/huanshankeji/gradle-plugin"