Because I can't realize nowhere how to integrate with aspectj here comes my
configuration:

the aspect sources are in src/main/aspectj and str/test/aspectj directories.

task compileAspectj(dependsOn: compileJava) << {
   def classesDir = compileJava.destinationDir
   doAspectjCompile(files(classesDir) + configurations.compile,
file('src/main/aspectj'), classesDir, classesDir) 
}
classes.dependsOn compileAspectj

task compileTestAspectj(dependsOn: compileTestJava) << {
   def classesDir = compileTestJava.destinationDir
   doAspectjCompile(files(compileJava.destinationDir, classesDir) +
configurations.testCompile, file('src/test/aspectj'), classesDir,
classesDir) 
}
testClasses.dependsOn compileTestAspectj

def doAspectjCompile(aspectjClasspath, aspectjSrc, aspectjInput,
aspectjOutput) {
   ant {
      taskdef(resource:
'org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties', classpath:
configurations.aspectj.asPath)
      iajc(sourceroots: aspectjSrc, inpath: aspectjInput, destdir:
aspectjOutput, encoding: 'UTF-8', debug: 'on', source: '1.6', showWeaveInfo:
'true', classpath: aspectjClasspath.asPath)
   }
}

Jirka

-- 
View this message in context: 
http://old.nabble.com/Aspectj-integration-tp27369273p27369273.html
Sent from the gradle-user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to