[507] | 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 | <project name="" default="default" basedir="." xmlns:web="http://www.netbeans.org/ns/j2ee-ejbjarproject/1">
|
---|
| 6 | <description>Builds, tests, and runs the project .</description>
|
---|
| 7 | <import file="nbproject/build-impl.xml"/>
|
---|
| 8 | <!--
|
---|
| 9 | There exist several targets which are by default empty and which can be
|
---|
| 10 | used for execution of your tasks. These targets are usually executed
|
---|
| 11 | before and after some main targets. They are:
|
---|
| 12 |
|
---|
| 13 | -pre-init called before initialization of project properties
|
---|
| 14 | -post-init called after initialization of project properties
|
---|
| 15 | -pre-compile called before javac compilation
|
---|
| 16 | -post-compile called after javac compilation
|
---|
| 17 | -pre-compile-single called before javac compilation of single file
|
---|
| 18 | -post-compile-single called after javac compilation of single file
|
---|
| 19 | -pre-dist called before jar building
|
---|
| 20 | -post-dist called after jar building
|
---|
| 21 | -post-clean called after cleaning build products
|
---|
| 22 |
|
---|
| 23 | Example of pluging an obfuscator after the compilation could look like
|
---|
| 24 |
|
---|
| 25 | <target name="post-compile">
|
---|
| 26 | <obfuscate>
|
---|
| 27 | <fileset dir="${build.classes.dir}"/>
|
---|
| 28 | </obfuscate>
|
---|
| 29 | </target>
|
---|
| 30 |
|
---|
| 31 | For list of available properties check the imported
|
---|
| 32 | nbproject/build-impl.xml file.
|
---|
| 33 |
|
---|
| 34 | Other way how to customize the build is by overriding existing main targets.
|
---|
| 35 | The target of interest are:
|
---|
| 36 |
|
---|
| 37 | init-macrodef-javac defines macro for javac compilation
|
---|
| 38 | init-macrodef-debug defines macro for class debugging
|
---|
| 39 | do-dist jar archive building
|
---|
| 40 | run execution of project
|
---|
| 41 | javadoc-build javadoc generation
|
---|
| 42 |
|
---|
| 43 | Example of overriding the target for project execution could look like
|
---|
| 44 |
|
---|
| 45 | <target name="run" depends="<PROJNAME>-impl.jar">
|
---|
| 46 | <exec dir="bin" executable="launcher.exe">
|
---|
| 47 | <arg file="${dist.jar}"/>
|
---|
| 48 | </exec>
|
---|
| 49 | </target>
|
---|
| 50 |
|
---|
| 51 | Notice that overridden target depends on jar target and not only on
|
---|
| 52 | compile target as regular run target does. Again, for list of available
|
---|
| 53 | properties which you can use check the target you are overriding in
|
---|
| 54 | nbproject/build-impl.xml file.
|
---|
| 55 | -->
|
---|
| 56 | <target name="-check-netbeans-home">
|
---|
| 57 | <condition property="no.netbeans.home">
|
---|
| 58 | <not>
|
---|
| 59 | <isset property="netbeans.home"/>
|
---|
| 60 | </not>
|
---|
| 61 | </condition>
|
---|
| 62 | </target>
|
---|
| 63 | <target name="-init-caps" if="no.netbeans.home">
|
---|
| 64 | <property file="${basedir}/nbproject/private/private.properties"/>
|
---|
| 65 | <property name="netbeans.home" value="${caps.netbeans.home}/platform8"/>
|
---|
| 66 | <property name="netbeans.user" value="${caps.netbeans.user}"/>
|
---|
| 67 | <property name="from.commandline" value="true"/>
|
---|
| 68 | </target>
|
---|
| 69 | <target name="-pre-init" depends="-check-netbeans-home,-init-caps"/>
|
---|
| 70 | </project>
|
---|