浏览代码

Update to 3.2.x and added eclipse suffix to eclipse projects

Rob Winch 12 年之前
父节点
当前提交
ace6b804f7
共有 3 个文件被更改,包括 16 次插入8 次删除
  1. 8 2
      buildSrc/src/main/groovy/aspectj/AspectJPlugin.groovy
  2. 1 1
      gradle.properties
  3. 7 5
      gradle/ide-integration.gradle

+ 8 - 2
buildSrc/src/main/groovy/aspectj/AspectJPlugin.groovy

@@ -11,6 +11,7 @@ import org.gradle.api.GradleException
 
 import org.gradle.plugins.ide.eclipse.GenerateEclipseProject
 import org.gradle.plugins.ide.eclipse.GenerateEclipseClasspath
+import org.gradle.plugins.ide.eclipse.EclipsePlugin
 import org.gradle.plugins.ide.eclipse.model.BuildCommand
 import org.gradle.plugins.ide.eclipse.model.ProjectDependency
 
@@ -63,8 +64,13 @@ class AspectJPlugin implements Plugin<Project> {
         project.tasks.withType(GenerateEclipseClasspath) {
             project.eclipse.classpath.file.whenMerged { classpath ->
                 def entries = classpath.entries.findAll { it instanceof ProjectDependency}.findAll { entry ->
-                    def projectPath = entry.path.replaceAll('/',':')
-                    project.rootProject.findProject(projectPath).plugins.findPlugin(AspectJPlugin)
+                    def projectPath = entry.path.replaceAll('/','')
+                    project.rootProject.allprojects.find{ p->
+                        if(p.plugins.findPlugin(EclipsePlugin)) {
+                            return p.eclipse.project.name == projectPath && p.plugins.findPlugin(AspectJPlugin)
+                        }
+                        false
+                    }
                 }
                 entries.each { entry->
                     entry.entryAttributes.put('org.eclipse.ajdt.aspectpath','org.eclipse.ajdt.aspectpath')

+ 1 - 1
gradle.properties

@@ -1 +1 @@
-version=3.1.4.CI-SNAPSHOT
+version=3.2.0.CI-SNAPSHOT

+ 7 - 5
gradle/ide-integration.gradle

@@ -1,10 +1,12 @@
-apply plugin: 'idea'
-
-configure(javaProjects) {
+configure(allprojects) {
     apply plugin: 'idea'
     apply plugin: 'eclipse-wtp'
 
-    eclipse.classpath.downloadSources = true
+    eclipse.project.name = "${project.name}-3.2.x"
+}
+
+configure(javaProjects) {
+     eclipse.classpath.downloadSources = true
 
     // GRADLE-1116
     project.eclipse.classpath.file.whenMerged { classpath ->
@@ -49,7 +51,7 @@ project(':spring-security-samples-aspectj') {
         doLast {
             def classpath = new XmlParser().parse(srcFile)
 
-            classpath.classpathentry.findAll{ it.@path == '/spring-security-aspects' }.each { node ->
+            classpath.classpathentry.findAll{ it.@path.startsWith('/spring-security-aspects') }.each { node ->
                 if(node.children().size() == 0) {
                     def attrs = new Node(node,'attributes')
                     def adjtAttr = new Node(attrs,'attributes',[name: 'org.eclipse.ajdt.aspectpath', value: 'org.eclipse.ajdt.aspectpath'])