JarJar and source jar

This commit is contained in:
Ramon Nogueira
2013-02-16 06:18:54 +02:00
parent 8b238f6c5c
commit 7a2dfe8b72

View File

@@ -5,8 +5,26 @@ group = "org.springsource.loaded"
version = '1.1.1-dev'
jar.baseName = 'spring-loaded'
configurations {
provided
}
compileJava {
options.debug = true
}
sourceSets {
main { compileClasspath += configurations.provided }
}
/*idea {
module {
scopes.PROVIDED.plus += configurations.provided
}
}*/
dependencies {
compile 'asm:asm-all:3.2'
provided 'asm:asm-all:3.2'
tools 'com.googlecode.jarjar:jarjar:1.3'
testCompile 'junit:junit:4.11'
testCompile project(':org.springsource.loaded.testdata')
@@ -16,10 +34,33 @@ test {
jvmArgs "-noverify"
}
task dist(dependsOn: 'build') {
ant.taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask", classpath: configurations.tools.asPath
ant.jarjar(destfile: "target/springloaded-${project.version}.jar", manifest: "META-INF/MANIFEST.MF") {
task jarAll(type: Jar, dependsOn: jar) {
def metaInfDir = "$projectDir/META-INF"
inputs.files jar.archivePath
inputs.dir metaInfDir
classifier = 'all'
doLast {
project.ant {
taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask", classpath: configurations.tools.asPath
jarjar(jarfile: archivePath, manifest: "$metaInfDir/MANIFEST.MF") {
zipfileset(dir: "$metaInfDir", prefix: 'META-INF')
zipfileset(src: jar.archivePath)
configurations.runtime.files.each { jarjarFile ->
zipfileset(src: jarjarFile)
}
rule pattern: "org.objectweb.asm.**", result: "sl.org.objectweb.asm.@1"
}
}
}
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
// add the jars as artifacts
artifacts {
archives sourcesJar
archives jarAll
}