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

This commit is contained in:
Rob Winch 2012-11-01 16:12:41 -05:00
parent c0dfb70ca0
commit ace6b804f7
3 changed files with 16 additions and 8 deletions

View File

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

View File

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

View File

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