Skip to content

Instantly share code, notes, and snippets.

@ElFadiliY
Last active August 29, 2015 14:09
Show Gist options
  • Save ElFadiliY/ef6f34ab9273638dca0f to your computer and use it in GitHub Desktop.
Save ElFadiliY/ef6f34ab9273638dca0f to your computer and use it in GitHub Desktop.
A lovely little Ant task that not only makes one jar out of many (merge), it can also change package names of certain classes in byte-code! Ant Task using jarjar to rebuild jar packages https://code.google.com/p/jarjar
<project name="generate-jarjar">
<property name="jarjarfile" value="elfadili.jar"/>
<path id="classpath">
<pathelement location="jarjar-1.4.jar"/>
<pathelement location="asm-2.2.3.jar"/>
</path>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpathref="classpath"/>
<delete file="${jarjarfile}"/>
<jarjar destfile="${jarjarfile}">
<zipfileset src="xyz.jar"/>
<rule pattern="com.xyz.**" result="com.elfadili.@1"/>
</jarjar>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment