Merge commit '42b2e5ca519766e37ce6941ba4faecc9691cc403' into upstream
[debian/openrocket] / core / build.xml
index 7d93b880a735fc2bb20601bbd5a438f09f912b44..9b178defe66a59021edbec0287b652ba09fdaa0a 100644 (file)
                <javac debug="true" srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath"/>
        </target>
        
-       
-       <!-- JAR -->
-       <target name="jar" depends="build" description="Create the OpenRocket jar file">
-               <copy todir="${dist.dir}/">
-                       <fileset dir="." includes="LICENSE.TXT README.TXT ChangeLog ReleaseNotes fileformat.txt" />
-                       <fileset dir="resources/"/>
+       <!-- Executible Eclipse-Jar-In-Jar style JAR -->
+       <target name="jar" depends="core-jar" description="Create the OpenRocket jar-in-jar Executable">
+               <mkdir dir="${jar.dir}" />
+               <jar destfile="${jar.file}">
+                       <manifest>
+                               <attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader" />
+                               <attribute name="Rsrc-Main-Class" value="${main-class}" />
+                               <attribute name="SplashScreen-Image" value="pix/splashscreen.png" />
+                               <attribute name="Class-Path" value="." />
+                               <attribute name="Rsrc-Class-Path" value="./ main/${ant.project.name}-Core.jar lib/jfreechart-1.0.13.jar lib/jcommon-1.0.16.jar lib/gluegen-rt.jar lib/miglayout15-swing.jar lib/iText-5.0.2.jar lib/jogl.all.jar lib/opencsv-2.3.jar lib/OrangeExtensions-1.2.jar" />
+                       </manifest>
+
+                       <!-- Unzip the Eclipse JIJ Loader -->
+                       <zipfileset src="lib/jar-in-jar-loader.jar" />
+                       
+                       <!-- Include, in the root of the JAR, the resources needed by OR -->
                        <fileset dir="src/" includes="META-INF/" />
-               </copy>
-               <mkdir dir="${jar.dir}"/>
-               <jar destfile="${jar.file}" basedir="${dist.dir}">
+                       <fileset dir="resources/" />
+                       
+                       <!-- Include the core OpenRocket JAR -->
+                       <zipfileset dir="${build.dir}/" prefix="main">
+                               <include name="${ant.project.name}-Core.jar"/>
+                       </zipfileset>
+                       
+                       <!-- Include libraries needed by OR -->
+                       <zipfileset dir="${lib.dir}" prefix="lib">
+                               <include name="*.jar"/>
+                       </zipfileset>
+                       <zipfileset dir="${lib.dir}/jogl" prefix="lib">
+                               <include name="*.jar"/>
+                       </zipfileset>
+                       
+                       <!-- Include metafiles about OR -->
+                       <fileset dir="." includes="LICENSE.TXT README.TXT ChangeLog ReleaseNotes fileformat.txt" />
+               </jar>
+       </target>
+       
+       
+       <!-- Core OpenRocket JAR -->
+       <target name="core-jar" depends="build" description="Create the OpenRocket code-only jar file">
+               <jar destfile="${build.dir}/${ant.project.name}-Core.jar" basedir="${dist.dir}">
                        <manifest>
                                <attribute name="Main-Class" value="${main-class}"/>
                                <attribute name="SplashScreen-Image" value="pix/splashscreen.png"/>
                        </manifest>
-                       <zipfileset src="lib/miglayout15-swing.jar" />
-                       <zipfileset src="lib/jcommon-1.0.16.jar" />
-                       <zipfileset src="lib/jfreechart-1.0.13.jar" />
-                       <zipfileset src="lib/iText-5.0.2.jar" />
-                       <zipfileset src="lib/opencsv-2.3.jar" />
                </jar>
        </target>