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.
This commit is contained in:
Daz DeBoer 2022-06-04 22:07:28 -06:00
parent e4ed35bcaf
commit 748dc30fdc
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
3 changed files with 18 additions and 4 deletions

View file

@ -56,19 +56,26 @@ jobs:
gradle-versions: gradle-versions:
strategy: strategy:
matrix: 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)}} os: ${{fromJSON(inputs.runner-os)}}
include: include:
- gradle: 5.6.4 - gradle: 5.6.4
build-root-suffix: -gradle-5 build-root-suffix: -gradle-5
- gradle: 4.10.3 - gradle: 4.10.3
build-root-suffix: -gradle-4 build-root-suffix: -gradle-4
- gradle: 3.5.1
build-root-suffix: -gradle-4
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Download distribution if required - name: Download distribution if required
uses: ./.github/actions/download-dist uses: ./.github/actions/download-dist
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
- name: Run Gradle build - name: Run Gradle build
uses: ./ uses: ./
id: gradle id: gradle

View file

@ -59,19 +59,26 @@ jobs:
gradle-versions: gradle-versions:
strategy: strategy:
matrix: 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)}} os: ${{fromJSON(inputs.runner-os)}}
include: include:
- gradle: 5.6.4 - gradle: 5.6.4
build-root-suffix: -gradle-5 build-root-suffix: -gradle-5
- gradle: 4.10.3 - gradle: 4.10.3
build-root-suffix: -gradle-4 build-root-suffix: -gradle-4
- gradle: 3.5.1
build-root-suffix: -gradle-4
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Download distribution if required - name: Download distribution if required
uses: ./.github/actions/download-dist uses: ./.github/actions/download-dist
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
- name: Setup Gradle - name: Setup Gradle
uses: ./ uses: ./
with: with:

View file

@ -7,7 +7,7 @@ import org.gradle.util.GradleVersion
def isTopLevelBuild = gradle.getParent() == null def isTopLevelBuild = gradle.getParent() == null
if (isTopLevelBuild) { if (isTopLevelBuild) {
def version = GradleVersion.current().baseVersion 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") def atLeastGradle6 = version >= GradleVersion.version("6.0")
if (atLeastGradle6) { if (atLeastGradle6) {
@ -16,7 +16,7 @@ if (isTopLevelBuild) {
registerCallbacks(settings.extensions["gradleEnterprise"].buildScan, settings.rootProject.name) registerCallbacks(settings.extensions["gradleEnterprise"].buildScan, settings.rootProject.name)
} }
} }
} else if (atLeastGradle4) { } else if (atLeastGradle3) {
projectsEvaluated { gradle -> projectsEvaluated { gradle ->
if (gradle.rootProject.pluginManager.hasPlugin("com.gradle.build-scan")) { if (gradle.rootProject.pluginManager.hasPlugin("com.gradle.build-scan")) {
registerCallbacks(gradle.rootProject.extensions["buildScan"], gradle.rootProject.name) registerCallbacks(gradle.rootProject.extensions["buildScan"], gradle.rootProject.name)