build.xml revision 446
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen<?xml version="1.0" encoding="UTF-8"?>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen<!--
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo SirainenCDDL HEADER START
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo SirainenThe contents of this file are subject to the terms of the
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo SirainenCommon Development and Distribution License (the "License").
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo SirainenYou may not use this file except in compliance with the License.
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo SirainenSee LICENSE.txt included in this distribution for the specific
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainenlanguage governing permissions and limitations under the License.
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo SirainenWhen distributing Covered Code, include this CDDL HEADER in each
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainenfile and include the License file at LICENSE.txt.
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo SirainenIf applicable, add the following below this CDDL HEADER, with the
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainenfields enclosed by brackets "[]" replaced with your own identifying
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Siraineninformation: Portions Copyright [yyyy] [name of copyright owner]
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo SirainenCDDL HEADER END
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo SirainenCopyright 2007 Sun Microsystems, Inc. All rights reserved.
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo SirainenUse is subject to license terms.
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen-->
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen<project name="OpenGrok" default="jar" basedir=".">
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <description>Builds, tests, and runs the project opengrok.</description>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <import file="nbproject/build-impl.xml"/>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <import file="nbproject/profiler-build-impl.xml"/> <!--
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen There exist several targets which are by default empty and which can be
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen used for execution of your tasks. These targets are usually executed
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen before and after some main targets. They are:
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -pre-init: called before initialization of project properties
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -post-init: called after initialization of project properties
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -pre-compile: called before javac compilation
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -post-compile: called after javac compilation
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -pre-compile-single: called before javac compilation of single file
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -post-compile-single: called after javac compilation of single file
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -pre-compile-test: called before javac compilation of JUnit tests
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -post-compile-test: called after javac compilation of JUnit tests
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -pre-compile-test-single: called before javac compilation of single JUnit test
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -post-compile-test-single: called after javac compilation of single JUunit test
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -pre-jar: called before JAR building
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -post-jar: called after JAR building
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -post-clean: called after cleaning build products
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen (Targets beginning with '-' are not intended to be called on their own.)
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen Example of inserting an obfuscator after compilation could look like this:
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-post-compile">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <obfuscate>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fileset dir="${build.classes.dir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </obfuscate>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen </target>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen For list of available properties check the imported
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen nbproject/build-impl.xml file.
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen Another way to customize the build is by overriding existing main targets.
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen The targets of interest are:
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen -init-macrodef-javac: defines macro for javac compilation
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen -init-macrodef-junit: defines macro for junit execution
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen -init-macrodef-debug: defines macro for class debugging
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -init-macrodef-java: defines macro for class execution
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -do-jar-with-manifest: JAR building (if you are using a manifest)
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -do-jar-without-manifest: JAR building (if you are not using a manifest)
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen run: execution of project
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -javadoc-build: Javadoc generation
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen test-report: JUnit report generation
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen An example of overriding the target for project execution could look like this:
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="run" depends="opengrok-impl.jar">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <exec dir="bin" executable="launcher.exe">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <arg file="${dist.jar}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </exec>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen Notice that the overridden target depends on the jar target and not only on
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen the compile target as the regular run target does. Again, for a list of available
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen properties which you can use, check the target you are overriding in the
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen nbproject/build-impl.xml file.
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -->
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <property name="version" value="0.6.1"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <property name="distname" value="opengrok"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <property name="findbugs.home" value="${user.home}/.ant/lib/findbugs"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <property name="checkstyle.home" value="${user.home}/.ant/lib/checkstyle"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <property name="pmd.home" value="${user.home}/.ant/lib/pmd"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <path id="lib.search.path">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="${user.home}/.ant/lib"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="${java.class.path}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="lib"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </path>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <path id="findbugs.lib.search.path">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="${findbugs.home}/lib/"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="${java.class.path}/findbugs/lib/"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="lib/findbugs/lib/"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </path>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <path id="checkstyle.lib.search.path">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="${checkstyle.home}/"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="${java.class.path}/checkstyle/"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="lib/checkstyle/lib/"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </path>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <path id="pmd.lib.search.path">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="${pmd.home}/lib/"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="${java.class.path}/pmd/lib/"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="lib/pmd/lib/"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </path>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <available file="JFlex.jar" type="file" property="JFlex.present">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <filepath refid="lib.search.path"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </available>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fail unless="JFlex.present" message="Please download JFlex (http://jflex.de/) and put JFlex.jar it into /lib directory (or in ant classpath)."/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <taskdef classname="JFlex.anttask.JFlexTask" name="jflex" classpath="lib/JFlex.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <property name="gensrcdir" value="generatedsrc"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="jflex">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <mkdir dir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainXref.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/c/CSymbolTokenizer.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/c/CXref.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/java/JavaSymbolTokenizer.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/java/JavaXref.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/lisp/LispSymbolTokenizer.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/lisp/LispXref.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/tcl/TclSymbolTokenizer.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/tcl/TclXref.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainFullTokenizer.lex" destdir="${gensrcdir}"/>
a0b89f3b1df99b3a32f44623f13ad1893118825bTimo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainSymbolTokenizer.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainXref.lex" destdir="${gensrcdir}"/>
a0b89f3b1df99b3a32f44623f13ad1893118825bTimo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/plain/XMLXref.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/sql/SQLXref.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/document/TroffXref.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/document/TroffFullTokenizer.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/sh/ShSymbolTokenizer.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/analysis/sh/ShXref.lex" destdir="${gensrcdir}"/>
a0b89f3b1df99b3a32f44623f13ad1893118825bTimo Sirainen <jflex file="src/org/opensolaris/opengrok/search/context/HistoryLineTokenizer.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <jflex file="src/org/opensolaris/opengrok/search/context/PlainLineTokenizer.lex" destdir="${gensrcdir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <property name="hg" value="hg"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-hg-get-changeset">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <exec executable="${hg}"
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen failifexecutionfails="no"
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen outputproperty="changeset">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <arg value="log"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <arg value="-r"/>
a0b89f3b1df99b3a32f44623f13ad1893118825bTimo Sirainen <arg value="tip"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <redirector>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <outputfilterchain>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <param type="regexp" value="^changeset:"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </filterreader>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <tokenfilter>
a0b89f3b1df99b3a32f44623f13ad1893118825bTimo Sirainen <replaceregex pattern="^changeset:[^:]*:" replace=""/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </tokenfilter>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </outputfilterchain>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </redirector>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </exec>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-update-build-info" depends="-hg-get-changeset">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <mkdir dir="${build.classes.dir}/org/opensolaris/opengrok"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <propertyfile
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen file="${build.classes.dir}/org/opensolaris/opengrok/info.properties">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <entry key="version" value="${version}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <entry key="changeset" value="${changeset}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </propertyfile>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <property name="coverage.dir" value="${basedir}/coverage"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-pre-compile" depends="jflex"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-post-clean">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <delete dir="${gensrcdir}"/>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <delete file="${manifest.file}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <delete dir="${coverage.dir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
ccffb125d94adff0ad776de5a96e22f864d6fb0aTimo Sirainen <!--
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen Create an empty manifest file so that nbproject/build-impl.xml
ccffb125d94adff0ad776de5a96e22f864d6fb0aTimo Sirainen notices that a manifest should be added to the jar file
ccffb125d94adff0ad776de5a96e22f864d6fb0aTimo Sirainen -->
ccffb125d94adff0ad776de5a96e22f864d6fb0aTimo Sirainen <target name="-touch-manifest">
ccffb125d94adff0ad776de5a96e22f864d6fb0aTimo Sirainen <!-- no attributes, main-class and class-path will be added later -->
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <manifest file="manifest.mf" mode="replace"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-pre-init" depends="-touch-manifest"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <!--
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen Initialize a property holding a list of jar files on which
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen opengrok.jar depends
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -->
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-post-init">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathconvert property="opengrok.lib.files" pathsep=" ">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <path>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement path="${javac.classpath}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </path>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <flattenmapper/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <map from="" to="lib/"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </pathconvert>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <!-- Update the manifest file with a classpath attribute -->
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-update-manifest-classpath">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <manifest file="${manifest.file}" mode="update">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <attribute name="Class-Path" value="${opengrok.lib.files}"/>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen </manifest>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <target name="-pre-jar" depends="-update-manifest-classpath,-update-build-info"/>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <!--
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen Copy the jars from lib to dist/lib manually if we don't have
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen the copylibs task from NetBeans
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen -->
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-copy-lib-without-netbeans"
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen unless="manifest.available+main.class+mkdist.available">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <copy todir="${dist.dir}/lib">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fileset file="${file.reference.ant.jar}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </copy>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <copy todir="${dist.dir}">
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <fileset dir="." includes="${opengrok.lib.files}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </copy>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-post-jar" depends="-copy-lib-without-netbeans">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <war destfile="${dist.war}" webxml="conf/web.xml">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fileset dir="web"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fileset dir="conf" excludes="web.xml"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <lib dir="${dist.dir}" includes="opengrok.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <lib dir="${dist.dir}/lib" includes="*.jar" excludes="servlet-api.jar,svn-javahl.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </war>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <echo message="Generating man page.."/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <java classname="org.opensolaris.opengrok.index.CommandLineOptions"
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen output="${dist.dir}/opengrok.1" failonerror="true" fork="true">
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <classpath>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <pathelement location="dist/opengrok.jar"/>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <pathelement path="${java.class.path}"/>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen </classpath>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen </java>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen </target>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <target name="package" depends="jar">
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <exec os="SunOS" executable="/usr/bin/pkgmk">
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <arg line="-o -d build -r . -v ${version} -f pkgdef/prototype"/>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen </exec>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <exec os="SunOS" executable="/usr/bin/pkgtrans">
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <arg line="-s build /dist/OSOLopengrok-${version}.pkg OSOLopengrok"/>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen </exec>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="dist" depends="jar">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <tar destfile="${dist.dir}/${distname}-${version}.tar.gz"
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen compression="gzip">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <tarfileset dir="." prefix="${distname}-${version}">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="README.txt"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="CHANGES.txt"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="LICENSE.txt"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="paths.tsv"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </tarfileset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <tarfileset dir="." prefix="${distname}-${version}" mode="755">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="OpenGrok"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="run.sh"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="run-quiet.sh"/>
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <include name="run.bat"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </tarfileset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <tarfileset dir="doc" prefix="${distname}-${version}">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="EXAMPLE.txt"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </tarfileset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <tarfileset dir="${dist.dir}" prefix="${distname}-${version}">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="opengrok.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="source.war"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="lib/*"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </tarfileset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </tar>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="dist-src" depends="init">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <mkdir dir="${dist.dir}"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <exec executable="hg">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <arg value="archive"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <arg value="-t"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <arg value="tgz"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <arg value="${dist.dir}/${distname}-${version}-src.tar.gz"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </exec>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-check_findbugs" description="Check that findbugs jar files are present">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <available file="findbugs.jar" type="file" property="findbugs.jar.present">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <filepath refid="findbugs.lib.search.path"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </available>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fail unless="findbugs.jar.present" message="Please install Findbugs findbugs.jar in ~/.ant/lib-directory (or in ant classpath) to run Findbugs, see README"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <available file="findbugs-ant.jar" type="file" property="findbugs-ant.jar.present">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <filepath refid="findbugs.lib.search.path"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </available>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fail unless="findbugs-ant.jar.present" message="Please install Findbugs findbugs-ant.jar in ~/.ant/lib-directory (or in ant classpath) to run Findbugs, see README"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="findbugs" depends="dist, -check_findbugs" description="Runs Findbugs on the OpenGrok source code and generate HTML output">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <path id="findbugs.lib" >
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement location="${findbugs.home}/lib/findbugs-ant.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </path>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <mkdir dir="findbugs"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <findbugs projectname="OpenGrok" home="${findbugs.home}" output="html" excludeFilter="tools/findbugs_filter.xml" outputFile="findbugs/findbugs.html" jvmargs="-Xmx512m">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <auxClasspath>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fileset dir="${dist.dir}/lib/">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <include name="*.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </fileset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </auxClasspath>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <sourcePath path="src" />
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <class location="${dist.dir}/opengrok.jar" />
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </findbugs>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="findbugs-xml" depends="dist, -check_findbugs" description="Runs Findbugs on the OpenGrok source code and generate XML output">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <path id="findbugs.lib" >
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement location="${findbugs.home}/lib/findbugs-ant.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </path>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <mkdir dir="findbugs"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <findbugs projectname="OpenGrok" home="${findbugs.home}" output="xml" excludeFilter="tools/findbugs_filter.xml" outputFile="findbugs/findbugs.xml" jvmargs="-Xmx512m">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <auxClasspath>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fileset dir="${dist.dir}/lib/">
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen <include name="*.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </fileset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </auxClasspath>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <sourcePath path="src" />
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <class location="${dist.dir}/opengrok.jar" />
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </findbugs>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-check_checkstyle" description="Check that checkstyle jar files are present">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <available file="checkstyle-all.jar" type="file" property="checkstyle.jar.present">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <filepath refid="checkstyle.lib.search.path"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </available>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fail unless="checkstyle.jar.present" message="Please install checkstyle-all.jar in lib-directory (or in ant classpath) to run Checkstyle, see README."/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="checkstyle" depends="compile, -check_checkstyle" description="Run checkstyle on OpenGrok source code">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <taskdef resource="checkstyletask.properties" classpath="${checkstyle.home}/checkstyle-all.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <checkstyle config="checkstyle/style.xml" failOnViolation="false">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fileset dir="src" includes="**/*.java"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <formatter type="plain"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <formatter type="plain" toFile="checkstyle/checkstyle_errors.txt"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <formatter type="xml" toFile="checkstyle/checkstyle_errors.xml"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </checkstyle>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-check_pmd" description="Check that pmd jar files are present">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <available file="pmd.jar" type="file" property="pmd.jar.present">
a0b89f3b1df99b3a32f44623f13ad1893118825bTimo Sirainen <filepath refid="pmd.lib.search.path"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </available>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fail unless="pmd.jar.present" message="Please install pmd.jar in lib-directory (or in ant classpath) to run PMD, see README."/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="pmd" depends="compile, -check_pmd" description="Run PMD on OpenGrok source code">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <path id="pmd.lib" >
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement location="${pmd.home}/lib/pmd.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement location="${pmd.home}/lib/jaxen.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </path>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.lib"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <mkdir dir="pmd"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pmd shortFilenames="true" targetjdk="1.6" failuresPropertyName="pmd.num.warnings">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/basic.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/braces.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/clone.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/design.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/favorites.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/finalizers.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/imports.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/junit.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/logging-java.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/migrating.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <!-- Enable when we have fever reported warnings -->
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <!-- <ruleset>rulesets/optimizations.xml</ruleset> -->
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/strictexception.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/strings.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/sunsecure.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/typeresolution.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <ruleset>rulesets/unusedcode.xml</ruleset>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <formatter type="html" toFile="pmd/pmd_report.html"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <formatter type="xml" toFile="pmd/pmd_report.xml"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fileset dir="src" includes="**/*.java"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </pmd>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <echo message="PMD finished, found ${pmd.num.warnings} warnings, see pmd/pmd_report.html."/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-check_emma" description="Check that emma jar files are present">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <available file="emma.jar" type="file" property="emma.jar.present">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <filepath refid="lib.search.path"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </available>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fail unless="emma.jar.present" message="Please install emma.jar in lib-directory (or in ant classpath) to run Emma, see README."/>
a0b89f3b1df99b3a32f44623f13ad1893118825bTimo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <available file="emma_ant.jar" type="file" property="emma_ant.jar.present">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <filepath refid="lib.search.path"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </available>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <fail unless="emma_ant.jar.present" message="Please install emma_ant.jar in lib-directory (or in ant classpath) to run Emma, see README."/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="emma-instrument" depends="compile, -check_emma" description="Instruments the source code for Emma code coverage analysis">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <path id="emma.lib" >
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement location="lib/emma.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <pathelement location="lib/emma_ant.jar"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </path>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <mkdir dir="${coverage.dir}" />
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <emma enabled="true">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <instr instrpath="build/classes"
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen metadatafile="${coverage.dir}/coverage.em"
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen mode="overwrite"
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen filter="+org.opensolaris.*"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </emma>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="-pre-compile-test">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <property name="test-sys-prop.emma.coverage.out.file" value="${coverage.dir}/coverage.ec"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <property name="test-sys-prop.emma.coverage.out.merge" value="true"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <!-- Generate ZIP files used for unit testing -->
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <zip destfile="${build.test.classes.dir}/org/opensolaris/opengrok/index/source.zip" basedir="testdata/sources"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <zip destfile="${build.test.classes.dir}/org/opensolaris/opengrok/history/repositories.zip" basedir="testdata/repositories"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <target name="emma-report" description="Analyze" depends="-check_emma">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <emma enabled="true" >
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <report sourcepath="src">
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <!-- collect all EMMA data dumps (metadata and runtime): -->
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <infileset dir="${coverage.dir}" includes="*.em, *.ec"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <txt outfile="${coverage.dir}/coverage.txt"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <xml outfile="${coverage.dir}/coverage.xml"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen <html outfile="${coverage.dir}/index.html"/>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </report>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </emma>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen </target>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen</project>
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen