From 5cb4df2d30c408290968c5d37d9f8ebf629cd177 Mon Sep 17 00:00:00 2001 From: Ben Willard Date: Wed, 10 Oct 2007 01:09:44 -0400 Subject: [PATCH] Created a custom build.xml file, took out the Netbeans projects file, and made a version number file. Now the build file is custom to this project. - 'ant compile' will compile all the src/ files into classes/ - 'ant dist' or just 'ant' will make an executable jar file in dist/ with a version number tacked onto it - 'ant clean' cleans out classes/ (but not dist/) Version number will now be available from ShootTheMoon if the project is built using 'ant dist' otherwise the version number will appear to be 'development' You can still use Netbeans fairly easily by making a project using existing sources and an existing build.xml, the default ant calls should work. You will need to add src/ as a source directory when it asks you to. --- build.xml | 102 +++---- manifest.mf | 9 +- nbproject/build-impl.xml | 532 ----------------------------------- nbproject/genfiles.properties | 8 - nbproject/private/private.properties | 6 - nbproject/project.properties | 56 ---- nbproject/project.xml | 14 - src/shoot_the_moon/ShootTheMoon.java | 3 +- version.xml | 1 + 9 files changed, 42 insertions(+), 689 deletions(-) rewrite build.xml (99%) delete mode 100644 nbproject/build-impl.xml delete mode 100644 nbproject/genfiles.properties delete mode 100644 nbproject/private/private.properties delete mode 100644 nbproject/project.properties delete mode 100644 nbproject/project.xml create mode 100644 version.xml diff --git a/build.xml b/build.xml dissimilarity index 99% index 39aef4a..0ba5be6 100644 --- a/build.xml +++ b/build.xml @@ -1,69 +1,33 @@ - - - - - - Builds, tests, and runs the project shoot. - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/manifest.mf b/manifest.mf index 8fcadf6..966afe3 100644 --- a/manifest.mf +++ b/manifest.mf @@ -1,3 +1,6 @@ -Manifest-Version: 0.01 -X-COMMENT: Main-Class will be added automatically by build - +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.6.5 +Created-By: 1.6.0-b105 (Sun Microsystems Inc.) +Main-Class: shoot_the_moon/ShootTheMoon +Implementation-Version: 0.0.01 + diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml deleted file mode 100644 index 8ab9962..0000000 --- a/nbproject/build-impl.xml +++ /dev/null @@ -1,532 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set src.dir - Must set build.dir - Must set dist.dir - Must set build.classes.dir - Must set dist.javadoc.dir - Must set build.test.classes.dir - Must set build.test.results.dir - Must set build.classes.excludes - Must set dist.jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - - - - - - java -cp "${run.classpath.with.dist.jar}" ${main.class} - - - - - - - - - - - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - java -jar "${dist.jar.resolved}" - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set debug.class - - - - - Must set fix.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - - Some tests failed; see details above. - - - - - - - - - Must select some files in the IDE or set test.includes - - - - Some tests failed; see details above. - - - - - Must select one file in the IDE or set test.class - - - - - - - - - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties deleted file mode 100644 index d3b89a3..0000000 --- a/nbproject/genfiles.properties +++ /dev/null @@ -1,8 +0,0 @@ -build.xml.data.CRC32=737fa121 -build.xml.script.CRC32=56fa2a7d -build.xml.stylesheet.CRC32=240b97a2 -# 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. -nbproject/build-impl.xml.data.CRC32=737fa121 -nbproject/build-impl.xml.script.CRC32=67654fc7 -nbproject/build-impl.xml.stylesheet.CRC32=65d7ca21 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties deleted file mode 100644 index 9ba172d..0000000 --- a/nbproject/private/private.properties +++ /dev/null @@ -1,6 +0,0 @@ -application.args= -file.reference.shoot-src=/home/ben/shoot/src -javac.debug=true -javadoc.preview=true -jaxws.endorsed.dir=/home/ben/programs/netbeans-5.5.1/ide7/modules/ext/jaxws21/api -user.properties.file=/home/ben/.netbeans/5.5.1/build.properties diff --git a/nbproject/project.properties b/nbproject/project.properties deleted file mode 100644 index 467ab3b..0000000 --- a/nbproject/project.properties +++ /dev/null @@ -1,56 +0,0 @@ -application.args= -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -debug.classpath=\ - ${run.classpath} -debug.test.classpath=\ - ${run.test.classpath} -# This directory is removed when the project is cleaned: -dist.dir=dist -dist.jar=${dist.dir}/shoot.jar -dist.javadoc.dir=${dist.dir}/javadoc -file.reference.shoot-src=src -jar.compress=false -javac.classpath= -# Space-separated list of extra javac options -javac.compilerargs= -javac.deprecation=false -javac.source=1.6 -javac.target=1.6 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir}:\ - ${libs.junit.classpath} -javadoc.additionalparam= -javadoc.author=false -javadoc.encoding= -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -main.class=shoot_the_moon.ShootTheMoon -manifest.file=manifest.mf -meta.inf.dir=${src.dir}/META-INF -platform.active=default_platform -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project -# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value -# or test-sys-prop.name=value to set system properties for unit tests): -run.jvmargs= -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -src.dir=${file.reference.shoot-src} diff --git a/nbproject/project.xml b/nbproject/project.xml deleted file mode 100644 index cbb0935..0000000 --- a/nbproject/project.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - org.netbeans.modules.java.j2seproject - - - shoot - 1.6.5 - - - - - - - diff --git a/src/shoot_the_moon/ShootTheMoon.java b/src/shoot_the_moon/ShootTheMoon.java index 709a504..212a08e 100644 --- a/src/shoot_the_moon/ShootTheMoon.java +++ b/src/shoot_the_moon/ShootTheMoon.java @@ -4,7 +4,8 @@ import shoot_the_moon.TextObserver; public class ShootTheMoon { - public static String VERSION = "0.1"; + private static String _implVersion = ShootTheMoon.class.getPackage().getImplementationVersion(); + public static String VERSION = ( _implVersion == null ? "development" : _implVersion ); /** * @param args diff --git a/version.xml b/version.xml new file mode 100644 index 0000000..5dddcde --- /dev/null +++ b/version.xml @@ -0,0 +1 @@ +version=0.0.01 -- 2.11.4.GIT