Commit bb3b8e46839b0853252bed74abc2223436db4d6d
- Diff rendering mode:
- inline
- side by side
buildSrc/src/main/groovy/aspectj/AspectJPlugin.groovy
(23 / 0)
|   | |||
| 9 | 9 | import org.gradle.api.DefaultTask | |
| 10 | 10 | import org.gradle.api.GradleException | |
| 11 | 11 | ||
| 12 | import org.gradle.plugins.eclipse.EclipseClasspath | ||
| 13 | import org.gradle.plugins.eclipse.EclipseProject | ||
| 14 | import org.gradle.plugins.eclipse.model.ProjectDependency | ||
| 15 | |||
| 12 | 16 | /** | |
| 13 | 17 | * | |
| 14 | 18 | * @author Luke Taylor | |
| … | … | ||
| 50 | 50 | inputs.files(sourceSet.java.srcDirs) | |
| 51 | 51 | outputs.dir(sourceSet.classesDir) | |
| 52 | 52 | 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 | } | ||
| 53 | 72 | } | |
| 54 | 73 | } | |
| 55 | 74 | } |
Comments
Add your comment
Please log in to comment



Add a new comment:
Login or create an account to post a comment