Files
spring-loaded/springloaded/build.gradle
2014-01-16 22:00:07 -06:00

123 lines
3.0 KiB
Groovy

apply plugin: 'maven'
group = "org.springsource.loaded"
version = '1.1.5.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'
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,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}
)