[Gradle, JS] Add IT that no tasks configured on help task execution
#KT-47559 Fixed
This commit is contained in:
+34
@@ -925,6 +925,40 @@ abstract class AbstractKotlin2JsGradlePluginIT(val irBackend: Boolean) : BaseGra
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testBrowserNoTasksConfigurationOnHelp() = with(transformProjectWithPluginsDsl("kotlin-js-browser-project")) {
|
||||
gradleBuildScript().appendText(
|
||||
"\n" + """
|
||||
allprojects {
|
||||
tasks.configureEach {
|
||||
if (this is org.gradle.configuration.Help) return@configureEach
|
||||
throw GradleException("Task ${'$'}{path} shouldn't be configured")
|
||||
}
|
||||
}
|
||||
""".trimIndent()
|
||||
)
|
||||
build {
|
||||
assertSuccessful()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testNodeJsNoTasksConfigurationOnHelp() = with(transformProjectWithPluginsDsl("kotlin-js-nodejs-project")) {
|
||||
gradleBuildScript().appendText(
|
||||
"\n" + """
|
||||
allprojects {
|
||||
tasks.configureEach {
|
||||
if (it instanceof org.gradle.configuration.Help) return
|
||||
throw new GradleException("Task ${'$'}{path} shouldn't be configured")
|
||||
}
|
||||
}
|
||||
""".trimIndent()
|
||||
)
|
||||
build {
|
||||
assertSuccessful()
|
||||
}
|
||||
}
|
||||
|
||||
private fun CompiledProject.getSubprojectPackageJson(subProject: String, projectName: String? = null) =
|
||||
fileInWorkingDir("build/js/packages/${projectName ?: project.projectName}-$subProject")
|
||||
.resolve(NpmProject.PACKAGE_JSON)
|
||||
|
||||
Reference in New Issue
Block a user