source: josm/trunk/netbeans/nbbuild.xml@ 13675

Last change on this file since 13675 was 9765, checked in by bastiK, 9 years ago

new setup of the netbeans project

  • removed classpath hack with two source directories (. and ./src) instead copy the resources to build dir in nbbuild.xml
  • import main JOSM ant file into nbbuild.xml instead of copy&paste
  • Property svn:eol-style set to native
File size: 5.3 KB
Line 
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.-->
10<project name="josmnb" default="default" basedir=".">
11 <description>Builds, tests, and runs the project josm.</description>
12
13 <import file="nbproject/build-impl.xml" as="nbimpl"/>
14
15 <import file="../build.xml" as="josmbase"/> <!-- import the main JOSM ant file -->
16
17 <!--
18
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:
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
47 For list of available properties check the imported
48 nbproject/build-impl.xml file.
49
50
51 Another way to customize the build is by overriding existing main targets.
52 The targets of interest are:
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
58 -do-jar: JAR building
59 run: execution of project
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
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
73 properties which you can use, check the target you are overriding in the
74 nbproject/build-impl.xml file.
75
76 -->
77
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>
94
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}"/>
102 </target>
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
115</project>
Note: See TracBrowser for help on using the repository browser.