JarJar and source jar
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user