[Gradle, JS] Distribution task depends on processResources
This commit is contained in:
+9
@@ -528,5 +528,14 @@ abstract class AbstractKotlin2JsGradlePluginIT(private val irBackend: Boolean) :
|
|||||||
assertFileExists("app/build/distributions/app.js")
|
assertFileExists("app/build/distributions/app.js")
|
||||||
assertFileExists("app/build/distributions/app.js.map")
|
assertFileExists("app/build/distributions/app.js.map")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build("clean", "browserDistribution") {
|
||||||
|
assertTasksExecuted(
|
||||||
|
":app:processResources",
|
||||||
|
":app:browserDistribution"
|
||||||
|
)
|
||||||
|
|
||||||
|
assertFileExists("app/build/distributions/index.html")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="app.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+5
-1
@@ -153,11 +153,15 @@ open class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
|
|||||||
val baseDist = project.buildDir.resolve(basePluginConvention!!.distsDirName)
|
val baseDist = project.buildDir.resolve(basePluginConvention!!.distsDirName)
|
||||||
distribution.directory = distribution.directory ?: baseDist
|
distribution.directory = distribution.directory ?: baseDist
|
||||||
|
|
||||||
|
val processResourcesTask = target.project.tasks.getByName(compilation.processResourcesTaskName)
|
||||||
|
|
||||||
val distributionTask = project.registerTask<Copy>(
|
val distributionTask = project.registerTask<Copy>(
|
||||||
disambiguateCamelCased(
|
disambiguateCamelCased(
|
||||||
DISTRIBUTION_TASK_NAME
|
DISTRIBUTION_TASK_NAME
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
it.dependsOn(processResourcesTask)
|
||||||
|
|
||||||
it.from(compilation.output.resourcesDir)
|
it.from(compilation.output.resourcesDir)
|
||||||
it.into(distribution.directory ?: baseDist)
|
it.into(distribution.directory ?: baseDist)
|
||||||
}
|
}
|
||||||
@@ -176,7 +180,7 @@ open class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
|
|||||||
) {
|
) {
|
||||||
it.dependsOn(
|
it.dependsOn(
|
||||||
nodeJs.npmInstallTask,
|
nodeJs.npmInstallTask,
|
||||||
target.project.tasks.getByName(compilation.processResourcesTaskName),
|
processResourcesTask,
|
||||||
distributionTask
|
distributionTask
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user