Skip to content

Commit

Permalink
Upgrade to Gradle 4.10.2
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sbrannen committed Jan 17, 2020
1 parent 032100c commit 2dcce8c
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 69 deletions.
47 changes: 4 additions & 43 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ buildscript {
maven { url "https://repo.spring.io/plugins-release" }
}
dependencies {
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.2")
classpath("io.spring.gradle:propdeps-plugin:0.0.9.RELEASE")
classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.2")
classpath("ws.antonov.gradle.plugins:gradle-plugin-protobuf:0.9.1")
}
}

plugins {
id "org.sonarqube" version "1.1"
}

ext {
linkHomepage = 'https://projects.spring.io/spring-framework'
linkCi = 'https://build.spring.io/browse/SPR'
Expand Down Expand Up @@ -222,12 +218,6 @@ configure(subprojects - project(":spring-build-src")) { subproject ->
jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
}

gradle.taskGraph.whenReady {taskGraph ->
if (taskGraph.hasTask(':sonarqube')) {
test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
}
}

jar {
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
Expand Down Expand Up @@ -1134,20 +1124,6 @@ project("spring-framework-bom") {
}
}

sonarqube {
properties {
property "sonar.projectName", "Spring Framework"
property "sonar.profile", "Spring Framework"
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
property "sonar.links.homepage", linkHomepage
property "sonar.links.ci", linkCi
property "sonar.links.issue", linkIssue
property "sonar.links.scm", linkScmUrl
property "sonar.links.scm_dev", linkScmDevConnection
property "sonar.java.coveragePlugin", "jacoco"
}
}

configure(rootProject) {
description = "Spring Framework"

Expand Down Expand Up @@ -1370,9 +1346,9 @@ configure(rootProject) {
archives distZip
}

task wrapper(type: Wrapper) {
wrapper {
description = "Generates gradlew[.bat] scripts"
gradleVersion = "2.14.1"
gradleVersion = "4.10.2"

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

}

configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
sonarqube {
skipProject = true
}
}

configure(project(':spring-core')) {
sonarqube {
properties {
property "sonar.exclusions",
"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
}
}
}

/*
* Support publication of artifacts versioned by topic branch.
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
Expand Down
2 changes: 1 addition & 1 deletion gradle/ide.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ eclipse.classpath.file.whenMerged { classpath ->
def projectName = matcher[0][1]
def path = "/${projectName}"
if(!classpath.entries.find { e -> e instanceof ProjectDependency && e.path == path }) {
def dependency = new ProjectDependency(path, project(":${projectName}").path)
def dependency = new ProjectDependency(path)
dependency.exported = true
classpath.entries.add(dependency)
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Aug 17 21:21:18 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
26 changes: 17 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -34,11 +34,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,11 +155,19 @@ if $cygwin ; then
esac
fi

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

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
6 changes: 0 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants

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

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

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package org.springframework.scripting.groovy;

import org.springframework.context.ApplicationContext
import org.springframework.context.ApplicationContextAware
import org.springframework.scripting.ContextScriptBean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package org.springframework.scripting.groovy;

import org.springframework.beans.factory.FactoryBean

class TestFactoryBean implements FactoryBean {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
package org.springframework.scripting.groovy;

return 3 * 2
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

import org.apache.velocity.VelocityContext;
import org.apache.velocity.context.Context;
import org.apache.velocity.tools.view.ToolboxManager;
import org.apache.velocity.tools.view.context.ChainedContext;
import org.apache.velocity.tools.view.servlet.ServletToolboxManager;

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

// Create a ChainedContext instance.
ChainedContext velocityContext = new ChainedContext(
new VelocityContext(model), getVelocityEngine(), request, response, getServletContext());
org.apache.velocity.tools.view.context.ChainedContext velocityContext =
new org.apache.velocity.tools.view.context.ChainedContext(
new VelocityContext(model), getVelocityEngine(), request, response, getServletContext());

// Load a Velocity Tools toolbox, if necessary.
if (getToolboxConfigLocation() != null) {
ToolboxManager toolboxManager = ServletToolboxManager.getInstance(
getServletContext(), getToolboxConfigLocation());
Map<?, ?> toolboxContext = toolboxManager.getToolbox(velocityContext);
org.apache.velocity.tools.view.ToolboxManager toolboxManager =
org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance(
getServletContext(), getToolboxConfigLocation());
Map toolboxContext = toolboxManager.getToolbox(velocityContext);
velocityContext.setToolbox(toolboxContext);
}

Expand Down

0 comments on commit 2dcce8c

Please sign in to comment.