Skip to content

Commit bf205bf

Browse files
sslavicrwinch
authored andcommitted
Eliminate Gradle 1.6 deprecation warnings
Recently Spring framework build has been updated to use Gradle 1.6. With the new version some of the Gradle APIs have been deprecated. These deprecated APIs have been used by Spring build specific Gradle plugins, which resulted in deprecation warnings in build output. This patch changes Spring build specific Gradle plugins to use new Gradle APIs instead of deprecated ones. Even after this change build still produces warnings about Gradle deprecated APIs being used. These come from Spring shared Gradle plugins and other 3rd party Gradle plugins in use, like Gradle Artifactory Plugin (GAP), which are still not updated to Gradle 1.6. Related tickets for updating of these plugins to Gradle 1.6 are GRADLE-53 and GAP-144, and once they get resolved Spring framework build should further be updated. Issue: SPR-10572
1 parent 3865a87 commit bf205bf

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

buildSrc/src/main/groovy/org/springframework/build/gradle/DetectSplitPackagesPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import org.gradle.api.tasks.TaskAction
4949
public class DetectSplitPackagesPlugin implements Plugin<Project> {
5050
public void apply(Project project) {
5151
def tasks = project.tasks
52-
Task detectSplitPackages = tasks.add("detectSplitPackages", DetectSplitPackagesTask.class)
52+
Task detectSplitPackages = tasks.create("detectSplitPackages", DetectSplitPackagesTask.class)
5353
if (tasks.asMap.containsKey("check")) {
5454
tasks.getByName("check").dependsOn detectSplitPackages
5555
}

buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class MergePlugin implements Plugin<Project> {
6767
project.plugins.apply(IdeaPlugin)
6868

6969
MergeModel model = project.extensions.create("merge", MergeModel)
70-
project.configurations.add("merging")
71-
Configuration runtimeMerge = project.configurations.add("runtimeMerge")
70+
project.configurations.create("merging")
71+
Configuration runtimeMerge = project.configurations.create("runtimeMerge")
7272

7373
// Ensure the IDE can reference merged projects
7474
project.eclipse.classpath.plusConfigurations += [runtimeMerge]
@@ -121,7 +121,7 @@ class MergePlugin implements Plugin<Project> {
121121
project.configurations.each { configuration ->
122122
Conf2ScopeMapping mapping = project.conf2ScopeMappings.getMapping([configuration])
123123
if(mapping.scope) {
124-
Configuration intoConfiguration = project.merge.into.configurations.add(
124+
Configuration intoConfiguration = project.merge.into.create(
125125
project.name + "-" + configuration.name)
126126
configuration.excludeRules.each {
127127
configuration.exclude([
@@ -153,6 +153,13 @@ class MergePlugin implements Plugin<Project> {
153153
}
154154
});
155155
}
156+
157+
// private Configuration createConfiguration(Project project, String name) {
158+
// if (project.configurations.respondsTo('create', String)) {
159+
// return project.configurations.create(name)
160+
// }
161+
// project.configurations.add(name)
162+
// }
156163
}
157164

158165
class MergeModel {

0 commit comments

Comments
 (0)