Skip to content

Commit 619f67d

Browse files
authored
Use Classpath normalization for classpath inputs of source generator tasks (#214)
`@InputFiles` with `@PathSensitive(PathSensitivity.RELATIVE)` makes it impossible to reuse build cache between builds with different build numbers because a jar name includes build number.
1 parent 177290c commit 619f67d

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed

plugin/main/src/kotlinx/benchmark/gradle/JmhBytecodeGeneratorTask.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ constructor(
1717
private val workerExecutor: WorkerExecutor
1818
) : DefaultTask() {
1919

20-
@InputFiles
21-
@PathSensitive(PathSensitivity.RELATIVE)
20+
21+
@Classpath
2222
lateinit var inputClassesDirs: FileCollection
2323

24-
@InputFiles
25-
@PathSensitive(PathSensitivity.RELATIVE)
24+
@Classpath
2625
lateinit var inputCompileClasspath: FileCollection
2726

2827
@OutputDirectory
@@ -31,8 +30,7 @@ constructor(
3130
@OutputDirectory
3231
lateinit var outputSourcesDir: File
3332

34-
@InputFiles
35-
@PathSensitive(PathSensitivity.RELATIVE)
33+
@Classpath
3634
lateinit var runtimeClasspath: FileCollection
3735

3836
@Optional

plugin/main/src/kotlinx/benchmark/gradle/JsSourceGeneratorTask.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ constructor(
2525
@Input
2626
var useBenchmarkJs: Boolean = true
2727

28-
@InputFiles
29-
@PathSensitive(PathSensitivity.RELATIVE)
28+
@Classpath
3029
lateinit var inputClassesDirs: FileCollection
3130

32-
@InputFiles
33-
@PathSensitive(PathSensitivity.RELATIVE)
31+
@Classpath
3432
lateinit var inputDependencies: FileCollection
3533

3634
@OutputDirectory

plugin/main/src/kotlinx/benchmark/gradle/NativeSourceGeneratorTask.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ constructor(
2121
@Input
2222
lateinit var title: String
2323

24-
@InputFiles
25-
@PathSensitive(PathSensitivity.RELATIVE)
24+
@Classpath
2625
lateinit var inputClassesDirs: FileCollection
2726

28-
@InputFiles
29-
@PathSensitive(PathSensitivity.RELATIVE)
27+
@Classpath
3028
lateinit var inputDependencies: FileCollection
3129

3230
@OutputDirectory

plugin/main/src/kotlinx/benchmark/gradle/WasmSourceGeneratorTask.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ constructor(
2222
@Input
2323
lateinit var title: String
2424

25-
@InputFiles
26-
@PathSensitive(PathSensitivity.RELATIVE)
25+
@Classpath
2726
lateinit var inputClassesDirs: FileCollection
2827

29-
@InputFiles
30-
@PathSensitive(PathSensitivity.RELATIVE)
28+
@Classpath
3129
lateinit var inputDependencies: FileCollection
3230

3331
@OutputDirectory

0 commit comments

Comments
 (0)