Skip to content

Commit

Permalink
Also make the Copy task depend on the "jsBrowserDevelopmentWebpack"…
Browse files Browse the repository at this point in the history
… task when not in production mode in `GenerateKotlinJsBrowserWebrootForVertxWebPlugin`
  • Loading branch information
ShreckYe committed Jun 11, 2022
1 parent 0a1c211 commit 907b059
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ class GenerateKotlinJsBrowserWebrootForVertxWebPlugin : Plugin<Project> {
/*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<Copy>(copyJsBrowserDistributionToResourcesWebroot) {
dependsOn(jsBrowserProductionWebpack)
from(jsBrowserProductionWebpack.destinationDirectory)
dependsOn(jsBrowserWebpack)
from(jsBrowserWebpack.destinationDirectory)
if (extension.production.get())
include("*.html", "*.css", "*.js")
into(browserDistributionResourcesDirectory.resolve("webroot"))
Expand Down

0 comments on commit 907b059

Please sign in to comment.