Skip to content

Commit 2dcce8c

Browse files
committed
Upgrade to Gradle 4.10.2
Due to an upgrade of the Artifactory publication plugin on the CI server, we need to upgrade the build for 4.3.x to Gradle 4.x. Closes gh-24392
1 parent 032100c commit 2dcce8c

File tree

10 files changed

+37
-69
lines changed

10 files changed

+37
-69
lines changed

build.gradle

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@ buildscript {
33
maven { url "https://repo.spring.io/plugins-release" }
44
}
55
dependencies {
6-
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
7-
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.2")
6+
classpath("io.spring.gradle:propdeps-plugin:0.0.9.RELEASE")
87
classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
8+
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.2")
99
classpath("ws.antonov.gradle.plugins:gradle-plugin-protobuf:0.9.1")
1010
}
1111
}
1212

13-
plugins {
14-
id "org.sonarqube" version "1.1"
15-
}
16-
1713
ext {
1814
linkHomepage = 'https://projects.spring.io/spring-framework'
1915
linkCi = 'https://build.spring.io/browse/SPR'
@@ -222,12 +218,6 @@ configure(subprojects - project(":spring-build-src")) { subproject ->
222218
jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
223219
}
224220

225-
gradle.taskGraph.whenReady {taskGraph ->
226-
if (taskGraph.hasTask(':sonarqube')) {
227-
test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
228-
}
229-
}
230-
231221
jar {
232222
manifest.attributes["Created-By"] =
233223
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
@@ -1134,20 +1124,6 @@ project("spring-framework-bom") {
11341124
}
11351125
}
11361126

1137-
sonarqube {
1138-
properties {
1139-
property "sonar.projectName", "Spring Framework"
1140-
property "sonar.profile", "Spring Framework"
1141-
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
1142-
property "sonar.links.homepage", linkHomepage
1143-
property "sonar.links.ci", linkCi
1144-
property "sonar.links.issue", linkIssue
1145-
property "sonar.links.scm", linkScmUrl
1146-
property "sonar.links.scm_dev", linkScmDevConnection
1147-
property "sonar.java.coveragePlugin", "jacoco"
1148-
}
1149-
}
1150-
11511127
configure(rootProject) {
11521128
description = "Spring Framework"
11531129

@@ -1370,9 +1346,9 @@ configure(rootProject) {
13701346
archives distZip
13711347
}
13721348

1373-
task wrapper(type: Wrapper) {
1349+
wrapper {
13741350
description = "Generates gradlew[.bat] scripts"
1375-
gradleVersion = "2.14.1"
1351+
gradleVersion = "4.10.2"
13761352

13771353
doLast() {
13781354
def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
@@ -1388,21 +1364,6 @@ configure(rootProject) {
13881364

13891365
}
13901366

1391-
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1392-
sonarqube {
1393-
skipProject = true
1394-
}
1395-
}
1396-
1397-
configure(project(':spring-core')) {
1398-
sonarqube {
1399-
properties {
1400-
property "sonar.exclusions",
1401-
"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
1402-
}
1403-
}
1404-
}
1405-
14061367
/*
14071368
* Support publication of artifacts versioned by topic branch.
14081369
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.

gradle/ide.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ eclipse.classpath.file.whenMerged { classpath ->
2121
def projectName = matcher[0][1]
2222
def path = "/${projectName}"
2323
if(!classpath.entries.find { e -> e instanceof ProjectDependency && e.path == path }) {
24-
def dependency = new ProjectDependency(path, project(":${projectName}").path)
24+
def dependency = new ProjectDependency(path)
2525
dependency.exported = true
2626
classpath.entries.add(dependency)
2727
}

gradle/wrapper/gradle-wrapper.jar

2.79 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Wed Aug 17 21:21:18 CEST 2016
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip

gradlew

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22

33
##############################################################################
44
##
@@ -34,11 +34,11 @@ DEFAULT_JVM_OPTS=""
3434
# Use the maximum available, or set MAX_FD != -1 to use that value.
3535
MAX_FD="maximum"
3636

37-
warn ( ) {
37+
warn () {
3838
echo "$*"
3939
}
4040

41-
die ( ) {
41+
die () {
4242
echo
4343
echo "$*"
4444
echo
@@ -155,11 +155,19 @@ if $cygwin ; then
155155
esac
156156
fi
157157

158-
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
159-
function splitJvmOpts() {
160-
JVM_OPTS=("$@")
158+
# Escape application args
159+
save () {
160+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
161+
echo " "
161162
}
162-
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
163-
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163+
APP_ARGS=$(save "$@")
164164

165-
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165+
# Collect all arguments for the java command, following the shell quoting and substitution rules
166+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
167+
168+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
169+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
170+
cd "$(dirname "$0")"
171+
fi
172+
173+
exec "$JAVACMD" "$@"

gradlew.bat

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ goto fail
5050
@rem Get command-line arguments, handling Windows variants
5151

5252
if not "%OS%" == "Windows_NT" goto win9xME_args
53-
if "%@eval[2+2]" == "4" goto 4NT_args
5453

5554
:win9xME_args
5655
@rem Slurp the command line arguments.
@@ -61,11 +60,6 @@ set _SKIP=2
6160
if "x%~1" == "x" goto execute
6261

6362
set CMD_LINE_ARGS=%*
64-
goto execute
65-
66-
:4NT_args
67-
@rem Get arguments from the 4NT Shell from JP Software
68-
set CMD_LINE_ARGS=%$
6963

7064
:execute
7165
@rem Setup the command line

spring-context/src/test/resources/org/springframework/scripting/groovy/ScriptBean.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package org.springframework.scripting.groovy;
2+
13
import org.springframework.context.ApplicationContext
24
import org.springframework.context.ApplicationContextAware
35
import org.springframework.scripting.ContextScriptBean

spring-context/src/test/resources/org/springframework/scripting/groovy/TestFactoryBean.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package org.springframework.scripting.groovy;
2+
13
import org.springframework.beans.factory.FactoryBean
24

35
class TestFactoryBean implements FactoryBean {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
package org.springframework.scripting.groovy;
2+
13
return 3 * 2

spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityToolboxView.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323

2424
import org.apache.velocity.VelocityContext;
2525
import org.apache.velocity.context.Context;
26-
import org.apache.velocity.tools.view.ToolboxManager;
27-
import org.apache.velocity.tools.view.context.ChainedContext;
28-
import org.apache.velocity.tools.view.servlet.ServletToolboxManager;
2926

3027
import org.springframework.util.ClassUtils;
3128
import org.springframework.util.ReflectionUtils;
@@ -99,18 +96,21 @@ protected String getToolboxConfigLocation() {
9996
* @see #initTool
10097
*/
10198
@Override
99+
@SuppressWarnings({ "rawtypes", "unchecked" })
102100
protected Context createVelocityContext(
103101
Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
104102

105103
// Create a ChainedContext instance.
106-
ChainedContext velocityContext = new ChainedContext(
107-
new VelocityContext(model), getVelocityEngine(), request, response, getServletContext());
104+
org.apache.velocity.tools.view.context.ChainedContext velocityContext =
105+
new org.apache.velocity.tools.view.context.ChainedContext(
106+
new VelocityContext(model), getVelocityEngine(), request, response, getServletContext());
108107

109108
// Load a Velocity Tools toolbox, if necessary.
110109
if (getToolboxConfigLocation() != null) {
111-
ToolboxManager toolboxManager = ServletToolboxManager.getInstance(
112-
getServletContext(), getToolboxConfigLocation());
113-
Map<?, ?> toolboxContext = toolboxManager.getToolbox(velocityContext);
110+
org.apache.velocity.tools.view.ToolboxManager toolboxManager =
111+
org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance(
112+
getServletContext(), getToolboxConfigLocation());
113+
Map toolboxContext = toolboxManager.getToolbox(velocityContext);
114114
velocityContext.setToolbox(toolboxContext);
115115
}
116116

0 commit comments

Comments
 (0)