[Gradle, JS] Use workaround to not link provider with task
^KTIJ-25757 fixed
This commit is contained in:
committed by
Space Team
parent
4c9b94330d
commit
b783a87c25
+38
@@ -50,4 +50,42 @@ class MppTestsIT : KGPBaseTest() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Android Studio has build service which checks all output files of all tasks in task graph
|
||||
// https://cs.android.com/android-studio/platform/tools/base/+/0185d5af71ba51c64681731f99f319bfcaeb0174:build-system/gradle-core/src/main/java/com/android/build/gradle/internal/attribution/BuildAnalyzerConfiguratorService.kt;l=78-84
|
||||
@DisplayName("KTIJ-25757: MPP is compatible with getting all task output files before execution (Android Studio case)")
|
||||
@GradleTest
|
||||
fun testKtij25757AllTaskOutputFilesBeforeExecution(gradleVersion: GradleVersion) {
|
||||
project(
|
||||
"new-mpp-lib-with-tests",
|
||||
gradleVersion
|
||||
) {
|
||||
buildGradle.modify {
|
||||
it + "\n" +
|
||||
"""
|
||||
kotlin {
|
||||
js {
|
||||
binaries.executable()
|
||||
browser {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gradle.taskGraph.whenReady { taskGraph ->
|
||||
taskGraph.allTasks.forEach { task ->
|
||||
// to not execute, just check configuration
|
||||
task.enabled = false
|
||||
task.outputs.files.forEach { outputFile ->
|
||||
println(outputFile.path)
|
||||
}
|
||||
}
|
||||
}
|
||||
""".trimIndent()
|
||||
|
||||
}
|
||||
|
||||
build(":assemble") {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -153,10 +153,12 @@ abstract class KotlinBrowserJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
||||
|
||||
task.doNotTrackStateCompat("Tracked by external webpack tool")
|
||||
|
||||
task.dependsOn(binary.linkSyncTask)
|
||||
|
||||
task.commonConfigure(
|
||||
binary = binary,
|
||||
mode = mode,
|
||||
inputFilesDirectory = binary.linkSyncTask.flatMap { it.destinationDirectory },
|
||||
inputFilesDirectory = task.project.provider { binary.linkSyncTask.get().destinationDirectory.get() },
|
||||
entryModuleName = binary.linkTask.flatMap { it.compilerOptions.moduleName },
|
||||
configurationActions = runTaskConfigurations,
|
||||
nodeJs = nodeJs,
|
||||
@@ -236,7 +238,7 @@ abstract class KotlinBrowserJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
||||
task.commonConfigure(
|
||||
binary = binary,
|
||||
mode = mode,
|
||||
inputFilesDirectory = binary.linkSyncTask.flatMap { it.destinationDirectory },
|
||||
inputFilesDirectory = task.project.provider { binary.linkSyncTask.get().destinationDirectory.get() },
|
||||
entryModuleName = binary.linkTask.flatMap { it.compilerOptions.moduleName },
|
||||
configurationActions = webpackTaskConfigurations,
|
||||
nodeJs = nodeJs,
|
||||
|
||||
Reference in New Issue
Block a user