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

Last change on this file since 8462 was 7937, checked in by bastiK, 10 years ago

add subversion property svn:eol=native

  • Property svn:eol-style set to native
File size: 6.6 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="josm" default="default" basedir=".">
11 <description>Builds, tests, and runs the project josm.</description>
12
13 <property name="javacc.home" location="../tools"/>
14 <property name="mapcss.dir" location="../src/org/openstreetmap/josm/gui/mappaint/mapcss"/>
15 <property name="imagerytypes.dir" location="${src.dir}/org/openstreetmap/josm/data/imagery/types"/>
16 <!-- For Windows-specific stuff -->
17 <condition property="isWindows">
18 <os family="Windows"/>
19 </condition>
20
21 <import file="nbproject/build-impl.xml"/>
22 <!--
23
24 There exist several targets which are by default empty and which can be
25 used for execution of your tasks. These targets are usually executed
26 before and after some main targets. They are:
27
28 -pre-init: called before initialization of project properties
29 -post-init: called after initialization of project properties
30 -pre-compile: called before javac compilation
31 -post-compile: called after javac compilation
32 -pre-compile-single: called before javac compilation of single file
33 -post-compile-single: called after javac compilation of single file
34 -pre-compile-test: called before javac compilation of JUnit tests
35 -post-compile-test: called after javac compilation of JUnit tests
36 -pre-compile-test-single: called before javac compilation of single JUnit test
37 -post-compile-test-single: called after javac compilation of single JUunit test
38 -pre-jar: called before JAR building
39 -post-jar: called after JAR building
40 -post-clean: called after cleaning build products
41
42 (Targets beginning with '-' are not intended to be called on their own.)
43
44 Example of inserting an obfuscator after compilation could look like this:
45
46 <target name="-post-compile">
47 <obfuscate>
48 <fileset dir="${build.classes.dir}"/>
49 </obfuscate>
50 </target>
51
52 For list of available properties check the imported
53 nbproject/build-impl.xml file.
54
55
56 Another way to customize the build is by overriding existing main targets.
57 The targets of interest are:
58
59 -init-macrodef-javac: defines macro for javac compilation
60 -init-macrodef-junit: defines macro for junit execution
61 -init-macrodef-debug: defines macro for class debugging
62 -init-macrodef-java: defines macro for class execution
63 -do-jar-with-manifest: JAR building (if you are using a manifest)
64 -do-jar-without-manifest: JAR building (if you are not using a manifest)
65 run: execution of project
66 -javadoc-build: Javadoc generation
67 test-report: JUnit report generation
68
69 An example of overriding the target for project execution could look like this:
70
71 <target name="run" depends="josm-impl.jar">
72 <exec dir="bin" executable="launcher.exe">
73 <arg file="${dist.jar}"/>
74 </exec>
75 </target>
76
77 Notice that the overridden target depends on the jar target and not only on
78 the compile target as the regular run target does. Again, for a list of available
79 properties which you can use, check the target you are overriding in the
80 nbproject/build-impl.xml file.
81
82 -->
83
84 <target name="-post-compile">
85 <!-- create the REVISION file to be included in the distribution -->
86 <exec append="false" output="REVISION.XML" executable="svn" dir=".." failifexecutionfails="false">
87 <env key="LANG" value="C"/>
88 <arg value="info"/>
89 <arg value="--xml"/>
90 <arg value="."/>
91 </exec>
92 <xmlproperty file="REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
93 <delete file="REVISION.XML" />
94 <tstamp>
95 <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss"/>
96 </tstamp>
97
98 <property name="version.entry.commit.revision" value="UNKNOWN"/>
99 <echo file="${build.classes.dir}/REVISION">
100# automatically generated by JOSM build.xml - do not edit
101Revision: ${version.entry.commit.revision}
102Is-Local-Build: true
103Build-Date: ${build.tstamp}
104</echo>
105 </target>
106
107 <target name="check-javacc">
108 <uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" >
109 <srcfiles dir="${mapcss.dir}" includes="MapCSSParser.jj"/>
110 </uptodate>
111 <uptodate property="jaxb.notRequired" targetfile="${src.dir}/org/openstreetmap/josm/data/imagery/types/package-info.java" >
112 <srcfiles dir="../data_nodist" includes="wms-cache.xsd"/>
113 </uptodate>
114 </target>
115 <target name="javacc" depends="check-javacc" unless="javacc.notRequired">
116 <mkdir dir="${mapcss.dir}/parsergen"/>
117 <exec append="false" executable="java" failifexecutionfails="true">
118 <arg value="-cp"/>
119 <arg value="${javacc.home}/javacc.jar"/>
120 <arg value="javacc"/>
121 <arg value="-DEBUG_PARSER=false"/>
122 <arg value="-DEBUG_TOKEN_MANAGER=false"/>
123 <arg value="-JDK_VERSION=1.7"/>
124 <arg value="-GRAMMAR_ENCODING=UTF-8"/>
125 <arg value="-OUTPUT_DIRECTORY=${mapcss.dir}/parsergen"/>
126 <arg value="${mapcss.dir}/MapCSSParser.jj"/>
127 </exec>
128 </target>
129 <target name="-jaxb_win" if="isWindows">
130 <property name="xjc" value="${java.home}\..\bin\xjc.exe" />
131 </target>
132 <target name="-jaxb_nix" unless="isWindows">
133 <property name="xjc" value="${java.home}/../bin/xjc" />
134 </target>
135 <target name="jaxb" depends="init, -jaxb_win, -jaxb_nix" unless="jaxb.notRequired">
136 <exec executable="${xjc}" failonerror="true">
137 <arg value="-d"/>
138 <arg value="${src.dir}"/>
139 <arg value="-encoding"/>
140 <arg value="UTF-8"/>
141 <arg value="../data_nodist/wms-cache.xsd"/>
142 </exec>
143 </target>
144 <target name="-pre-compile" depends="javacc,jaxb">
145<!-- <javacc target="${mapcss.dir}/MapCSSParser.jj" javacchome="${javacc.home}" outputdirectory="${mapcss.dir}/parsergen"/>-->
146 </target>
147</project>
Note: See TracBrowser for help on using the repository browser.