[3931] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
| 2 | <!-- You may freely edit this file. See commented blocks below for -->
|
---|
| 3 | <!-- some examples of how to customize the build. -->
|
---|
| 4 | <!-- (If you delete it and reopen the project it will be recreated.) -->
|
---|
| 5 | <!-- By default, only the Clean and Build commands use this build script. -->
|
---|
| 6 | <!-- Commands such as Run, Debug, and Test only use this build script if -->
|
---|
| 7 | <!-- the Compile on Save feature is turned off for the project. -->
|
---|
| 8 | <!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
---|
| 9 | <!-- in the project's Project Properties dialog box.-->
|
---|
[9765] | 10 | <project name="josmnb" default="default" basedir=".">
|
---|
[3931] | 11 | <description>Builds, tests, and runs the project josm.</description>
|
---|
[4545] | 12 |
|
---|
[9765] | 13 | <import file="nbproject/build-impl.xml" as="nbimpl"/>
|
---|
[4545] | 14 |
|
---|
[9765] | 15 | <import file="../build.xml" as="josmbase"/> <!-- import the main JOSM ant file -->
|
---|
| 16 |
|
---|
[3931] | 17 | <!--
|
---|
| 18 |
|
---|
[9765] | 19 | There exist several targets which are by default empty and which can be
|
---|
| 20 | used for execution of your tasks. These targets are usually executed
|
---|
| 21 | before and after some main targets. They are:
|
---|
[3931] | 22 |
|
---|
| 23 | -pre-init: called before initialization of project properties
|
---|
| 24 | -post-init: called after initialization of project properties
|
---|
| 25 | -pre-compile: called before javac compilation
|
---|
| 26 | -post-compile: called after javac compilation
|
---|
| 27 | -pre-compile-single: called before javac compilation of single file
|
---|
| 28 | -post-compile-single: called after javac compilation of single file
|
---|
| 29 | -pre-compile-test: called before javac compilation of JUnit tests
|
---|
| 30 | -post-compile-test: called after javac compilation of JUnit tests
|
---|
| 31 | -pre-compile-test-single: called before javac compilation of single JUnit test
|
---|
| 32 | -post-compile-test-single: called after javac compilation of single JUunit test
|
---|
| 33 | -pre-jar: called before JAR building
|
---|
| 34 | -post-jar: called after JAR building
|
---|
| 35 | -post-clean: called after cleaning build products
|
---|
| 36 |
|
---|
| 37 | (Targets beginning with '-' are not intended to be called on their own.)
|
---|
| 38 |
|
---|
| 39 | Example of inserting an obfuscator after compilation could look like this:
|
---|
| 40 |
|
---|
| 41 | <target name="-post-compile">
|
---|
| 42 | <obfuscate>
|
---|
| 43 | <fileset dir="${build.classes.dir}"/>
|
---|
| 44 | </obfuscate>
|
---|
| 45 | </target>
|
---|
| 46 |
|
---|
[9765] | 47 | For list of available properties check the imported
|
---|
| 48 | nbproject/build-impl.xml file.
|
---|
[3931] | 49 |
|
---|
| 50 |
|
---|
| 51 | Another way to customize the build is by overriding existing main targets.
|
---|
[9765] | 52 | The targets of interest are:
|
---|
[3931] | 53 |
|
---|
| 54 | -init-macrodef-javac: defines macro for javac compilation
|
---|
| 55 | -init-macrodef-junit: defines macro for junit execution
|
---|
| 56 | -init-macrodef-debug: defines macro for class debugging
|
---|
| 57 | -init-macrodef-java: defines macro for class execution
|
---|
[9765] | 58 | -do-jar: JAR building
|
---|
| 59 | run: execution of project
|
---|
[3931] | 60 | -javadoc-build: Javadoc generation
|
---|
| 61 | test-report: JUnit report generation
|
---|
| 62 |
|
---|
| 63 | An example of overriding the target for project execution could look like this:
|
---|
| 64 |
|
---|
| 65 | <target name="run" depends="josm-impl.jar">
|
---|
| 66 | <exec dir="bin" executable="launcher.exe">
|
---|
| 67 | <arg file="${dist.jar}"/>
|
---|
| 68 | </exec>
|
---|
| 69 | </target>
|
---|
| 70 |
|
---|
[9765] | 71 | Notice that the overridden target depends on the jar target and not only on
|
---|
| 72 | the compile target as the regular run target does. Again, for a list of available
|
---|
[3931] | 73 | properties which you can use, check the target you are overriding in the
|
---|
[9765] | 74 | nbproject/build-impl.xml file.
|
---|
[3931] | 75 |
|
---|
| 76 | -->
|
---|
[4545] | 77 |
|
---|
[9765] | 78 | <!--
|
---|
| 79 | ** Copy resource file required on classpath.
|
---|
| 80 | -->
|
---|
| 81 | <target name="copy-josm-resources">
|
---|
| 82 | <copy file="../CONTRIBUTION" todir="${build.classes.dir}"/>
|
---|
| 83 | <copy file="../README" todir="${build.classes.dir}"/>
|
---|
| 84 | <copy file="../LICENSE" todir="${build.classes.dir}"/>
|
---|
| 85 | <copy file="../gpl-2.0.txt" todir="${build.classes.dir}" />
|
---|
| 86 | <copy file="../gpl-3.0.txt" todir="${build.classes.dir}" />
|
---|
| 87 | <copy todir="${build.classes.dir}/images"><fileset dir="../images"/></copy>
|
---|
| 88 | <copy todir="${build.classes.dir}/data"><fileset dir="../data"/></copy>
|
---|
| 89 | <copy todir="${build.classes.dir}/styles"><fileset dir="../styles"/></copy>
|
---|
| 90 | <copy todir="${build.classes.dir}/org/openstreetmap/gui/jmapviewer/images">
|
---|
| 91 | <fileset dir="../src/org/openstreetmap/gui/jmapviewer/images"/>
|
---|
| 92 | </copy>
|
---|
| 93 | </target>
|
---|
[4545] | 94 |
|
---|
[9765] | 95 | <!--
|
---|
| 96 | ** Customize some properties used by the main JOSM ant file.
|
---|
| 97 | -->
|
---|
| 98 | <target name="set-josmbase-properties" depends="-init-project">
|
---|
| 99 | <property name="revision.dir" value="${build.classes.dir}"/>
|
---|
| 100 | <property name="proj-build.dir" location="${build.dir}/build2"/>
|
---|
| 101 | <property name="proj-classpath" location="${build.classes.dir}"/>
|
---|
[6702] | 102 | </target>
|
---|
[9765] | 103 |
|
---|
| 104 | <!--
|
---|
| 105 | ** Make sure properties are loaded in the right order.
|
---|
| 106 | ** E.g. ${build.dir} is set both by Netbeans and by the main JOSM ant file.
|
---|
| 107 | ** Load the Netbeans properties first, which makes the values permanent.
|
---|
| 108 | -->
|
---|
| 109 | <target name="init-josmbase" depends="-init-project, set-josmbase-properties, josmbase.init-properties"/>
|
---|
| 110 |
|
---|
| 111 | <target name="-pre-compile" depends="init-josmbase, josmbase.javacc"/>
|
---|
| 112 |
|
---|
| 113 | <target name="-post-compile" depends="init-josmbase, josmbase.epsg, josmbase.create-revision, copy-josm-resources"/>
|
---|
| 114 |
|
---|
[3931] | 115 | </project>
|
---|