You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
109 lines
3.9 KiB
109 lines
3.9 KiB
7 years ago
|
description = "Spring Aspects"
|
||
|
|
||
13 years ago
|
// redefine the compileJava and compileTestJava tasks in order to
|
||
|
// compile sources with ajc instead of javac
|
||
|
|
||
|
configurations {
|
||
12 years ago
|
rt
|
||
12 years ago
|
ajc
|
||
|
aspects
|
||
|
ajInpath
|
||
13 years ago
|
}
|
||
|
|
||
12 years ago
|
// exclude spring-aspects as a module within IDEA until IDEA-64446 is resolved
|
||
|
tasks.getByName("idea").onlyIf { false }
|
||
|
tasks.getByName("ideaModule").onlyIf { false }
|
||
|
|
||
12 years ago
|
compileJava {
|
||
|
actions = []
|
||
12 years ago
|
dependsOn configurations.ajc.getTaskDependencyFromProjectDependency(true, "compileJava")
|
||
13 years ago
|
|
||
12 years ago
|
def outputDir = project.sourceSets.main.output.classesDir
|
||
13 years ago
|
|
||
12 years ago
|
inputs.files(project.sourceSets.main.allSource + project.sourceSets.main.compileClasspath)
|
||
|
outputs.dir outputDir
|
||
13 years ago
|
|
||
12 years ago
|
ext.sourceCompatibility = project(":spring-core").compileJava.sourceCompatibility
|
||
|
ext.targetCompatibility = project(":spring-core").compileJava.targetCompatibility
|
||
|
|
||
12 years ago
|
doLast{
|
||
10 years ago
|
// Assemble runtime classpath from folders and JARs that actually exist
|
||
|
def runtimeClasspath = project.files(sourceSets.main.runtimeClasspath.files.findAll({ it.exists() }))
|
||
|
|
||
12 years ago
|
ant.taskdef(resource: "org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties",
|
||
|
classpath: configurations.ajc.asPath)
|
||
13 years ago
|
|
||
12 years ago
|
ant.iajc(source: sourceCompatibility, target: targetCompatibility,
|
||
|
maxmem: "1024m", fork: "true", Xlint: "ignore",
|
||
|
destDir: outputDir.absolutePath,
|
||
|
aspectPath: configurations.aspects.asPath,
|
||
|
inpath: configurations.ajInpath.asPath,
|
||
12 years ago
|
sourceRootCopyFilter: "**/*.java,**/*.aj",
|
||
10 years ago
|
classpath: (runtimeClasspath + configurations.rt).asPath) {
|
||
12 years ago
|
sourceroots {
|
||
|
sourceSets.main.java.srcDirs.each {
|
||
|
pathelement(location:it.absolutePath)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
13 years ago
|
}
|
||
|
|
||
12 years ago
|
compileTestJava {
|
||
|
actions = []
|
||
12 years ago
|
dependsOn configurations.ajc.getTaskDependencyFromProjectDependency(true, "compileTestJava")
|
||
|
dependsOn jar
|
||
13 years ago
|
|
||
12 years ago
|
def outputDir = project.sourceSets.test.output.classesDir
|
||
13 years ago
|
|
||
12 years ago
|
inputs.files(project.sourceSets.test.allSource + project.sourceSets.test.compileClasspath)
|
||
|
outputs.dir outputDir
|
||
13 years ago
|
|
||
12 years ago
|
ext.sourceCompatibility = project(":spring-core").compileTestJava.sourceCompatibility
|
||
|
ext.targetCompatibility = project(":spring-core").compileTestJava.targetCompatibility
|
||
|
|
||
12 years ago
|
doLast{
|
||
10 years ago
|
// Assemble runtime classpath from folders and JARs that actually exist
|
||
|
def runtimeClasspath = project.files(sourceSets.test.runtimeClasspath.files.findAll({ it.exists() }))
|
||
|
|
||
12 years ago
|
ant.taskdef(resource: "org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties",
|
||
|
classpath: configurations.ajc.asPath)
|
||
13 years ago
|
|
||
11 years ago
|
ant.iajc(source: sourceCompatibility, target: targetCompatibility,
|
||
12 years ago
|
maxmem: "1024m", fork: "true", Xlint: "ignore",
|
||
|
destDir: outputDir.absolutePath,
|
||
|
aspectPath: jar.archivePath,
|
||
|
inpath: configurations.ajInpath.asPath,
|
||
10 years ago
|
classpath: (runtimeClasspath + project.files(jar.archivePath) + configurations.rt).asPath) {
|
||
12 years ago
|
sourceroots {
|
||
|
sourceSets.test.java.srcDirs.each {
|
||
|
pathelement(location:it.absolutePath)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
13 years ago
|
}
|
||
7 years ago
|
|
||
|
|
||
|
dependencies {
|
||
|
aspects(project(":spring-orm"))
|
||
|
ajc("org.aspectj:aspectjtools:${aspectjVersion}")
|
||
|
rt("org.aspectj:aspectjrt:${aspectjVersion}")
|
||
|
compile("org.aspectj:aspectjweaver:${aspectjVersion}")
|
||
|
optional(project(":spring-aop")) // for @Async support
|
||
|
optional(project(":spring-beans")) // for @Configurable support
|
||
|
optional(project(":spring-context")) // for @Enable* support
|
||
|
optional(project(":spring-context-support")) // for JavaMail and JSR-107 support
|
||
|
optional(project(":spring-orm")) // for JPA exception translation support
|
||
|
optional(project(":spring-tx")) // for JPA, @Transactional support
|
||
|
optional("javax.cache:cache-api:1.0.0") // for JCache aspect
|
||
|
optional("javax.transaction:javax.transaction-api:1.2") // for @javax.transaction.Transactional support
|
||
|
testCompile(project(":spring-core")) // for CodeStyleAspect
|
||
|
testCompile(project(":spring-test"))
|
||
|
testCompile("javax.mail:javax.mail-api:${javamailVersion}")
|
||
|
}
|
||
|
|
||
|
eclipse.project {
|
||
|
natures += "org.eclipse.ajdt.ui.ajnature"
|
||
|
buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
|
||
|
}
|