Files
spring-loaded/springloaded-core/build.gradle
2014-01-15 11:36:24 -08:00

105 lines
2.6 KiB
Groovy

group = "org.springsource.loaded"
groupId = "org.springsource.loaded"
artifactId = "springloaded-core"
version = '1.1.5.BUILD-SNAPSHOT'
jar.baseName = 'springloaded'
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'
testCompile 'junit:junit:4.11'
testCompileOnly files("../testdata-groovy/groovy-1.8.2.jar")
testCompileOnly project(':testdata')
testCompileOnly project(':testdata-groovy')
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) {
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
}