[Gradle, JS] Check if resourcesDir exists and resourceDir is input directory
This commit is contained in:
+8
-5
@@ -182,11 +182,14 @@ open class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
|
||||
}
|
||||
|
||||
it.doLast { _ ->
|
||||
compilation.output.resourcesDir
|
||||
.copyRecursively(
|
||||
target = it.destinationDirectory!!,
|
||||
overwrite = true
|
||||
)
|
||||
val resourcesDir = compilation.output.resourcesDir
|
||||
if (resourcesDir.exists()) {
|
||||
resourcesDir
|
||||
.copyRecursively(
|
||||
target = it.destinationDirectory!!,
|
||||
overwrite = true
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
@@ -101,6 +101,16 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
||||
open val evaluatedConfigFile: File
|
||||
@OutputFile get() = reportDir.resolve("webpack.config.evaluated.js")
|
||||
|
||||
val resourcesDir: File?
|
||||
@Optional
|
||||
@InputDirectory
|
||||
get() {
|
||||
val resourcesDir = compilation.output.resourcesDir
|
||||
return if (resourcesDir.exists()) {
|
||||
resourcesDir
|
||||
} else null
|
||||
}
|
||||
|
||||
@Input
|
||||
var bin: String = "webpack/bin/webpack.js"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user