Skip to content

Commit f41fd01

Browse files
committed
Use lazy argumentProviders instead of args
1 parent ca92be6 commit f41fd01

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

cache-maker/build.gradle.kts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies {
88
}
99

1010
application {
11-
mainClass.set("cache.MainKt")
11+
mainClass.set("com.compiler.server.cache.MainKt")
1212
}
1313

1414
val runTask = tasks.named<JavaExec>("run") {
@@ -17,29 +17,22 @@ val runTask = tasks.named<JavaExec>("run") {
1717
dependsOn(":dependencies:copyComposeWasmCompilerPlugins")
1818
dependsOn(":dependencies:copyComposeWasmDependencies")
1919

20-
val rootName = project.rootProject.projectDir.toString()
21-
2220
val kotlinVersion = libs.versions.kotlin.get()
2321
inputs.property("kotlinVersion", kotlinVersion)
2422

25-
// Adding classpath directories as task input for up-to-date checks
2623
inputs.dir(libWasmFolder)
2724
inputs.dir(libComposeWasmFolder)
2825
inputs.dir(libComposeWasmCompilerPluginsFolder)
2926

30-
// Adding resulting index files as output for up-to-date checks
31-
val composeCacheComposeWasm = "$rootName${File.separator}$cachesComposeWasm"
3227
outputs.dir(cachesComposeWasmFolder)
3328

34-
args = listOf(
29+
args(
3530
kotlinVersion,
3631
libJVMFolder.asFile.absolutePath,
37-
composeCacheComposeWasm,
32+
cachesComposeWasmFolder,
3833
)
3934
}
4035

41-
val outputLocalCacheDir = rootDir.resolve(cachesComposeWasm)
42-
4336
val outputLambdaCacheDir: Provider<Directory> = layout.buildDirectory.dir("incremental-cache")
4437
val buildCacheForLambda by tasks.registering(Exec::class) {
4538
workingDir = rootDir
@@ -49,8 +42,8 @@ val buildCacheForLambda by tasks.registering(Exec::class) {
4942

5043
outputs.dir(outputDir.map { it.dir(cachesComposeWasm) })
5144

52-
doFirst {
53-
args = listOf(
45+
argumentProviders.add {
46+
listOf(
5447
lambdaPrefix, // baseDir
5548
outputDir.get().asFile.normalize().absolutePath, // targetDir
5649
)
@@ -81,7 +74,7 @@ val kotlinComposeWasmIcLambdaCache: Configuration by configurations.creating {
8174
}
8275
}
8376

84-
artifacts.add(kotlinComposeWasmIcLocalCache.name, outputLocalCacheDir) {
77+
artifacts.add(kotlinComposeWasmIcLocalCache.name, cachesComposeWasmFolder) {
8578
builtBy(runTask)
8679
}
8780

cache-maker/src/main/kotlin/CacheBuilder.kt renamed to cache-maker/src/main/kotlin/com/compiler/server/cache/CacheBuilder.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.compiler.server.cache
2+
13
import com.compiler.server.common.components.KotlinEnvironment
24
import com.compiler.server.common.components.compileWasmArgs
35
import com.compiler.server.common.components.linkWasmArgs

cache-maker/src/main/kotlin/Main.kt renamed to cache-maker/src/main/kotlin/com/compiler/server/cache/Main.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
package cache
1+
package com.compiler.server.cache
22

3-
import CacheBuilder
43
import com.compiler.server.common.components.KotlinEnvironmentConfiguration
54

65
fun main(args: Array<String>) {

0 commit comments

Comments
 (0)