[ci] Upgrade spring-framework test project to v5.3.13

This commit is contained in:
Andreas Dangel
2021-11-19 10:43:38 +01:00
parent cb8158cd90
commit 769639f3b6
2 changed files with 70 additions and 33 deletions

View File

@ -34,7 +34,7 @@ mvn dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=classpath.t
<name>spring-framework</name>
<type>git</type>
<connection>https://github.com/spring-projects/spring-framework</connection>
<tag>v5.0.6.RELEASE</tag>
<tag>v5.3.13</tag>
<exclude-pattern>.*/build/generated-sources/.*</exclude-pattern>
@ -45,55 +45,95 @@ fi
set -e
# Note: openjdk8 will be installed by "before_install.sh"
export JAVA_HOME=${HOME}/openjdk8
# Make sure to use java11. This is already installed by build.sh
export JAVA_HOME=${HOME}/openjdk11
export PATH=$JAVA_HOME/bin:$PATH
## Patches
# keep the tabs!!
# Patch 1: See https://github.com/spring-projects/spring-framework/commit/381b7d035a16d430b8783b7390c1677c9e7d1f68
# and https://github.com/spring-projects/spring-framework/commit/9e1ed6c7718d38c4b9fe5f75921abad33264307c
(cat <<EOF
--- build.gradle 2020-11-14 09:43:51.705417551 +0000
+++ build.gradle.patched 2020-11-14 09:43:27.265215303 +0000
@@ -1,5 +1,6 @@
buildscript {
repositories {
+ mavenCentral()
maven { url "https://repo.spring.io/plugins-release" }
}
dependencies {
@@ -138,6 +139,7 @@
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
index 37f5884e67..53022443ee 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
@@ -539,7 +539,9 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA
*/
@SuppressWarnings({"deprecation", "cast"})
protected boolean determineRequiredStatus(MergedAnnotation<?> ann) {
- return determineRequiredStatus(
+ // Cast to (AnnotationAttributes) is required. Otherwise, the :spring-beans:compileGroovy
+ // task fails in the Gradle build.
+ return determineRequiredStatus((AnnotationAttributes)
ann.asMap(mergedAnnotation -> new AnnotationAttributes(mergedAnnotation.getType())));
}
repositories {
+ mavenCentral()
maven { url "https://repo.spring.io/libs-release" }
}
EOF
) | patch --strip=1
# Patch 2: Ignore compiler warnings
(cat <<EOF
diff --git a/buildSrc/src/main/java/org/springframework/build/compile/CompilerConventionsPlugin.java b/buildSrc/src/main/java/org/springframework/build/compile/CompilerConventionsPlugin.java
index f2424c549e..b6ec8b04da 100644
--- a/buildSrc/src/main/java/org/springframework/build/compile/CompilerConventionsPlugin.java
+++ b/buildSrc/src/main/java/org/springframework/build/compile/CompilerConventionsPlugin.java
@@ -51,7 +51,7 @@ public class CompilerConventionsPlugin implements Plugin<Project> {
COMPILER_ARGS.addAll(commonCompilerArgs);
COMPILER_ARGS.addAll(Arrays.asList(
"-Xlint:varargs", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
- "-Xlint:unchecked", "-Werror"
+ "-Xlint:unchecked"//, "-Werror"
));
TEST_COMPILER_ARGS = new ArrayList<>();
TEST_COMPILER_ARGS.addAll(commonCompilerArgs);
diff --git a/spring-beans/spring-beans.gradle b/spring-beans/spring-beans.gradle
index e3f6f73b76..48c4d9e3fb 100644
--- a/spring-beans/spring-beans.gradle
+++ b/spring-beans/spring-beans.gradle
@@ -23,7 +23,7 @@ sourceSets {
}
@@ -314,3 +316,20 @@
compileGroovy {
- options.compilerArgs += "-Werror"
+// options.compilerArgs += "-Werror"
}
// This module also builds Kotlin code and the compileKotlin task naturally depends on
EOF
) | patch --strip=1
# Patch 3: Add task createSquishClasspath
(cat <<EOF
diff --git a/build.gradle b/build.gradle
index 6021fa574d..15d29ed699 100644
--- a/build.gradle
+++ b/build.gradle
@@ -431,3 +431,19 @@ configure(rootProject) {
}
}
return version
}
+
+// see https://stackoverflow.com/questions/28986968/generate-classpath-from-all-multiproject-gradle-build-dependencies
+task createSquishClasspath {
+ doLast {
+ def dependencies = new HashSet()
+ dependencies.addAll(subprojects.configurations.compile.resolvedConfiguration.resolvedArtifacts.file.flatten())
+ dependencies.addAll(subprojects.configurations.optional.resolvedConfiguration.resolvedArtifacts.file.flatten())
+ dependencies.addAll(subprojects.configurations.testCompile.resolvedConfiguration.resolvedArtifacts.file.flatten())
+ dependencies.addAll(subprojects.configurations.testRuntime.resolvedConfiguration.resolvedArtifacts.file.flatten())
+ def dependencies = new LinkedHashSet()
+ dependencies.addAll(moduleProjects.configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.file.flatten())
+ dependencies.addAll(moduleProjects.configurations.testCompileClasspath.resolvedConfiguration.resolvedArtifacts.file.flatten())
+
+ def paths = new ArrayList()
+ paths.addAll(subprojects.jar.outputs.files.asPath)
+ paths.addAll(subprojects.sourceSets.test.output.resourcesDir)
+ paths.addAll(subprojects.sourceSets.test.output.classesDirs.files.flatten())
+ paths.addAll(moduleProjects.jar.outputs.files.asPath)
+ paths.addAll(moduleProjects.sourceSets.test.output.resourcesDir)
+ paths.addAll(moduleProjects.sourceSets.test.output.classesDirs.files.flatten())
+ paths.addAll(dependencies)
+ println paths.join(File.pathSeparator)
+ }
+}
EOF
) | patch
) | patch --strip=1
./gradlew build testClasses -x javadoc -x dokka -x asciidoctor -x test -x testNG -x api -x distZip
./gradlew createSquishClasspath -q > classpath.txt
./gradlew --console=plain --build-cache --no-daemon --max-workers=4 build testClasses -x test -x javadoc -x api -x asciidoctor -x asciidoctorPdf
./gradlew --console=plain --build-cache --no-daemon --max-workers=4 createSquishClasspath -q > classpath.txt
]]></build-command>
<auxclasspath-command>cat classpath.txt</auxclasspath-command>
</project>

View File

@ -13,9 +13,6 @@ source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
# PMD_CI_CHUNK_TOKEN
function regression_tester_setup_ci() {
pmd_ci_log_info "Install openjdk8 for pmd-regression-tests"
pmd_ci_openjdk_install_adoptopenjdk 8
gpg --batch --yes --decrypt --passphrase="GnxdjywUEPveyCD1RLiTd7t8CImnefYr" \
--output .ci/files/public-env .ci/files/public-env.gpg
# shellcheck disable=SC1091