java - Splitting Netbeans Jar File -
i'm working on project game engine, used make other games. working in netbeans. project has 2 parts, engine itself, , game core being ran. modify build.xml when project builds, takes 1 group of packages, , compiles them jar, (the game core), , rest gets compiled second jar, , places first jar inside of asset folder in second jar. possible, or have keep building manually?
i know nothing ant builds, despite research.
i found solution, using code.
<project name="wraithengine2" basedir="." default="main"> <target name="clean"> <delete dir="/home/thedudefromci/netbeansprojects/wraithengine2/build"/> <delete dir="/home/thedudefromci/netbeansprojects/wraithengine2/dist"/> </target> <target name="jar"> <mkdir dir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes1"/> <mkdir dir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes2"/> <mkdir dir="/home/thedudefromci/netbeansprojects/wraithengine2/dist"/> <mkdir dir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes1/assets"/> <mkdir dir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes1/native"/> <javac srcdir="/home/thedudefromci/netbeansprojects/wraithengine2/src" destdir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes1"> <include name="build/**"/> </javac> <javac srcdir="/home/thedudefromci/netbeansprojects/wraithengine2/src" destdir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes2"> <include name="run/**"/> </javac> <copy todir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes1/assets"> <fileset dir="/home/thedudefromci/netbeansprojects/wraithengine2/src/assets"/> </copy> <copy todir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes1/native"> <fileset dir="/home/thedudefromci/netbeansprojects/wraithengine2/src/native"/> </copy> <jar destfile="/home/thedudefromci/netbeansprojects/wraithengine2/dist/wraithgame.jar" basedir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes2"> <manifest> <attribute name="main-class" value="run.wraith.engine.wraithenginegame"/> </manifest> </jar> <copy file="/home/thedudefromci/netbeansprojects/wraithengine2/dist/wraithgame.jar" todir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes1/native"/> <jar destfile="/home/thedudefromci/netbeansprojects/wraithengine2/dist/wraithengine.jar" basedir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes1"> <manifest> <attribute name="main-class" value="build.games.wraithaven.core.wraithengine"/> </manifest> </jar> </target> <target name="run" depends="jar"> <java jar="/home/thedudefromci/netbeansprojects/wraithengine2/dist/wraithengine.jar" fork="true"/> </target> <target name="clean-build" depends="clean,jar"/> <target name="main" depends="clean,run"/>
Comments
Post a Comment