Skip to content

Commit edd3194

Browse files
committed
build: migrate to the org.framefork.build convention plugin
Consume org.framefork.build 0.2.0 from Maven Central instead of the local buildSrc. Removes buildSrc/ (the framefork.java / framefork.java-public convention scripts) and the manual module discovery in settings.gradle.kts; the settings plugin now discovers modules/ + testing/ itself, the published module applies library-published and the spring-boot testing modules apply library-internal, all version-less. settings.gradle.kts declares minJavaVersion = jdkVersion = 21 to preserve the old build's release-21 bytecode target. The plugin supplies the JUnit 5 stack, the JUnit 4 substitution, the @NullMarked package-info generation, Error Prone + NullAway strictness and the maven-publish staging conventions (build/staging-deploy at the repo root, which jreleaser.yml already reads) that buildSrc used to provide, so the module builds keep only their own dependencies. Root build.gradle.kts drops the now-plugin-provided repositories block and cleanAllPublications task, drops the unused be.vbgn.ci-detect plugin, and bumps taskinfo to 3.0.2 for Gradle 9. gradle.properties drops the kapt tuning (no Kotlin here) for the toolchain auto-detect settings. CI compiles once on the Gradle daemon JDK and varies the JDK 21/22/23 matrix as the test-runtime launcher via -Ptests.jdk.version (compile-once-test-many), matching the old build's whole-build-per-JDK test coverage.
1 parent 906bf57 commit edd3194

12 files changed

Lines changed: 33 additions & 307 deletions

File tree

.github/workflows/gradle-build.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,40 @@ env:
1111

1212
jobs:
1313
gradle:
14+
name: JDK ${{ matrix.jdk }}
15+
runs-on: ubuntu-latest
1416
strategy:
17+
fail-fast: false
1518
matrix:
16-
java: [21, 22, 23]
17-
runs-on: ubuntu-latest
19+
jdk: [21, 22, 23]
1820
steps:
1921
- uses: actions/checkout@v4
2022

2123
- name: Setup Java
2224
uses: actions/setup-java@v4
2325
with:
2426
distribution: temurin
25-
java-version: ${{ matrix.java }}
27+
java-version: | # the last one is the daemon/compile JDK and must be >= 21 (org.framefork.build's module metadata needs a 21+ daemon); compilation stays on it while the matrix JDK is the test launcher via -Ptests.jdk.version (compile-once-test-many)
28+
${{ matrix.jdk }}
29+
21
2630
cache: gradle
2731

2832
- name: Setup Gradle
2933
uses: gradle/actions/setup-gradle@v4
3034
with:
3135
add-job-summary-as-pr-comment: on-failure
3236

37+
- name: Gradle toolchains info
38+
run: ./gradlew -q javaToolchains -Ptests.jdk.version=${{ matrix.jdk }}
39+
3340
- name: Execute Gradle build
34-
run: ./gradlew --continue build
41+
run: ./gradlew --continue build -Ptests.jdk.version=${{ matrix.jdk }}
3542

3643
- name: Upload Test Report
3744
uses: actions/upload-artifact@v4
3845
if: always() # always run even if the previous step fails
3946
with:
40-
name: junit-test-results
47+
name: junit-test-results-jdk${{ matrix.jdk }}
4148
path: '**/build/test-results/test/TEST-*.xml'
4249
retention-days: 1
4350
overwrite: true

build.gradle.kts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
plugins {
22
id("base")
33
id("idea")
4-
id("org.barfuin.gradle.taskinfo") version ("2.2.0") // ./gradlew tiTree publish
5-
id("be.vbgn.ci-detect") version ("0.5.0")
6-
}
7-
8-
repositories {
9-
mavenCentral()
10-
mavenLocal()
4+
id("org.barfuin.gradle.taskinfo") version ("3.0.2") // ./gradlew tiTree publish
115
}
126

137
group = "org.framefork"
14-
version = (properties["version"] as String).trim()
8+
version = providers.gradleProperty("version").get().trim()
159

1610
allprojects {
1711
group = rootProject.group
@@ -22,15 +16,10 @@ tasks.withType<Wrapper> {
2216
distributionType = Wrapper.DistributionType.ALL
2317
}
2418

25-
tasks.register<Delete>("cleanAllPublications") {
26-
outputs.upToDateWhen { false }
27-
setDelete(rootProject.layout.buildDirectory.dir("staging-deploy"))
28-
}
29-
3019
allprojects {
3120
apply(plugin = "project-report")
3221

33-
this.task("allDependencies", DependencyReportTask::class) {
22+
this.tasks.register<DependencyReportTask>("allDependencies") {
3423
evaluationDependsOnChildren()
3524
this.setRenderer(org.gradle.api.tasks.diagnostics.internal.dependencies.AsciiDependencyReportRenderer().apply {
3625
outputFile = file(project.layout.buildDirectory.file("reports/dependencies.txt"))

buildSrc/build.gradle.kts

Lines changed: 0 additions & 21 deletions
This file was deleted.

buildSrc/src/main/kotlin/framefork.java-public.gradle.kts

Lines changed: 0 additions & 63 deletions
This file was deleted.

buildSrc/src/main/kotlin/framefork.java.gradle.kts

Lines changed: 0 additions & 174 deletions
This file was deleted.

gradle.properties

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@ org.gradle.configuration-cache=false
66
org.gradle.console=verbose
77
org.gradle.warning.mode=all
88

9-
kapt.use.k2=true
10-
# Enable Kapt Incremental annotation processing requeste
11-
kapt.incremental.apt=true
12-
# Decrease gradle builds time
13-
kapt.use.worker.api=true
14-
# turn off AP discovery in compile path, and therefore turn on Compile Avoidance
15-
kapt.include.compile.classpath=false
16-
# Enable In Logcat to determine Kapt
17-
#kapt.verbose=true
9+
org.gradle.jvmargs="-XX:MaxMetaspaceSize=512m"
10+
11+
org.gradle.java.installations.auto-detect=true
12+
org.gradle.java.installations.auto-download=false
1813

1914
systemProp.file.encoding=UTF-8

gradle/libs.versions.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
[versions]
2-
googleAutoService = "1.1.1"
32
junit-jupiter = "5.10.3"
43
spring-boot = "3.2.0"
54

65
[libraries]
7-
autoService-processor = { group = "com.google.auto.service", name = "auto-service", version.ref = "googleAutoService" }
8-
autoService-annotations = { group = "com.google.auto.service", name = "auto-service-annotations", version.ref = "googleAutoService" }
96
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
107
assertj = { module = "org.assertj:assertj-core", version = "3.11.1" }
118
logback-classic = { module = "ch.qos.logback:logback-classic", version = "1.5.12" }

modules/spring-properties-order-by-configurations/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id("framefork.java-public")
2+
id("org.framefork.build.library-published")
33
}
44

55
dependencies {

0 commit comments

Comments
 (0)