From 748dc30fdc614ce17785f03be19e689039bd9133 Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Sat, 4 Jun 2022 22:07:28 -0600 Subject: [PATCH] Support and test Gradle 3.5.1 Fix build-scan-capture.init.gradle so that it applies to versions 3.+, and include this version in test coverage. --- .github/workflows/integ-test-execution.yml | 9 ++++++++- .../workflows/integ-test-provision-gradle-versions.yml | 9 ++++++++- src/resources/build-result-capture.init.gradle | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integ-test-execution.yml b/.github/workflows/integ-test-execution.yml index 054164c..dacbd1e 100644 --- a/.github/workflows/integ-test-execution.yml +++ b/.github/workflows/integ-test-execution.yml @@ -56,19 +56,26 @@ jobs: gradle-versions: strategy: matrix: - gradle: [7.3, 6.9, 5.6.4, 4.10.3] + gradle: [7.3, 6.9, 5.6.4, 4.10.3, 3.5.1] os: ${{fromJSON(inputs.runner-os)}} include: - gradle: 5.6.4 build-root-suffix: -gradle-5 - gradle: 4.10.3 build-root-suffix: -gradle-4 + - gradle: 3.5.1 + build-root-suffix: -gradle-4 runs-on: ${{ matrix.os }} steps: - name: Checkout sources uses: actions/checkout@v3 - name: Download distribution if required uses: ./.github/actions/download-dist + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 8 - name: Run Gradle build uses: ./ id: gradle diff --git a/.github/workflows/integ-test-provision-gradle-versions.yml b/.github/workflows/integ-test-provision-gradle-versions.yml index aa11831..18e8d1b 100644 --- a/.github/workflows/integ-test-provision-gradle-versions.yml +++ b/.github/workflows/integ-test-provision-gradle-versions.yml @@ -59,19 +59,26 @@ jobs: gradle-versions: strategy: matrix: - gradle: [7.3, 6.9, 5.6.4, 4.10.3] + gradle: [7.3, 6.9, 5.6.4, 4.10.3, 3.5.1] os: ${{fromJSON(inputs.runner-os)}} include: - gradle: 5.6.4 build-root-suffix: -gradle-5 - gradle: 4.10.3 build-root-suffix: -gradle-4 + - gradle: 3.5.1 + build-root-suffix: -gradle-4 runs-on: ${{ matrix.os }} steps: - name: Checkout sources uses: actions/checkout@v3 - name: Download distribution if required uses: ./.github/actions/download-dist + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 8 - name: Setup Gradle uses: ./ with: diff --git a/src/resources/build-result-capture.init.gradle b/src/resources/build-result-capture.init.gradle index b9936de..ff34b04 100644 --- a/src/resources/build-result-capture.init.gradle +++ b/src/resources/build-result-capture.init.gradle @@ -7,7 +7,7 @@ import org.gradle.util.GradleVersion def isTopLevelBuild = gradle.getParent() == null if (isTopLevelBuild) { def version = GradleVersion.current().baseVersion - def atLeastGradle4 = version >= GradleVersion.version("4.0") + def atLeastGradle3 = version >= GradleVersion.version("3.0") def atLeastGradle6 = version >= GradleVersion.version("6.0") if (atLeastGradle6) { @@ -16,7 +16,7 @@ if (isTopLevelBuild) { registerCallbacks(settings.extensions["gradleEnterprise"].buildScan, settings.rootProject.name) } } - } else if (atLeastGradle4) { + } else if (atLeastGradle3) { projectsEvaluated { gradle -> if (gradle.rootProject.pluginManager.hasPlugin("com.gradle.build-scan")) { registerCallbacks(gradle.rootProject.extensions["buildScan"], gradle.rootProject.name)