Merge branch '3.1.x' into 3.2.x

Closes gh-40527
This commit is contained in:
Andy Wilkinson 2024-04-26 09:33:12 +01:00
commit 087e467387
10 changed files with 30 additions and 40 deletions

View File

@ -13,15 +13,9 @@ inputs:
required: false
default: false
description: 'Whether to publish artifacts ready for deployment to Artifactory'
gradle-enterprise-secret-access-key:
develocity-access-key:
required: false
description: 'The secret access key for authentication with ge.spring.io'
gradle-enterprise-cache-user:
required: false
description: 'The username for authentication with the remote build cache'
gradle-enterprise-cache-password:
required: false
description: 'The password for authentication with the remote build cache'
description: 'The access key for authentication with ge.spring.io'
outputs:
build-scan-url:
description: 'The URL, if any, of the build scan produced by the build'
@ -42,20 +36,14 @@ runs:
if: ${{ !inputs.publish }}
shell: bash
env:
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ inputs.gradle-enterprise-secret-access-key }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ inputs.gradle-enterprise-cache-user }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ inputs.gradle-enterprise-cache-password }}
DEVELOCITY_ACCESS_KEY: ${{ inputs.develocity-access-key }}
run: ./gradlew build
- name: Build and Publish
id: build-and-publish
if: ${{ inputs.publish }}
shell: bash
env:
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ inputs.gradle-enterprise-secret-access-key }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ inputs.gradle-enterprise-cache-user }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ inputs.gradle-enterprise-cache-password }}
DEVELOCITY_ACCESS_KEY: ${{ inputs.develocity-access-key }}
run: ./gradlew -PdeploymentRepository=$(pwd)/deployment-repository build publishAllPublicationsToDeploymentRepository
- name: Read Version From gradle.properties
id: read-version

View File

@ -17,9 +17,7 @@ jobs:
id: build-and-publish
uses: ./.github/actions/build
with:
gradle-enterprise-secret-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
gradle-enterprise-cache-user: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
gradle-enterprise-cache-password: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
publish: true
- name: Deploy
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1

View File

@ -44,9 +44,7 @@ jobs:
with:
java-version: ${{ matrix.java.version }}
java-toolchain: ${{ matrix.java.toolchain }}
gradle-enterprise-secret-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
gradle-enterprise-cache-user: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
gradle-enterprise-cache-password: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
- name: Send Notification
uses: ./.github/actions/send-notification
if: always()

View File

@ -17,9 +17,7 @@ jobs:
id: build-and-publish
uses: ./.github/actions/build
with:
gradle-enterprise-cache-password: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
gradle-enterprise-cache-user: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
gradle-enterprise-secret-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
publish: true
- name: Stage Release
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1

View File

@ -42,7 +42,7 @@ dependencies {
implementation(platform("org.springframework:spring-framework-bom:${versions.springFramework}"))
implementation("com.diffplug.gradle:goomph:3.37.2")
implementation("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}")
implementation("com.gradle:gradle-enterprise-gradle-plugin:3.12.1")
implementation("com.gradle:develocity-gradle-plugin:3.17.2")
implementation("com.tngtech.archunit:archunit:1.0.0")
implementation("commons-codec:commons-codec:${versions.commonsCodec}")
implementation("de.undercouch.download:de.undercouch.download.gradle.plugin:5.5.0")

View File

@ -24,8 +24,9 @@ import java.util.Set;
import java.util.TreeMap;
import java.util.stream.Collectors;
import com.gradle.enterprise.gradleplugin.testretry.TestRetryExtension;
import com.gradle.enterprise.gradleplugin.testselection.PredictiveTestSelectionExtension;
import com.gradle.develocity.agent.gradle.test.DevelocityTestConfiguration;
import com.gradle.develocity.agent.gradle.test.PredictiveTestSelectionConfiguration;
import com.gradle.develocity.agent.gradle.test.TestRetryConfiguration;
import io.spring.javaformat.gradle.SpringJavaFormatPlugin;
import io.spring.javaformat.gradle.tasks.CheckFormat;
import io.spring.javaformat.gradle.tasks.Format;
@ -178,7 +179,9 @@ class JavaConventions {
}
private void configureTestRetries(Test test) {
TestRetryExtension testRetry = test.getExtensions().getByType(TestRetryExtension.class);
TestRetryConfiguration testRetry = test.getExtensions()
.getByType(DevelocityTestConfiguration.class)
.getTestRetry();
testRetry.getFailOnPassedAfterRetry().set(false);
testRetry.getMaxRetries().set(isCi() ? 3 : 0);
}
@ -189,8 +192,9 @@ class JavaConventions {
private void configurePredictiveTestSelection(Test test) {
if (isPredictiveTestSelectionEnabled()) {
PredictiveTestSelectionExtension predictiveTestSelection = test.getExtensions()
.getByType(PredictiveTestSelectionExtension.class);
PredictiveTestSelectionConfiguration predictiveTestSelection = test.getExtensions()
.getByType(DevelocityTestConfiguration.class)
.getPredictiveTestSelection();
predictiveTestSelection.getEnabled().convention(true);
}
}

View File

@ -55,7 +55,7 @@ class ConventionsPluginTests {
File settingsFile = new File(this.projectDir, "settings.gradle");
try (PrintWriter out = new PrintWriter(new FileWriter(settingsFile))) {
out.println("plugins {");
out.println(" id 'com.gradle.enterprise'");
out.println(" id 'com.gradle.develocity'");
out.println("}");
out.println("include ':spring-boot-project:spring-boot-parent'");
}

View File

@ -19,8 +19,8 @@ pluginManagement {
}
plugins {
id "com.gradle.enterprise" version "3.15.1"
id "io.spring.ge.conventions" version "0.0.16"
id "com.gradle.develocity" version "3.17.2"
id "io.spring.ge.conventions" version "0.0.17"
}
rootProject.name="spring-boot-build"
@ -28,7 +28,7 @@ rootProject.name="spring-boot-build"
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
settings.gradle.projectsLoaded {
gradleEnterprise {
develocity {
buildScan {
def toolchainVersion = settings.gradle.rootProject.findProperty('toolchainVersion')
if (toolchainVersion != null) {

View File

@ -240,8 +240,10 @@ def documentationTest = tasks.register("documentationTest", Test) {
}
jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
outputs.dir("${buildDir}/generated-snippets")
predictiveSelection {
enabled = false
develocity {
predictiveTestSelection {
enabled = false
}
}
}

View File

@ -21,9 +21,11 @@ test {
throw new GradleException("No tests were executed")
}
}
}
}
}
predictiveSelection {
enabled = false
develocity {
predictiveTestSelection {
enabled = false
}
}
}