- Split the AspectJ testcode out of the general testdata project. - Adjusted tests to handle that JDT produces different code to AspectJ. - Modified some tests to work better with javac compiled testdata (which is what happens when building on the command line or build machine)
130 lines
3.2 KiB
Groovy
130 lines
3.2 KiB
Groovy
apply plugin: 'maven'
|
|
|
|
group = "org.springsource.loaded"
|
|
//version = '1.1.5.RELEASE'
|
|
version = '1.2.0.BUILD-SNAPSHOT'
|
|
jar.baseName = 'springloaded'
|
|
|
|
task writeNewPom << {
|
|
pom {
|
|
project {
|
|
inceptionYear '2013'
|
|
licenses {
|
|
license {
|
|
name 'The Apache Software License, Version 2.0'
|
|
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
|
distribution 'repo'
|
|
}
|
|
}
|
|
}
|
|
}.writeTo("$buildDir/springloaded.pom");
|
|
}
|
|
|
|
compileJava {
|
|
options.debug = true
|
|
}
|
|
|
|
configurations {
|
|
testCompileOnly
|
|
}
|
|
|
|
task wrapper(type: Wrapper) {
|
|
gradleVersion = '1.8'
|
|
}
|
|
|
|
dependencies {
|
|
tools 'com.googlecode.jarjar:jarjar:1.3'
|
|
|
|
/*
|
|
compile 'asm:asm:3.2'
|
|
compile 'asm:asm-tree:3.2'
|
|
*/
|
|
compile 'org.ow2.asm:asm:5.0_BETA'
|
|
compile 'org.ow2.asm:asm-tree:5.0_BETA'
|
|
|
|
testCompile 'junit:junit:4.11'
|
|
|
|
testCompileOnly files("../testdata-groovy/groovy-all-1.8.6.jar")
|
|
testCompileOnly project(':testdata')
|
|
testCompileOnly project(':testdata-aspectj')
|
|
testCompileOnly project(':testdata-groovy')
|
|
testCompileOnly project(':testdata-java8')
|
|
testCompileOnly project(':testdata-plugin')
|
|
testCompileOnly project(':testdata-subloader')
|
|
testCompileOnly project(':testdata-superloader')
|
|
}
|
|
|
|
sourceSets {
|
|
test {
|
|
compileClasspath += configurations.testCompileOnly
|
|
}
|
|
}
|
|
|
|
test {
|
|
jvmArgs "-noverify"
|
|
ignoreFailures true
|
|
systemProperties["springloaded.tests.useGradleBuildDir"] = true
|
|
systemProperties["springloaded.tests.generatedTests"] = System.getProperty("generatedTests", "false")
|
|
}
|
|
|
|
// org.springsource.loaded-VERSION.jar
|
|
jar {
|
|
from 'LICENSES/LICENSE'
|
|
baseName = 'org.springsource.loaded'
|
|
}
|
|
|
|
// org.springsource.loaded-VERSION-sources.jar
|
|
task sourcesJar(type: Jar, dependsOn:classes) {
|
|
baseName = 'org.springsource.loaded'
|
|
classifier = 'sources'
|
|
from sourceSets.main.allSource
|
|
}
|
|
|
|
task agentSourcesJar(type: Jar, dependsOn:classes) {
|
|
baseName = 'springloaded'
|
|
classifier = 'sources'
|
|
from sourceSets.main.allSource
|
|
}
|
|
|
|
//task agentjar(type: Jar, dependsOn: [jar,writeNewPom]) {
|
|
task agentjar(type: Jar, dependsOn: jar) {
|
|
manifest {
|
|
from('src/main/java/META-INF/MANIFEST.MF') {
|
|
eachEntry { details ->
|
|
if (details.key == 'Specification-Version' ||
|
|
details.key == 'Implementation-Version') {
|
|
details.value = version;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
inputs.files jar.archivePath
|
|
baseName = 'springloaded'
|
|
|
|
doLast {
|
|
project.ant {
|
|
taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask", classpath: configurations.tools.asPath
|
|
jarjar(jarfile: archivePath, manifest: "$temporaryDir/MANIFEST.MF") {
|
|
zipfileset(src: jar.archivePath)
|
|
configurations.compile.files.each { jarjarFile ->
|
|
zipfileset(src: jarjarFile)
|
|
}
|
|
rule pattern: "org.objectweb.asm.**", result: "sl.org.objectweb.asm.@1"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// add the jars as artifacts
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives agentjar
|
|
archives agentSourcesJar
|
|
}
|
|
|
|
configurations.archives.artifacts.removeAll(
|
|
configurations.archives.allArtifacts.findAll { it.file.toString().indexOf("org.springsource.loaded")!=-1}
|
|
)
|