PackPartitions now builds a 'fat' jar file containing all classes and dependent libraries.

This commit is contained in:
Martin Haye 2016-02-01 08:07:12 -08:00
parent 10db0b073a
commit 8439e6840d
3 changed files with 15 additions and 64 deletions

View File

@ -10,64 +10,15 @@
<project name="PackPartitions" default="default" basedir="."> <project name="PackPartitions" default="default" basedir=".">
<description>Builds, tests, and runs the project PackPartitions.</description> <description>Builds, tests, and runs the project PackPartitions.</description>
<import file="nbproject/build-impl.xml"/> <import file="nbproject/build-impl.xml"/>
<!-- <target name="-post-jar">
<echo message="Packaging ${application.title} into a single JAR at ${dist.jar}"/>
There exist several targets which are by default empty and which can be <move file="${dist.jar}" tofile="dist/${application.title}-thin.jar"/>
used for execution of your tasks. These targets are usually executed <jar jarfile="${dist.jar}">
before and after some main targets. They are: <zipfileset src="dist/${application.title}-thin.jar" />
<zipgroupfileset dir="dist/lib" includes="*.jar" excludes="META-INF/*"/>
-pre-init: called before initialization of project properties <manifest>
-post-init: called after initialization of project properties <attribute name="Main-Class" value="${main.class}"/>
-pre-compile: called before javac compilation </manifest>
-post-compile: called after javac compilation </jar>
-pre-compile-single: called before javac compilation of single file </target>
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="PackPartitions-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project> </project>

View File

@ -1,6 +1,6 @@
build.xml.data.CRC32=69409762 build.xml.data.CRC32=f3c1938b
build.xml.script.CRC32=89726637 build.xml.script.CRC32=c226afaf
build.xml.stylesheet.CRC32=8064a381@1.68.1.46 build.xml.stylesheet.CRC32=8064a381@1.75.2.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=69409762 nbproject/build-impl.xml.data.CRC32=69409762

View File

@ -33,7 +33,7 @@ file.reference.acme.jar=../ACME/src/acme.jar
file.reference.lz4-1.1.1.jar=/Users/mhaye/LL/repo/Platform/Apple/tools/PackPartitions/lib/lz4-1.1.1.jar file.reference.lz4-1.1.1.jar=/Users/mhaye/LL/repo/Platform/Apple/tools/PackPartitions/lib/lz4-1.1.1.jar
file.reference.plasm.jar=../PLASMA/src/plasm.jar file.reference.plasm.jar=../PLASMA/src/plasm.jar
includes=** includes=**
jar.compress=false jar.compress=true
javac.classpath=\ javac.classpath=\
${file.reference.lz4-1.1.1.jar}:\ ${file.reference.lz4-1.1.1.jar}:\
${libs.groovy-all.classpath}:\ ${libs.groovy-all.classpath}:\