mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-09-08 20:51:41 +00:00
Also deprecated the existing AspectJ interceptors. This will also allow future simplification of the AbstractMethodSecurityMetadataSource, as it no longer needs to support JoinPoints.
47 lines
1.5 KiB
Groovy
47 lines
1.5 KiB
Groovy
apply id: 'java'
|
|
|
|
configurations {
|
|
ajtools
|
|
aspectpath
|
|
}
|
|
|
|
dependencies {
|
|
ajtools "org.aspectj:aspectjtools:$aspectjVersion"
|
|
compile "org.aspectj:aspectjrt:$aspectjVersion"
|
|
}
|
|
|
|
task compileJava(overwrite: true, description: 'Compiles AspectJ Source', type: Ajc) {
|
|
dependsOn processResources
|
|
sourceSet = sourceSets.main
|
|
aspectPath = configurations.aspectpath
|
|
}
|
|
|
|
task compileTestJava(overwrite: true, description: 'Compiles AspectJ Test Source', type: Ajc) {
|
|
dependsOn processTestResources, compileJava, jar
|
|
sourceSet = sourceSets.test
|
|
aspectPath = files(configurations.aspectpath, jar.archivePath)
|
|
}
|
|
|
|
class Ajc extends DefaultTask {
|
|
@Input
|
|
SourceSet sourceSet
|
|
|
|
@Input
|
|
FileCollection aspectPath
|
|
|
|
@TaskAction
|
|
def compile() {
|
|
println "Running ajc ..."
|
|
ant.taskdef(resource: "org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties", classpath: project.configurations.ajtools.asPath)
|
|
ant.iajc(classpath: sourceSet.compileClasspath.asPath, fork: 'true', destDir: sourceSet.classesDir.absolutePath,
|
|
source: project.convention.plugins.java.sourceCompatibility,
|
|
target: project.convention.plugins.java.targetCompatibility,
|
|
aspectPath: aspectPath.asPath, sourceRootCopyFilter: '**/*.java', showWeaveInfo: 'true') {
|
|
sourceroots {
|
|
sourceSet.java.srcDirs.each {
|
|
pathelement(location: it.absolutePath)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |