Generate fat jars for smali and baksmali

This commit is contained in:
Ben Gruver 2012-09-15 19:16:16 -07:00
parent 7d1263a4ff
commit 5cf9fe7c0a
3 changed files with 39 additions and 4 deletions

View File

@ -7,3 +7,16 @@ dependencies {
processResources.inputs.properties('version': { -> version})
processResources.expand('version': { -> version})
// We have to do this in taskGraph.whenReady, so that we use the correct
// version to resolve the project dependencies
gradle.taskGraph.whenReady {
// build a jar containing all dependencies
jar {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
manifest {
attributes("Main-Class": "org.jf.baksmali.main")
}
}
}

View File

@ -1,7 +1,8 @@
subprojects {
apply plugin: 'java'
version = "1.3.4"
ext.baseVersion = '1.3.4'
ext.jarVersion = baseVersion
// For non-release builds, we want to append the commit and
// dirty status to the version
@ -22,7 +23,15 @@ subprojects {
versionSuffix = 'dev'
}
version += '-' + versionSuffix
version = baseVersion + '-' + versionSuffix
// use <version>-dev for the jar name, rather than the
// full commit+dirty string
jarVersion = baseVersion + '-dev'
}
jar {
version = jarVersion
}
}

View File

@ -80,3 +80,16 @@ compileTestJava.dependsOn generateTestAntlrSource
processResources.inputs.properties('version': { -> version})
processResources.expand('version': { -> version})
// We have to do this in taskGraph.whenReady, so that we use the correct
// version to resolve the project dependencies
gradle.taskGraph.whenReady {
// build a jar containing all dependencies
jar {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
manifest {
attributes("Main-Class": "org.jf.smali.main")
}
}
}