Skip to content

Commit f41f353

Browse files
committed
[Gradle] Added inputs and outputs for :indexation:run task for up-to-date checks
1 parent f67e5eb commit f41f353

File tree

3 files changed

+32
-11
lines changed

3 files changed

+32
-11
lines changed

build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,6 @@ tasks.withType<KotlinCompile> {
117117
compilerOptions {
118118
freeCompilerArgs.set(listOf("-Xjsr305=strict"))
119119
}
120-
dependsOn(":dependencies:copyDependencies")
121-
dependsOn(":dependencies:copyJSDependencies")
122-
dependsOn(":dependencies:copyWasmDependencies")
123-
dependsOn(":dependencies:copyComposeWasmDependencies")
124-
dependsOn(":dependencies:copyComposeWasmCompilerPlugins")
125120
dependsOn(":executors:jar")
126121
dependsOn(":indexation:run")
127122
buildPropertyFile()

common/src/main/kotlin/component/KotlinEnvironment.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.utils.KotlinJavascriptMetadataUtils
2424
import org.jetbrains.kotlin.wasm.config.WasmConfigurationKeys
2525
import java.io.File
2626

27+
// NOTE: if new class paths are added, please add them to `JavaExec` task's inputs in build.gradle.kts as well
2728
class KotlinEnvironment(
2829
val classpath: List<File>,
2930
additionalJsClasspath: List<File>,

indexation/build.gradle.kts

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,38 @@ application {
1515
}
1616

1717
tasks.withType<JavaExec> {
18+
dependsOn(":executors:jar")
19+
dependsOn(":dependencies:copyDependencies")
20+
dependsOn(":dependencies:copyJSDependencies")
21+
dependsOn(":dependencies:copyWasmDependencies")
22+
dependsOn(":dependencies:copyComposeWasmCompilerPlugins")
23+
dependsOn(":dependencies:copyComposeWasmDependencies")
24+
1825
val rootName = project.rootProject.projectDir.toString()
26+
27+
val kotlinVersion = libs.versions.kotlin.get()
28+
inputs.property("kotlinVersion", kotlinVersion)
29+
30+
// Adding classpath directories as task input for up-to-date checks
31+
inputs.dir(libJVMFolder)
32+
inputs.dir(libJSFolder)
33+
inputs.dir(libWasmFolder)
34+
inputs.dir(libComposeWasmFolder)
35+
inputs.dir(libComposeWasmCompilerPluginsFolder)
36+
37+
// Adding resulting index files as output for up-to-date checks
38+
val jvmIndicesJson = "$rootName${File.separator}$indexes"
39+
val jsIndicesJson = "$rootName${File.separator}$indexesJs"
40+
val wasmIndicesJson = "$rootName${File.separator}$indexesWasm"
41+
val composeWasmIndicesJson = "$rootName${File.separator}$indexesComposeWasm"
42+
outputs.files(jvmIndicesJson, jsIndicesJson, wasmIndicesJson, composeWasmIndicesJson)
43+
1944
args = listOf(
20-
libs.versions.kotlin.get(),
21-
"$rootName${File.separator}${libs.versions.kotlin.get()}",
22-
"$rootName${File.separator}$indexes",
23-
"$rootName${File.separator}$indexesJs",
24-
"$rootName${File.separator}$indexesWasm",
25-
"$rootName${File.separator}$indexesComposeWasm",
45+
kotlinVersion,
46+
libJVMFolder.asFile.absolutePath,
47+
jvmIndicesJson,
48+
jsIndicesJson,
49+
wasmIndicesJson,
50+
composeWasmIndicesJson,
2651
)
2752
}

0 commit comments

Comments
 (0)