From 266b018a9d4fed9f5e5b2b84f0e3b54b4e84b020 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Fri, 7 Mar 2014 14:41:37 -0500 Subject: [PATCH] Add MergePlugin source --- .../build/gradle/MergePlugin.groovy | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy diff --git a/buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy b/buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy new file mode 100644 index 00000000..ab4a0d3c --- /dev/null +++ b/buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy @@ -0,0 +1,160 @@ +/* + * Copyright 2002-2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.build.gradle + +import org.gradle.api.* +import org.gradle.api.artifacts.Configuration +import org.gradle.api.artifacts.ProjectDependency; +import org.gradle.api.artifacts.maven.Conf2ScopeMapping +import org.gradle.api.plugins.MavenPlugin +import org.gradle.api.tasks.* +import org.gradle.plugins.ide.eclipse.EclipsePlugin +import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; +import org.gradle.plugins.ide.idea.IdeaPlugin +import org.gradle.api.invocation.* + + +/** + * Gradle plugin that allows projects to merged together. Primarily developed to + * allow Spring to support multiple incompatible versions of third-party + * dependencies (for example Hibernate v3 and v4). + *

+ * The 'merge' extension should be used to define how projects are merged, for example: + *

+ * configure(subprojects) {
+ *     apply plugin: MergePlugin
+ * }
+ *
+ * project("myproject") {
+ * }
+ *
+ * project("myproject-extra") {
+ *     merge.into = project("myproject")
+ * }
+ * 
+ *

+ * This plugin adds two new configurations: + *