From 5a76df97229c75b0ef3538d82fd84575b2447f5b Mon Sep 17 00:00:00 2001 From: Cuchaz Date: Sun, 24 May 2015 11:41:35 -0400 Subject: fix ssjb building of test jars proguard ssjb build jar (without obfuscation) for great justice --- build.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index 40da3271..c4e86b2b 100644 --- a/build.py +++ b/build.py @@ -44,6 +44,8 @@ TestDeps = [ def buildTestJar(name, glob): + ssjb.file.mkdir(os.path.join(DirBuild, "test-inputs")) + ssjb.file.mkdir(os.path.join(DirBuild, "test-obf")) pathJar = os.path.join(DirBuild, "test-inputs/%s.jar" % name) pathObfJar = os.path.join(DirBuild, "test-obf/%s.jar" % name) @@ -85,9 +87,19 @@ def buildStandaloneJar(dirOut): Author, "cuchaz.enigma.Main" ) - pathJar = os.path.join(DirBuild, "%s.jar" % ArtifactStandalone.getName()) - ssjb.jar.makeJar(pathJar, dirTemp, manifest=manifest) - ssjb.ivy.deployJarToLocalMavenRepo(PathLocalMavenRepo, pathJar, ArtifactStandalone) + pathFatJar = os.path.join(DirBuild, "%s-fat.jar" % ArtifactStandalone.getName()) + ssjb.jar.makeJar(pathFatJar, dirTemp, manifest=manifest) + + # proguard the jar (without obfuscating) to remove some bloat + # the guava library is particularly bad... + pathDietJar = os.path.join(DirBuild, "%s.jar" % ArtifactStandalone.getName()) + ssjb.callJavaJar( + os.path.join(DirLib, "proguard.jar"), + ["@proguard-build.conf", "-injars", pathFatJar, "-outjars", pathDietJar] + ) + + ssjb.ivy.deployJarToLocalMavenRepo(PathLocalMavenRepo, pathDietJar, ArtifactStandalone) + def buildLibJar(dirOut): with ssjb.file.TempDir(os.path.join(dirOut, "tmp")) as dirTemp: -- cgit v1.2.3