Commit bb3b8e46839b0853252bed74abc2223436db4d6d

Update AspectJPlugin to configure EclipseProject and EclipseClasspath tasks
buildSrc/src/main/groovy/aspectj/AspectJPlugin.groovy
(23 / 0)
  
99import org.gradle.api.DefaultTask
1010import org.gradle.api.GradleException
1111
12import org.gradle.plugins.eclipse.EclipseClasspath
13import org.gradle.plugins.eclipse.EclipseProject
14import org.gradle.plugins.eclipse.model.ProjectDependency
15
1216/**
1317 *
1418 * @author Luke Taylor
5050 inputs.files(sourceSet.java.srcDirs)
5151 outputs.dir(sourceSet.classesDir)
5252 aspectPath = project.files(project.configurations.aspectpath, project.jar.archivePath)
53 }
54
55 project.tasks.withType(EclipseProject).all {
56 whenConfigured { p ->
57 p.natures.add(0, 'org.eclipse.ajdt.ui.ajnature')
58 p.buildCommands = [new org.gradle.plugins.eclipse.model.BuildCommand('org.eclipse.ajdt.core.ajbuilder',[:])]
59 }
60 }
61
62 project.tasks.withType(EclipseClasspath).all {
63 whenConfigured { classpath ->
64 def entries = classpath.entries.findAll { it instanceof ProjectDependency}.findAll { entry ->
65 def projectPath = entry.path.replaceAll('/',':')
66 project.rootProject.findProject(projectPath).plugins.findPlugin(AspectJPlugin)
67 }
68 entries.each { entry->
69 entry.entryAttributes.put('org.eclipse.ajdt.aspectpath','org.eclipse.ajdt.aspectpath')
70 }
71 }
5372 }
5473 }
5574}

Comments

Add a new comment:

Login or create an account to post a comment

Add your comment