Skip to content

Commit 76af375

Browse files
Exclude META-INF for Gradle caching in Java compatibility tests (#7495)
* Don't depend on java-tck JAR * Exclude META-INF changes in Java compatibility tests
1 parent 6a1ac1b commit 76af375

5 files changed

Lines changed: 75 additions & 0 deletions

File tree

rewrite-java-11/build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,21 @@ testing {
102102
}
103103
}
104104

105+
// Keep the Test tasks' @Classpath fingerprint stable across CI runs. In this module the
106+
// only consumers of runtimeClasspath are :test and :compatibilityTest (compileJava uses
107+
// compileClasspath / ABI-only normalization and is unaffected). The convention plugin's
108+
// info-broker writes build-varying entries (Build-Date, Change, Build-Number, ...) into
109+
// MANIFEST.MF and META-INF/<project>.properties of every consumed JAR; none of META-INF
110+
// is a real input for the TCK's parser tests, so drop the whole directory from the
111+
// fingerprint and let the build cache hit when only those metadata bytes have changed.
112+
normalization {
113+
runtimeClasspath {
114+
metaInf {
115+
ignoreCompletely()
116+
}
117+
}
118+
}
119+
105120
tasks.named("check") {
106121
dependsOn(testing.suites.named("compatibilityTest"))
107122
}

rewrite-java-17/build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ testing {
9393
}
9494
}
9595

96+
// Keep the Test tasks' @Classpath fingerprint stable across CI runs. In this module the
97+
// only consumers of runtimeClasspath are :test and :compatibilityTest (compileJava uses
98+
// compileClasspath / ABI-only normalization and is unaffected). The convention plugin's
99+
// info-broker writes build-varying entries (Build-Date, Change, Build-Number, ...) into
100+
// MANIFEST.MF and META-INF/<project>.properties of every consumed JAR; none of META-INF
101+
// is a real input for the TCK's parser tests, so drop the whole directory from the
102+
// fingerprint and let the build cache hit when only those metadata bytes have changed.
103+
normalization {
104+
runtimeClasspath {
105+
metaInf {
106+
ignoreCompletely()
107+
}
108+
}
109+
}
110+
96111
tasks.named("check") {
97112
dependsOn(testing.suites.named("compatibilityTest"))
98113
}

rewrite-java-21/build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,21 @@ testing {
9494
}
9595
}
9696

97+
// Keep the Test tasks' @Classpath fingerprint stable across CI runs. In this module the
98+
// only consumers of runtimeClasspath are :test and :compatibilityTest (compileJava uses
99+
// compileClasspath / ABI-only normalization and is unaffected). The convention plugin's
100+
// info-broker writes build-varying entries (Build-Date, Change, Build-Number, ...) into
101+
// MANIFEST.MF and META-INF/<project>.properties of every consumed JAR; none of META-INF
102+
// is a real input for the TCK's parser tests, so drop the whole directory from the
103+
// fingerprint and let the build cache hit when only those metadata bytes have changed.
104+
normalization {
105+
runtimeClasspath {
106+
metaInf {
107+
ignoreCompletely()
108+
}
109+
}
110+
}
111+
97112
tasks.named("check") {
98113
dependsOn(testing.suites.named("compatibilityTest"))
99114
}

rewrite-java-25/build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ testing {
9797
}
9898
}
9999

100+
// Keep the Test tasks' @Classpath fingerprint stable across CI runs. In this module the
101+
// only consumers of runtimeClasspath are :test and :compatibilityTest (compileJava uses
102+
// compileClasspath / ABI-only normalization and is unaffected). The convention plugin's
103+
// info-broker writes build-varying entries (Build-Date, Change, Build-Number, ...) into
104+
// MANIFEST.MF and META-INF/<project>.properties of every consumed JAR; none of META-INF
105+
// is a real input for the TCK's parser tests, so drop the whole directory from the
106+
// fingerprint and let the build cache hit when only those metadata bytes have changed.
107+
normalization {
108+
runtimeClasspath {
109+
metaInf {
110+
ignoreCompletely()
111+
}
112+
}
113+
}
114+
100115
tasks.named("check") {
101116
dependsOn(testing.suites.named("compatibilityTest"))
102117
}

rewrite-java-8/build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ testing {
9999
}
100100
}
101101

102+
// Keep the Test tasks' @Classpath fingerprint stable across CI runs. In this module the
103+
// only consumers of runtimeClasspath are :test and :compatibilityTest (compileJava uses
104+
// compileClasspath / ABI-only normalization and is unaffected). The convention plugin's
105+
// info-broker writes build-varying entries (Build-Date, Change, Build-Number, ...) into
106+
// MANIFEST.MF and META-INF/<project>.properties of every consumed JAR; none of META-INF
107+
// is a real input for the TCK's parser tests, so drop the whole directory from the
108+
// fingerprint and let the build cache hit when only those metadata bytes have changed.
109+
normalization {
110+
runtimeClasspath {
111+
metaInf {
112+
ignoreCompletely()
113+
}
114+
}
115+
}
116+
102117
tasks.named("check") {
103118
dependsOn(testing.suites.named("compatibilityTest"))
104119
}

0 commit comments

Comments
 (0)