Build a separate -agent jar which contains the embedded asm dependency

This commit is contained in:
Ramon Nogueira
2013-02-20 09:28:15 +02:00
parent 7a2dfe8b72
commit f9a3d9d542
4 changed files with 21 additions and 27 deletions

2
.gitignore vendored
View File

@@ -7,5 +7,7 @@ springloaded-*.jar
.DS_Store
/.idea
*.iml
*.ipr
*.iws
/.gradle
build/

View File

@@ -1,13 +1,16 @@
apply plugin: 'idea'
allprojects {
apply plugin: 'idea'
configurations {
tools
}
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'java'
configurations {
tools
}
repositories {
mavenCentral()
}
apply plugin: 'java'
}

View File

@@ -9,6 +9,7 @@ dependencies {
tools "org.aspectj:aspectjtools:$aspectjVersion"
compile "cglib:cglib:2.2.2"
compile "org.aspectj:aspectjrt:$aspectjVersion"
compile 'asm:asm-all:3.2'
}
sourceSets {
@@ -16,6 +17,8 @@ sourceSets {
java {
srcDir 'src'
srcDir 'cglibsrc'
srcDir 'subsrc'
srcDir 'supersrc'
}
}
}

View File

@@ -5,26 +5,12 @@ 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 {
provided 'asm:asm-all:3.2'
compile 'asm:asm-all:3.2'
tools 'com.googlecode.jarjar:jarjar:1.3'
testCompile 'junit:junit:4.11'
testCompile project(':org.springsource.loaded.testdata')
@@ -38,14 +24,14 @@ task jarAll(type: Jar, dependsOn: jar) {
def metaInfDir = "$projectDir/META-INF"
inputs.files jar.archivePath
inputs.dir metaInfDir
classifier = 'all'
classifier = 'agent'
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 ->
configurations.compile.files.each { jarjarFile ->
zipfileset(src: jarjarFile)
}
rule pattern: "org.objectweb.asm.**", result: "sl.org.objectweb.asm.@1"