[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 { _ ->
|
it.doLast { _ ->
|
||||||
compilation.output.resourcesDir
|
val resourcesDir = compilation.output.resourcesDir
|
||||||
.copyRecursively(
|
if (resourcesDir.exists()) {
|
||||||
target = it.destinationDirectory!!,
|
resourcesDir
|
||||||
overwrite = true
|
.copyRecursively(
|
||||||
)
|
target = it.destinationDirectory!!,
|
||||||
|
overwrite = true
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
@@ -101,6 +101,16 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
|||||||
open val evaluatedConfigFile: File
|
open val evaluatedConfigFile: File
|
||||||
@OutputFile get() = reportDir.resolve("webpack.config.evaluated.js")
|
@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
|
@Input
|
||||||
var bin: String = "webpack/bin/webpack.js"
|
var bin: String = "webpack/bin/webpack.js"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user