build.xml revision 177
132N/A<?xml version="1.0" encoding="UTF-8"?>
132N/A<!--
132N/A
132N/ACDDL HEADER START
132N/A
132N/AThe contents of this file are subject to the terms of the
132N/ACommon Development and Distribution License (the "License").
132N/AYou may not use this file except in compliance with the License.
132N/A
132N/ASee LICENSE.txt included in this distribution for the specific
132N/Alanguage governing permissions and limitations under the License.
132N/A
132N/AWhen distributing Covered Code, include this CDDL HEADER in each
132N/Afile and include the License file at LICENSE.txt.
132N/AIf applicable, add the following below this CDDL HEADER, with the
132N/Afields enclosed by brackets "[]" replaced with your own identifying
132N/Ainformation: Portions Copyright [yyyy] [name of copyright owner]
132N/A
132N/ACDDL HEADER END
132N/A
132N/ACopyright 2007 Sun Microsystems, Inc. All rights reserved.
132N/AUse is subject to license terms.
132N/A
132N/A-->
144N/A<project name="OpenGrok" default="default" basedir=".">
132N/A <description>Builds, tests, and runs the project opengrok.</description>
132N/A <import file="nbproject/build-impl.xml"/>
132N/A
132N/A <import file="nbproject/profiler-build-impl.xml"/> <!--
132N/A
132N/A There exist several targets which are by default empty and which can be
132N/A used for execution of your tasks. These targets are usually executed
132N/A before and after some main targets. They are:
132N/A
132N/A -pre-init: called before initialization of project properties
132N/A -post-init: called after initialization of project properties
132N/A -pre-compile: called before javac compilation
132N/A -post-compile: called after javac compilation
132N/A -pre-compile-single: called before javac compilation of single file
132N/A -post-compile-single: called after javac compilation of single file
132N/A -pre-compile-test: called before javac compilation of JUnit tests
132N/A -post-compile-test: called after javac compilation of JUnit tests
132N/A -pre-compile-test-single: called before javac compilation of single JUnit test
132N/A -post-compile-test-single: called after javac compilation of single JUunit test
132N/A -pre-jar: called before JAR building
132N/A -post-jar: called after JAR building
132N/A -post-clean: called after cleaning build products
132N/A
132N/A (Targets beginning with '-' are not intended to be called on their own.)
132N/A
132N/A Example of inserting an obfuscator after compilation could look like this:
132N/A
132N/A <target name="-post-compile">
132N/A <obfuscate>
132N/A <fileset dir="${build.classes.dir}"/>
132N/A </obfuscate>
132N/A </target>
132N/A
132N/A For list of available properties check the imported
132N/A nbproject/build-impl.xml file.
132N/A
132N/A
132N/A Another way to customize the build is by overriding existing main targets.
132N/A The targets of interest are:
132N/A
132N/A -init-macrodef-javac: defines macro for javac compilation
132N/A -init-macrodef-junit: defines macro for junit execution
132N/A -init-macrodef-debug: defines macro for class debugging
132N/A -init-macrodef-java: defines macro for class execution
132N/A -do-jar-with-manifest: JAR building (if you are using a manifest)
132N/A -do-jar-without-manifest: JAR building (if you are not using a manifest)
132N/A run: execution of project
132N/A -javadoc-build: Javadoc generation
132N/A test-report: JUnit report generation
132N/A
132N/A An example of overriding the target for project execution could look like this:
132N/A
132N/A <target name="run" depends="opengrok-impl.jar">
132N/A <exec dir="bin" executable="launcher.exe">
132N/A <arg file="${dist.jar}"/>
132N/A </exec>
132N/A </target>
132N/A
132N/A Notice that the overridden target depends on the jar target and not only on
132N/A the compile target as the regular run target does. Again, for a list of available
132N/A properties which you can use, check the target you are overriding in the
132N/A nbproject/build-impl.xml file.
132N/A
132N/A -->
132N/A <taskdef classname="JFlex.anttask.JFlexTask" name="jflex" classpath="lib/JFlex.jar"/>
132N/A <property name="gensrcdir" value="generatedsrc"/>
132N/A <target name="jflex">
132N/A <mkdir dir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainXref.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/c/CSymbolTokenizer.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/c/CXref.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/java/JavaSymbolTokenizer.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/java/JavaXref.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/lisp/LispSymbolTokenizer.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/lisp/LispXref.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainFullTokenizer.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainSymbolTokenizer.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainXref.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/plain/XMLXref.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/document/TroffXref.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/document/TroffFullTokenizer.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/sh/ShSymbolTokenizer.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/analysis/sh/ShXref.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/search/context/HistoryLineTokenizer.lex" destdir="${gensrcdir}"/>
132N/A <jflex file="src/org/opensolaris/opengrok/search/context/PlainLineTokenizer.lex" destdir="${gensrcdir}"/>
132N/A </target>
132N/A
132N/A <target name="-pre-compile" depends="jflex"/>
132N/A <target name="-post-clean">
132N/A <delete dir="${gensrcdir}"/>
132N/A </target>
132N/A
132N/A
144N/A <target name="-post-jar">
144N/A <war destfile="${dist.war}" webxml="conf/web.xml">
144N/A <fileset dir="web"/>
144N/A <fileset dir="conf" excludes="web.xml"/>
144N/A <lib dir="${dist.dir}" includes="opengrok.jar"/>
177N/A <lib dir="${dist.dir}/lib" includes="*.jar" excludes="servlet-api.jar,svn-javahl.jar"/>
144N/A </war>
144N/A </target>
132N/A</project>