1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?> 210544477SAndre Fischer<!--*********************************************************** 310544477SAndre Fischer * 410544477SAndre Fischer * Licensed to the Apache Software Foundation (ASF) under one 510544477SAndre Fischer * or more contributor license agreements. See the NOTICE file 610544477SAndre Fischer * distributed with this work for additional information 710544477SAndre Fischer * regarding copyright ownership. The ASF licenses this file 810544477SAndre Fischer * to you under the Apache License, Version 2.0 (the 910544477SAndre Fischer * "License"); you may not use this file except in compliance 1010544477SAndre Fischer * with the License. You may obtain a copy of the License at 1110544477SAndre Fischer * 1210544477SAndre Fischer * http://www.apache.org/licenses/LICENSE-2.0 1310544477SAndre Fischer * 1410544477SAndre Fischer * Unless required by applicable law or agreed to in writing, 1510544477SAndre Fischer * software distributed under the License is distributed on an 1610544477SAndre Fischer * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1710544477SAndre Fischer * KIND, either express or implied. See the License for the 1810544477SAndre Fischer * specific language governing permissions and limitations 1910544477SAndre Fischer * under the License. 2010544477SAndre Fischer * 2110544477SAndre Fischer ***********************************************************--> 22cdf0e10cSrcweir<!-- You may freely edit this file. See commented blocks below for --> 23cdf0e10cSrcweir<!-- some examples of how to customize the build. --> 24cdf0e10cSrcweir<!-- (If you delete it and reopen the project it will be recreated.) --> 25cdf0e10cSrcweir<!-- By default, only the Clean and Build commands use this build script. --> 26cdf0e10cSrcweir<!-- Commands such as Run, Debug, and Test only use this build script if --> 27cdf0e10cSrcweir<!-- the Compile on Save feature is turned off for the project. --> 28cdf0e10cSrcweir<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> 29cdf0e10cSrcweir<!-- in the project's Project Properties dialog box.--> 30cdf0e10cSrcweir<project name="httpserv" default="default" basedir="."> 31cdf0e10cSrcweir <description>Builds, tests, and runs the project httpserv.</description> 32cdf0e10cSrcweir <import file="nbproject/build-impl.xml"/> 33cdf0e10cSrcweir <!-- 34cdf0e10cSrcweir 35cdf0e10cSrcweir There exist several targets which are by default empty and which can be 36cdf0e10cSrcweir used for execution of your tasks. These targets are usually executed 37cdf0e10cSrcweir before and after some main targets. They are: 38cdf0e10cSrcweir 39cdf0e10cSrcweir -pre-init: called before initialization of project properties 40cdf0e10cSrcweir -post-init: called after initialization of project properties 41cdf0e10cSrcweir -pre-compile: called before javac compilation 42cdf0e10cSrcweir -post-compile: called after javac compilation 43cdf0e10cSrcweir -pre-compile-single: called before javac compilation of single file 44cdf0e10cSrcweir -post-compile-single: called after javac compilation of single file 45cdf0e10cSrcweir -pre-compile-test: called before javac compilation of JUnit tests 46cdf0e10cSrcweir -post-compile-test: called after javac compilation of JUnit tests 47cdf0e10cSrcweir -pre-compile-test-single: called before javac compilation of single JUnit test 48cdf0e10cSrcweir -post-compile-test-single: called after javac compilation of single JUunit test 49cdf0e10cSrcweir -pre-jar: called before JAR building 50cdf0e10cSrcweir -post-jar: called after JAR building 51cdf0e10cSrcweir -post-clean: called after cleaning build products 52cdf0e10cSrcweir 53cdf0e10cSrcweir (Targets beginning with '-' are not intended to be called on their own.) 54cdf0e10cSrcweir 55cdf0e10cSrcweir Example of inserting an obfuscator after compilation could look like this: 56cdf0e10cSrcweir 57cdf0e10cSrcweir <target name="-post-compile"> 58cdf0e10cSrcweir <obfuscate> 59cdf0e10cSrcweir <fileset dir="${build.classes.dir}"/> 60cdf0e10cSrcweir </obfuscate> 61cdf0e10cSrcweir </target> 62cdf0e10cSrcweir 63cdf0e10cSrcweir For list of available properties check the imported 64cdf0e10cSrcweir nbproject/build-impl.xml file. 65cdf0e10cSrcweir 66cdf0e10cSrcweir 67cdf0e10cSrcweir Another way to customize the build is by overriding existing main targets. 68cdf0e10cSrcweir The targets of interest are: 69cdf0e10cSrcweir 70cdf0e10cSrcweir -init-macrodef-javac: defines macro for javac compilation 71cdf0e10cSrcweir -init-macrodef-junit: defines macro for junit execution 72cdf0e10cSrcweir -init-macrodef-debug: defines macro for class debugging 73cdf0e10cSrcweir -init-macrodef-java: defines macro for class execution 74cdf0e10cSrcweir -do-jar-with-manifest: JAR building (if you are using a manifest) 75cdf0e10cSrcweir -do-jar-without-manifest: JAR building (if you are not using a manifest) 76cdf0e10cSrcweir run: execution of project 77cdf0e10cSrcweir -javadoc-build: Javadoc generation 78cdf0e10cSrcweir test-report: JUnit report generation 79cdf0e10cSrcweir 80cdf0e10cSrcweir An example of overriding the target for project execution could look like this: 81cdf0e10cSrcweir 82cdf0e10cSrcweir <target name="run" depends="httpserv-impl.jar"> 83cdf0e10cSrcweir <exec dir="bin" executable="launcher.exe"> 84cdf0e10cSrcweir <arg file="${dist.jar}"/> 85cdf0e10cSrcweir </exec> 86cdf0e10cSrcweir </target> 87cdf0e10cSrcweir 88cdf0e10cSrcweir Notice that the overridden target depends on the jar target and not only on 89cdf0e10cSrcweir the compile target as the regular run target does. Again, for a list of available 90cdf0e10cSrcweir properties which you can use, check the target you are overriding in the 91cdf0e10cSrcweir nbproject/build-impl.xml file. 92cdf0e10cSrcweir 93cdf0e10cSrcweir --> 94*f5c5753cSAndre Fischer <!-- Import the environment as properties to make them available in project.properties 95*f5c5753cSAndre Fischer --> 96*f5c5753cSAndre Fischer <target name="-pre-init"> 97*f5c5753cSAndre Fischer <property environment="env" /> 98*f5c5753cSAndre Fischer </target> 99cdf0e10cSrcweir</project> 100