Skip to content
Draft
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
28081e5
attempt at gradle 9 + backward compat
ldetmer Feb 2, 2026
aa4dbc7
revert to backwards compatible
ldetmer Feb 2, 2026
80d3ace
revert to backwards compatible
ldetmer Feb 2, 2026
e4b13b3
revert to backwards compatible
ldetmer Feb 2, 2026
09e255d
revert to backwards compatible
ldetmer Feb 2, 2026
06f7473
pulled in changes from PR 4472
ldetmer Feb 2, 2026
a9d4a11
add unit test just for the 1 gradle 9
ldetmer Feb 2, 2026
b21ba70
fix gradle version referenced
ldetmer Feb 3, 2026
623a70d
update gradle version
ldetmer Feb 3, 2026
4b36d8d
fixed to compile with gradle 9
ldetmer Feb 3, 2026
ca05b16
revert changes to gradle-wrapper.properties
ldetmer Feb 3, 2026
d2b24d8
working with gradle 6 + java 8
ldetmer Feb 3, 2026
1e1fcf5
think is backwards compatible
ldetmer Feb 3, 2026
6492713
revert unncessary build changes
ldetmer Feb 3, 2026
bef8198
removed unnecessary plugin manipulation
ldetmer Feb 3, 2026
c621d08
removed extra space
ldetmer Feb 3, 2026
0317851
revert unnecessary gradle changes
ldetmer Feb 3, 2026
b7fa208
fix permission issue
ldetmer Feb 3, 2026
3550d4c
update reflection exceptions to use ReflectiveOperationException
ldetmer Feb 3, 2026
e30530d
update multi project test to use current gradle version to be able to…
ldetmer Feb 4, 2026
ab00e82
force to use 9.0 if running gradle version higher than 9
ldetmer Feb 4, 2026
0aabca1
revert unncessary changes
ldetmer Feb 4, 2026
ee3fbba
reverted unintended changes
ldetmer Feb 4, 2026
6ed7258
fix formatting
ldetmer Feb 4, 2026
e637b69
slight cleanup refactor
ldetmer Feb 4, 2026
4fbe870
match up wtih latest code
ldetmer Feb 4, 2026
22a0f35
added more robust logic to determining error in gradle version
ldetmer Feb 4, 2026
c40b32b
fix formatting
ldetmer Feb 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,21 @@
- name: Run tests
run: |
./gradlew clean build jacocoTestReport --stacktrace

gradle9-java17-test:
name: Gradle 9 compatibility test (Java 17)
runs-on: ubuntu-latest
env:
TERM: dumb
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
- uses: gradle/gradle-build-action@v2
with:
gradle-version: 9.0
- name: Run Gradle 9 compatibility test
run: |
gradle :jib-gradle-plugin:test --tests "*FilesTaskV2Test.testFilesTask_multiProjectComplexService_gradle9" -x jacocoTestReport --stacktrace
39 changes: 25 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import org.gradle.util.GradleVersion

// define all versioned plugins here and apply in subprojects as necessary without version
plugins {
id 'com.github.sherter.google-java-format' version '0.9' apply false
id 'net.ltgt.errorprone' version '3.1.0' apply false
id 'net.researchgate.release' version '2.8.1' apply false
id 'com.gradle.plugin-publish' version '1.2.0' apply false
id 'com.gradle.plugin-publish' version '0.21.0' apply false
id 'io.freefair.maven-plugin' version '5.3.3.3' apply false

// apply so that we can collect quality metrics at the root project level
Expand Down Expand Up @@ -79,18 +81,23 @@ subprojects {
apply plugin: 'net.ltgt.errorprone'
apply plugin: 'jacoco'

// Guava update breaks unit tests. Workaround mentioned in https://github.com/google/guava/issues/6612#issuecomment-1614992368.
sourceSets.all {
configurations.getByName(runtimeClasspathConfigurationName) {
attributes.attribute(Attribute.of("org.gradle.jvm.environment", String), "standard-jvm")
}
configurations.getByName(compileClasspathConfigurationName) {
attributes.attribute(Attribute.of("org.gradle.jvm.environment", String), "standard-jvm")
// Guava update breaks unit tests in Gradle 6.x. Workaround mentioned in https://github.com/google/guava/issues/6612#issuecomment-1614992368.
// Only needed for Gradle < 7, as Gradle 7+ handles this automatically
if (GradleVersion.current() < GradleVersion.version('7.0')) {
sourceSets.all {
configurations.getByName(runtimeClasspathConfigurationName) {
attributes.attribute(Attribute.of("org.gradle.jvm.environment", String), "standard-jvm")
}
configurations.getByName(compileClasspathConfigurationName) {
attributes.attribute(Attribute.of("org.gradle.jvm.environment", String), "standard-jvm")
}
}
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
compileJava.options.encoding = 'UTF-8'
compileJava.options.compilerArgs += [ '-Xlint:deprecation' ]
compileTestJava.options.compilerArgs += [ '-Xlint:deprecation' ]
Expand Down Expand Up @@ -177,7 +184,7 @@ subprojects {

/* TEST CONFIG */
tasks.withType(Test).configureEach {
reports.html.outputLocation = file("${reporting.baseDir}/${name}")
reports.html.outputLocation = file("${project.buildDir}/reports/${name}")
}

test {
Expand Down Expand Up @@ -215,8 +222,7 @@ subprojects {

configurations {
integrationTestImplementation.extendsFrom testImplementation
integrationTestImplementation.setCanBeResolved(true)
integrationTestRuntime.extendsFrom testRuntime
integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
}

// Integration tests must be run explicitly
Expand Down Expand Up @@ -397,7 +403,12 @@ subprojects {
sourceProjects += dependencyProject
// if we find any project dependencies that were brought in transitively, go remove them
project.configurations.implementation.dependencies.removeAll { d ->
return d instanceof ProjectDependency && sourceProjects.contains(d.dependencyProject)
if (d instanceof ProjectDependency) {
// Gradle 6.9.2 uses dependencyProject, Gradle 9+ uses path
def depProject = d.hasProperty('dependencyProject') ? d.dependencyProject : project.project(d.path)
return sourceProjects.contains(depProject)
}
return false
}
// adds dependencyProject's classes to jar (fat jar-esque)
jar {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading