浏览代码

SEC-2207: AspectJPlugin uses compileAspect and compileTestAspect

Rob Winch 12 年之前
父节点
当前提交
3c9a80433f
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      buildSrc/src/main/groovy/aspectj/AspectJPlugin.groovy

+ 6 - 5
buildSrc/src/main/groovy/aspectj/AspectJPlugin.groovy

@@ -41,9 +41,7 @@ class AspectJPlugin implements Plugin<Project> {
             project.configurations.add('aspectpath')
         }
 
-        project.tasks.compileJava.deleteAllActions()
-
-        project.tasks.add(name: 'compileJava', overwrite: true, description: 'Compiles AspectJ Source', type: Ajc) {
+        project.tasks.add(name: 'compileAspect', overwrite: true, description: 'Compiles AspectJ Source', type: Ajc) {
             dependsOn project.configurations*.getTaskDependencyFromProjectDependency(true, "compileJava")
 
             dependsOn project.processResources
@@ -52,16 +50,19 @@ class AspectJPlugin implements Plugin<Project> {
             outputs.dir(sourceSet.output.classesDir)
             aspectPath = project.configurations.aspectpath
         }
+        project.tasks.compileJava.deleteAllActions()
+        project.tasks.compileJava.dependsOn project.tasks.compileAspect
 
-        project.tasks.compileTestJava.deleteAllActions()
 
-        project.tasks.add(name: 'compileTestJava', overwrite: true, description: 'Compiles AspectJ Test Source', type: Ajc) {
+        project.tasks.add(name: 'compileTestAspect', overwrite: true, description: 'Compiles AspectJ Test Source', type: Ajc) {
             dependsOn project.processTestResources, project.compileJava, project.jar
             sourceSet = project.sourceSets.test
             inputs.files(sourceSet.allSource)
             outputs.dir(sourceSet.output.classesDir)
             aspectPath = project.files(project.configurations.aspectpath, project.jar.archivePath)
         }
+        project.tasks.compileTestJava.deleteAllActions()
+        project.tasks.compileTestJava.dependsOn project.tasks.compileTestAspect
 
         project.tasks.withType(GenerateEclipseProject) {
             project.eclipse.project.file.whenMerged { p ->