build.xml revision 737
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey ShabalinCDDL HEADER START
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey ShabalinThe contents of this file are subject to the terms of the
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey ShabalinCommon Development and Distribution License (the "License").
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey ShabalinYou may not use this file except in compliance with the License.
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey ShabalinSee LICENSE.txt included in this distribution for the specific
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalinlanguage governing permissions and limitations under the License.
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey ShabalinWhen distributing Covered Code, include this CDDL HEADER in each
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalinfile and include the License file at LICENSE.txt.
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey ShabalinIf applicable, add the following below this CDDL HEADER, with the
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalinfields enclosed by brackets "[]" replaced with your own identifying
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalininformation: Portions Copyright [yyyy] [name of copyright owner]
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey ShabalinCDDL HEADER END
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey ShabalinCopyright 2007 Sun Microsystems, Inc. All rights reserved.
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey ShabalinUse is subject to license terms.
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin<project name="OpenGrok" default="jar" basedir=".">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <description>Builds, tests, and runs the project opengrok.</description>
e29bf450cafa2ce2564aeb0b64d2014c17228407Dwight Engen <import file="nbproject/profiler-build-impl.xml"/> <!--
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin There exist several targets which are by default empty and which can be
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin used for execution of your tasks. These targets are usually executed
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin before and after some main targets. They are:
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -pre-init: called before initialization of project properties
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -post-init: called after initialization of project properties
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -pre-compile: called before javac compilation
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -post-compile: called after javac compilation
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -pre-compile-single: called before javac compilation of single file
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -post-compile-single: called after javac compilation of single file
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -pre-compile-test: called before javac compilation of JUnit tests
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -post-compile-test: called after javac compilation of JUnit tests
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -pre-compile-test-single: called before javac compilation of single JUnit test
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -post-compile-test-single: called after javac compilation of single JUunit test
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -pre-jar: called before JAR building
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin -post-jar: called after JAR building
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin -post-clean: called after cleaning build products
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin (Targets beginning with '-' are not intended to be called on their own.)
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin Example of inserting an obfuscator after compilation could look like this:
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <target name="-post-compile">
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <fileset dir="${build.classes.dir}"/>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin For list of available properties check the imported
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin Another way to customize the build is by overriding existing main targets.
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin The targets of interest are:
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin -init-macrodef-javac: defines macro for javac compilation
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin -init-macrodef-junit: defines macro for junit execution
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin -init-macrodef-debug: defines macro for class debugging
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin -init-macrodef-java: defines macro for class execution
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin -do-jar-with-manifest: JAR building (if you are using a manifest)
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin -do-jar-without-manifest: JAR building (if you are not using a manifest)
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin run: execution of project
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin -javadoc-build: Javadoc generation
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin test-report: JUnit report generation
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin An example of overriding the target for project execution could look like this:
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <target name="run" depends="opengrok-impl.jar">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <exec dir="bin" executable="launcher.exe">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <arg file="${dist.jar}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin Notice that the overridden target depends on the jar target and not only on
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin the compile target as the regular run target does. Again, for a list of available
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin properties which you can use, check the target you are overriding in the
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <property name="distname" value="opengrok"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="findbugs.home" value="${user.home}/.ant/lib/findbugs"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="checkstyle.home" value="${user.home}/.ant/lib/checkstyle"/>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <property name="pmd.home" value="${user.home}/.ant/lib/pmd"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="test.repositories" value="testdata/repositories"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="test.sources" value="testdata/sources"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="test.cvs" value="${test.repositories}/cvs"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="test.hg" value="${test.repositories}/mercurial"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="test.svn" value="${test.repositories}/svn"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="test.razor" value="${test.repositories}/razor"/>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <available property="compileSystrayClient" classname="java.awt.TrayIcon"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <target name="-exclude-client" unless="compileSystrayClient">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <echo>JDK doesn't have java.awt.TrayIcon, excluding building of systray client ... </echo>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <property name="excludes" value="org/opensolaris/opengrok/management/client/**"/>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <available file="JFlex.jar" type="file" property="JFlex.present">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <fail unless="JFlex.present" message="Please download JFlex (http://jflex.de/) and put JFlex.jar it into /lib directory (or in ant classpath)."/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <taskdef classname="JFlex.anttask.JFlexTask" name="jflex" classpath="lib/JFlex.jar"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="gensrcdir" value="generatedsrc"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainXref.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/c/CSymbolTokenizer.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/c/CXref.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/c/CxxSymbolTokenizer.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/c/CxxXref.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/java/JavaSymbolTokenizer.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/java/JavaXref.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/lisp/LispSymbolTokenizer.lex" destdir="${gensrcdir}"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <jflex file="src/org/opensolaris/opengrok/analysis/lisp/LispXref.lex" destdir="${gensrcdir}"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <jflex file="src/org/opensolaris/opengrok/analysis/tcl/TclSymbolTokenizer.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/tcl/TclXref.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainFullTokenizer.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainSymbolTokenizer.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/plain/PlainXref.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/plain/XMLXref.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/sql/SQLXref.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/document/TroffXref.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/document/TroffFullTokenizer.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/sh/ShSymbolTokenizer.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/analysis/sh/ShXref.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/search/context/HistoryLineTokenizer.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <jflex file="src/org/opensolaris/opengrok/search/context/PlainLineTokenizer.lex" destdir="${gensrcdir}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin failifexecutionfails="no"
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin outputproperty="changeset">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <outputfilterchain>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin </filterreader>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <tokenfilter>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <replaceregex pattern="^changeset:[^:]*:" replace=""/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin </tokenfilter>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin </outputfilterchain>
44d397891e691ab994a69766cc72e57265b62da1Serge Hallyn </redirector>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <target name="-update-build-info" depends="-hg-get-changeset">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <mkdir dir="${build.classes.dir}/org/opensolaris/opengrok"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <propertyfile
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin file="${build.classes.dir}/org/opensolaris/opengrok/info.properties">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <entry key="changeset" value="${changeset}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin </propertyfile>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="coverage.dir" value="${basedir}/coverage"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <target name="-pre-compile" depends="jflex"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber Create an empty manifest file so that nbproject/build-impl.xml
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber notices that a manifest should be added to the jar file
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <!-- no attributes, main-class and class-path will be added later -->
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <manifest file="manifest.mf" mode="replace"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <target name="-pre-init" depends="-touch-manifest, -exclude-client"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin Initialize a property holding a list of jar files on which
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <pathconvert property="opengrok.lib.files" pathsep=" ">
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <flattenmapper/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber </pathconvert>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <!-- Update the manifest file with a classpath attribute -->
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <manifest file="${manifest.file}" mode="update">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <attribute name="Class-Path" value="${opengrok.lib.files}"/>
1881820ae4ff9004beef1bf7f04553580840441dSerge Hallyn <target name="-pre-jar" depends="-update-manifest-classpath,-update-build-info"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin Copy the jars from lib to dist/lib manually if we don't have
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin the copylibs task from NetBeans
f02ce27d4b1a9d01b88d0ffaf626e5bafa671bf0Stéphane Graber unless="manifest.available+main.class+mkdist.available">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <fileset dir="." includes="${opengrok.lib.files}"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <target name="-post-jar" depends="-copy-lib-without-netbeans">
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <war destfile="${dist.war}" webxml="conf/web.xml">
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <lib dir="${dist.dir}" includes="opengrok.jar"/>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <lib dir="${dist.dir}/lib" includes="*.jar" excludes="servlet-api.jar"/>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <java classname="org.opensolaris.opengrok.index.CommandLineOptions"
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin output="${dist.dir}/opengrok.1" failonerror="true" fork="true">
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <exec os="SunOS" executable="/usr/bin/pkgmk">
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <arg line="-o -d build -r . -v ${version} -f platform/solaris/pkgdef/prototype"/>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <exec os="SunOS" executable="/usr/bin/pkgtrans">
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <arg line="-s build /dist/OSOLopengrok-${version}.pkg OSOLopengrok"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <tar destfile="${dist.dir}/${distname}-${version}.tar.gz"
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin compression="gzip">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <tarfileset dir="." prefix="${distname}-${version}">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin </tarfileset>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <tarfileset dir="." prefix="${distname}-${version}" mode="755">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin </tarfileset>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <tarfileset dir="doc" prefix="${distname}-${version}">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin </tarfileset>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <tarfileset dir="${dist.dir}" prefix="${distname}-${version}">
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber </tarfileset>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <arg value="${dist.dir}/${distname}-${version}-src.tar.gz"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <target name="-check_findbugs" description="Check that findbugs jar files are present">
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <available file="findbugs.jar" type="file" property="findbugs.jar.present">
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <filepath refid="findbugs.lib.search.path"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <fail unless="findbugs.jar.present" message="Please install Findbugs findbugs.jar in ~/.ant/lib-directory (or in ant classpath) to run Findbugs, see README"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <available file="findbugs-ant.jar" type="file" property="findbugs-ant.jar.present">
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <filepath refid="findbugs.lib.search.path"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <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"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <target name="findbugs" depends="dist, -check_findbugs" description="Runs Findbugs on the OpenGrok source code and generate HTML output">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <pathelement location="${findbugs.home}/lib/findbugs-ant.jar"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib"/>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <findbugs projectname="OpenGrok" home="${findbugs.home}" output="html" excludeFilter="tools/findbugs_filter.xml" outputFile="findbugs/findbugs.html" jvmargs="-Xmx512m">
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <auxClasspath>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin </auxClasspath>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <class location="${dist.dir}/opengrok.jar" />
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <target name="findbugs-xml" depends="dist, -check_findbugs" description="Runs Findbugs on the OpenGrok source code and generate XML output">
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <pathelement location="${findbugs.home}/lib/findbugs-ant.jar"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <findbugs projectname="OpenGrok" home="${findbugs.home}" output="xml" excludeFilter="tools/findbugs_filter.xml" outputFile="findbugs/findbugs.xml" jvmargs="-Xmx512m">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <auxClasspath>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin </auxClasspath>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <class location="${dist.dir}/opengrok.jar" />
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <target name="-check_checkstyle" description="Check that checkstyle jar files are present">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <available file="checkstyle-all.jar" type="file" property="checkstyle.jar.present">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <filepath refid="checkstyle.lib.search.path"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <fail unless="checkstyle.jar.present" message="Please install checkstyle-all.jar in lib-directory (or in ant classpath) to run Checkstyle, see README."/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <target name="checkstyle" depends="compile, -check_checkstyle" description="Run checkstyle on OpenGrok source code">
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <taskdef resource="checkstyletask.properties" classpath="${checkstyle.home}/checkstyle-all.jar"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <checkstyle config="checkstyle/style.xml" failOnViolation="false">
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <formatter type="plain" toFile="checkstyle/checkstyle_errors.txt"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber <formatter type="xml" toFile="checkstyle/checkstyle_errors.xml"/>
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber </checkstyle>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <target name="-check_pmd" description="Check that pmd jar files are present">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <available file="pmd.jar" type="file" property="pmd.jar.present">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <fail unless="pmd.jar.present" message="Please install pmd.jar in lib-directory (or in ant classpath) to run PMD, see README."/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <target name="pmd" depends="compile, -check_pmd" description="Run PMD on OpenGrok source code">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <pathelement location="${pmd.home}/lib/pmd.jar"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <pathelement location="${pmd.home}/lib/jaxen.jar"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.lib"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <pmd targetjdk="1.6" failuresPropertyName="pmd.num.warnings" rulesetfiles="tools/pmd_ruleset.xml">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <formatter type="html" toFile="pmd/pmd_report.html"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <formatter type="xml" toFile="pmd/pmd_report.xml"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <echo message="PMD finished, found ${pmd.num.warnings} warnings, see pmd/pmd_report.html"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <target name="-check_emma" description="Check that emma jar files are present">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <available file="emma.jar" type="file" property="emma.jar.present">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <fail unless="emma.jar.present" message="Please install emma.jar in lib-directory (or in ant classpath) to run Emma, see README."/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <available file="emma_ant.jar" type="file" property="emma_ant.jar.present">
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <fail unless="emma_ant.jar.present" message="Please install emma_ant.jar in lib-directory (or in ant classpath) to run Emma, see README."/>
b031f0d2ca1b40eab86286b82d3c5e8b379122e6Alexey Shabalin <target name="emma-instrument" depends="compile, -check_emma" description="Instruments the source code for Emma code coverage analysis">
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin metadatafile="${coverage.dir}/coverage.em"
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin mode="overwrite"
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin filter="+org.opensolaris.*,-org.opensolaris.opengrok.management.client.*"/>
1881820ae4ff9004beef1bf7f04553580840441dSerge Hallyn <property name="test-sys-prop.emma.coverage.out.file" value="${coverage.dir}/coverage.ec"/>
1881820ae4ff9004beef1bf7f04553580840441dSerge Hallyn <property name="test-sys-prop.emma.coverage.out.merge" value="true"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <antcall target="-create-razor-repository"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <!-- Change root in CVS test repository -->
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="test.cvs.repo" value="${test.cvs}/cvsrepo"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <property name="test.cvs.root" value="${test.cvs}/cvsroot"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <!-- Strange indentation in line two levels below to get newline correctly -->
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <concat destfile="${test.cvs.repo}/CVS/Root" append="no" force="yes" eol="unix">${user.dir}/${test.cvs.root}/
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <!-- Generate ZIP files used for unit testing mercurial/.hg and mercurial/.hgignore are renamed -->
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <copy file="${test.hg}/hgignore" tofile="${test.hg}/.hgignore"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <zip destfile="${build.test.classes.dir}/org/opensolaris/opengrok/index/source.zip"
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin update="false"
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin defaultexcludes="no"/>
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin <zip destfile="${build.test.classes.dir}/org/opensolaris/opengrok/history/repositories.zip"
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin excludes="mercurial/hg/**, mercurial/hgignore"
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin update="false"
262f4e48a51a55ad9cee06abbcfe4a6ad6166f49Alexey Shabalin defaultexcludes="no"/>
<fileset dir="ext/SampleRazorRepository/Repository/OpenGrokSample/RAZOR_UNIVERSE/DOMAIN_01/Simple"/>
<!--copy todir="${test.razor}/Razor-Simple/SimpleCProgram-BinaryRelease/.razor">
<fileset dir="ext/SampleRazorRepository/Repository/OpenGrokSample/RAZOR_UNIVERSE/DOMAIN_01/Simple"/>