Skip to content

Commit d2e5f2a

Browse files
Update Gradle to 7.2
Closes gh-9615
1 parent 7d81a52 commit d2e5f2a

File tree

47 files changed

+218
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+218
-163
lines changed

acl/spring-security-acl.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply plugin: 'io.spring.convention.spring-module'
22

33
dependencies {
4-
management platform(project(":spring-security-dependencies"))
4+
api platform(project(":spring-security-dependencies"))
55
api project(':spring-security-core')
66
api 'org.springframework:spring-aop'
77
api 'org.springframework:spring-context'

aspects/spring-security-aspects.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'io.spring.convention.spring-module'
22
apply plugin: 'io.freefair.aspectj'
33

44
dependencies {
5-
management platform(project(":spring-security-dependencies"))
5+
api platform(project(":spring-security-dependencies"))
66
api "org.aspectj:aspectjrt"
77
api project(':spring-security-core')
88
api 'org.springframework:spring-beans'

buildSrc/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ dependencies {
8181
implementation 'com.apollographql.apollo:apollo-runtime:2.4.5'
8282
implementation 'com.github.ben-manes:gradle-versions-plugin:0.38.0'
8383
implementation 'com.github.spullara.mustache.java:compiler:0.9.4'
84-
implementation 'io.spring.gradle:propdeps-plugin:0.0.10.RELEASE'
8584
implementation 'io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.15'
8685
implementation 'io.spring.nohttp:nohttp-gradle:0.0.10'
8786
implementation 'net.sourceforge.htmlunit:htmlunit:2.37.0'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

buildSrc/src/main/groovy/io/spring/gradle/convention/AbstractSpringJavaPlugin.groovy

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,17 @@
1616

1717
package io.spring.gradle.convention;
1818

19-
import io.spring.gradle.propdeps.PropDepsMavenPlugin;
2019
import org.gradle.api.Plugin;
2120
import org.gradle.api.Project;
2221
import org.gradle.api.plugins.GroovyPlugin;
23-
import org.gradle.api.plugins.JavaPlugin;
24-
import org.gradle.api.plugins.MavenPlugin;
22+
import org.gradle.api.plugins.JavaPlugin
2523
import org.gradle.api.plugins.PluginManager;
26-
import org.gradle.internal.impldep.org.apache.maven.Maven;
2724
import org.gradle.plugins.ide.eclipse.EclipseWtpPlugin;
2825
import org.gradle.plugins.ide.idea.IdeaPlugin;
29-
import io.spring.gradle.propdeps.PropDepsEclipsePlugin;
30-
import io.spring.gradle.propdeps.PropDepsIdeaPlugin;
31-
import io.spring.gradle.propdeps.PropDepsPlugin
32-
import org.springframework.gradle.CopyPropertiesPlugin;
26+
import org.springframework.gradle.CopyPropertiesPlugin
27+
import org.springframework.gradle.propdeps.PropDepsEclipsePlugin
28+
import org.springframework.gradle.propdeps.PropDepsIdeaPlugin
29+
import org.springframework.gradle.propdeps.PropDepsPlugin;
3330

3431
/**
3532
* @author Rob Winch
@@ -40,7 +37,6 @@ public abstract class AbstractSpringJavaPlugin implements Plugin<Project> {
4037
public final void apply(Project project) {
4138
PluginManager pluginManager = project.getPluginManager();
4239
pluginManager.apply(JavaPlugin.class);
43-
pluginManager.apply(ManagementConfigurationPlugin.class);
4440
if (project.file("src/main/groovy").exists()
4541
|| project.file("src/test/groovy").exists()
4642
|| project.file("src/integration-test/groovy").exists()) {
@@ -52,9 +48,6 @@ public abstract class AbstractSpringJavaPlugin implements Plugin<Project> {
5248
pluginManager.apply(PropDepsPlugin);
5349
pluginManager.apply(PropDepsEclipsePlugin);
5450
pluginManager.apply(PropDepsIdeaPlugin);
55-
project.getPlugins().withType(MavenPlugin) {
56-
pluginManager.apply(PropDepsMavenPlugin);
57-
}
5851
pluginManager.apply("io.spring.convention.tests-configuration");
5952
pluginManager.apply("io.spring.convention.integration-test");
6053
pluginManager.apply("io.spring.convention.javadoc-options");

buildSrc/src/main/groovy/io/spring/gradle/convention/IntegrationTestPlugin.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package io.spring.gradle.convention
1717

18-
import io.spring.gradle.propdeps.PropDepsPlugin
1918
import org.gradle.api.Plugin
2019
import org.gradle.api.Project
2120
import org.gradle.api.Task
@@ -24,6 +23,7 @@ import org.gradle.api.plugins.JavaPlugin
2423
import org.gradle.api.tasks.testing.Test
2524
import org.gradle.plugins.ide.eclipse.EclipsePlugin
2625
import org.gradle.plugins.ide.idea.IdeaPlugin
26+
import org.springframework.gradle.propdeps.PropDepsPlugin
2727

2828
/**
2929
*
@@ -54,7 +54,7 @@ public class IntegrationTestPlugin implements Plugin<Project> {
5454
}
5555
project.configurations {
5656
integrationTestCompile {
57-
extendsFrom testCompile, testImplementation
57+
extendsFrom testImplementation
5858
}
5959
integrationTestRuntime {
6060
extendsFrom integrationTestCompile, testRuntime, testRuntimeOnly

buildSrc/src/main/groovy/io/spring/gradle/convention/ManagementConfigurationPlugin.java

Lines changed: 0 additions & 59 deletions
This file was deleted.

buildSrc/src/main/groovy/io/spring/gradle/convention/OssrhPlugin.groovy

Lines changed: 0 additions & 26 deletions
This file was deleted.

buildSrc/src/main/groovy/io/spring/gradle/convention/SpringModulePlugin.groovy

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ class SpringModulePlugin extends AbstractSpringJavaPlugin {
3737
def deployArtifacts = project.task("deployArtifacts")
3838
deployArtifacts.group = 'Deploy tasks'
3939
deployArtifacts.description = "Deploys the artifacts to either Artifactory or Maven Central"
40-
if (Utils.isRelease(project)) {
41-
deployArtifacts.dependsOn project.tasks.uploadArchives
42-
}
43-
else {
40+
if (!Utils.isRelease(project)) {
4441
deployArtifacts.dependsOn project.tasks.artifactoryPublish
4542
}
4643
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2002-2021 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.gradle.propdeps
18+
19+
20+
import org.gradle.api.Plugin
21+
import org.gradle.api.Project
22+
import org.gradle.plugins.ide.eclipse.EclipsePlugin
23+
24+
/**
25+
* Plugin to allow optional and provided dependency configurations to work with the
26+
* standard gradle 'eclipse' plugin
27+
*
28+
* @author Phillip Webb
29+
*/
30+
class PropDepsEclipsePlugin implements Plugin<Project> {
31+
32+
public void apply(Project project) {
33+
project.plugins.apply(PropDepsPlugin)
34+
project.plugins.apply(EclipsePlugin)
35+
36+
project.eclipse {
37+
classpath {
38+
plusConfigurations += [project.configurations.provided, project.configurations.optional]
39+
}
40+
}
41+
}
42+
43+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright 2002-2021 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.gradle.propdeps
18+
19+
20+
import org.gradle.api.Plugin
21+
import org.gradle.api.Project
22+
import org.gradle.plugins.ide.idea.IdeaPlugin
23+
24+
/**
25+
* Plugin to allow optional and provided dependency configurations to work with the
26+
* standard gradle 'idea' plugin
27+
*
28+
* @author Phillip Webb
29+
* @author Brian Clozel
30+
* @link https://youtrack.jetbrains.com/issue/IDEA-107046
31+
* @link https://youtrack.jetbrains.com/issue/IDEA-117668
32+
*/
33+
class PropDepsIdeaPlugin implements Plugin<Project> {
34+
35+
public void apply(Project project) {
36+
project.plugins.apply(PropDepsPlugin)
37+
project.plugins.apply(IdeaPlugin)
38+
project.idea.module {
39+
// IDEA internally deals with 4 scopes : COMPILE, TEST, PROVIDED, RUNTIME
40+
// but only PROVIDED seems to be picked up
41+
scopes.PROVIDED.plus += [project.configurations.provided]
42+
scopes.PROVIDED.plus += [project.configurations.optional]
43+
}
44+
}
45+
46+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Copyright 2002-2021 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.gradle.propdeps
18+
19+
20+
import org.gradle.api.Plugin
21+
import org.gradle.api.Project
22+
import org.gradle.api.artifacts.Configuration
23+
import org.gradle.api.plugins.JavaLibraryPlugin
24+
import org.gradle.api.plugins.JavaPlugin
25+
import org.gradle.api.tasks.javadoc.Javadoc
26+
27+
/**
28+
* Plugin to allow 'optional' and 'provided' dependency configurations
29+
*
30+
* As stated in the maven documentation, provided scope "is only available on the compilation and test classpath,
31+
* and is not transitive".
32+
*
33+
* This plugin creates two new configurations, and each one:
34+
* <ul>
35+
* <li>is a parent of the compile configuration</li>
36+
* <li>is not visible, not transitive</li>
37+
* <li>all dependencies are excluded from the default configuration</li>
38+
* </ul>
39+
*
40+
* @author Phillip Webb
41+
* @author Brian Clozel
42+
* @author Rob Winch
43+
*
44+
* @see <a href="https://www.gradle.org/docs/current/userguide/java_plugin.html#N121CF">Maven documentation</a>
45+
* @see <a href="https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope">Gradle configurations</a>
46+
* @see PropDepsEclipsePlugin
47+
* @see PropDepsIdeaPlugin
48+
*/
49+
class PropDepsPlugin implements Plugin<Project> {
50+
51+
public void apply(Project project) {
52+
project.plugins.apply(JavaPlugin)
53+
54+
Configuration provided = addConfiguration(project, "provided")
55+
Configuration optional = addConfiguration(project, "optional")
56+
57+
Javadoc javadoc = project.tasks.getByName(JavaPlugin.JAVADOC_TASK_NAME)
58+
javadoc.classpath = javadoc.classpath.plus(provided).plus(optional)
59+
}
60+
61+
private Configuration addConfiguration(Project project, String name) {
62+
Configuration configuration = project.configurations.create(name)
63+
configuration.extendsFrom(project.configurations.implementation)
64+
project.plugins.withType(JavaLibraryPlugin, {
65+
configuration.extendsFrom(project.configurations.api)
66+
})
67+
68+
project.sourceSets.all {
69+
compileClasspath += configuration
70+
runtimeClasspath += configuration
71+
}
72+
73+
return configuration
74+
}
75+
76+
}

buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.ossrh.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

buildSrc/src/test/java/io/spring/gradle/convention/SpringMavenPluginITest.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,6 @@ public void signArchivesWhenInMemory() throws Exception {
5555
assertThat(signature).exists();
5656
}
5757

58-
@Test
59-
public void upload() throws Exception {
60-
BuildResult result = this.testKit.withProjectResource("samples/maven/upload")
61-
.withArguments("uploadArchives")
62-
.forwardOutput()
63-
.build();
64-
assertThat(result.getOutput()).contains("SUCCESS");
65-
File pom = new File(testKit.getRootDir(), "build/poms/pom-default.xml");
66-
assertThat(pom).exists();
67-
String pomText = new String(Files.readAllBytes(pom.toPath()));
68-
assertThat(pomText.replaceAll("\\s", "")).contains("<dependency>\n <groupId>aopalliance</groupId>\n <artifactId>aopalliance</artifactId>\n <version>1.0</version>\n <scope>compile</scope>\n <optional>true</optional>\n </dependency>".replaceAll("\\s", ""));
69-
}
70-
7158
public String getSigningKey() throws Exception {
7259
return IOUtils.toString(getClass().getResource("/test-private.pgp"));
7360
}

buildSrc/src/test/resources/samples/integrationtest/withpropdeps/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ plugins {
33
}
44

55
apply plugin: 'java'
6-
apply plugin: 'propdeps'
76

87
repositories {
98
mavenCentral()

0 commit comments

Comments
 (0)