spring-security/gradle/aspectj.gradle
2010-03-11 02:15:02 +00:00

25 lines
908 B
Groovy

apply id: 'java'
configurations {
ajtools
aspectpath
}
dependencies {
ajtools "org.aspectj:aspectjtools:$aspectjVersion"
compile "org.aspectj:aspectjrt:$aspectjVersion"
}
task compileJava(dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME, overwrite: true, description: 'Compiles AspectJ Source') << {
println "Running ajc ..."
ant.taskdef(resource: "org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties", classpath: configurations.ajtools.asPath)
ant.iajc(classpath: configurations.compile.asPath, fork: 'true', destDir: sourceSets.main.classesDir.absolutePath, source: sourceCompatibility, target: targetCompatibility,
aspectPath: configurations.aspectpath.asPath, sourceRootCopyFilter: '**/*.java') {
sourceroots {
sourceSets.main.java.srcDirs.each {
pathelement(location: it.absolutePath)
}
}
}
}