build.xml revision 4f2be58ed1e83875854cf4c7258af8079344d26a
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye<?xml version="1.0" encoding="UTF-8"?>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye<!--
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond NorbyeCDDL HEADER START
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond NorbyeThe contents of this file are subject to the terms of the
64b763950bf11e9357facbd2b5666631a895c085Trond NorbyeCommon Development and Distribution License (the "License").
64b763950bf11e9357facbd2b5666631a895c085Trond NorbyeYou may not use this file except in compliance with the License.
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond NorbyeSee LICENSE.txt included in this distribution for the specific
64b763950bf11e9357facbd2b5666631a895c085Trond Norbyelanguage governing permissions and limitations under the License.
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond NorbyeWhen distributing Covered Code, include this CDDL HEADER in each
64b763950bf11e9357facbd2b5666631a895c085Trond Norbyefile and include the License file at LICENSE.txt.
64b763950bf11e9357facbd2b5666631a895c085Trond NorbyeIf applicable, add the following below this CDDL HEADER, with the
64b763950bf11e9357facbd2b5666631a895c085Trond Norbyefields enclosed by brackets "[]" replaced with your own identifying
64b763950bf11e9357facbd2b5666631a895c085Trond Norbyeinformation: Portions Copyright [yyyy] [name of copyright owner]
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond NorbyeCDDL HEADER END
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
fe80b749cd764b1f0f72b2f913b1fe10581911c3Knut Anders HatlenCopyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye-->
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco<project name="OpenGrok" default="jar" basedir=".">
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <description>Builds, tests, and runs the project opengrok.</description>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property name="build.sysclasspath" value="ignore"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property file="${user.home}/config/ant/${ant.project.name}.properties" />
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <property file="${user.home}/config/ant/global.properties" />
7e33e87b7d6c9a61ff11d23e37c02274b1223ce1Jens Elkner
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <import file="nbproject/build-impl.xml"/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <import file="nbproject/profiler-build-impl.xml"/> <!--
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye There exist several targets which are by default empty and which can be
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye used for execution of your tasks. These targets are usually executed
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye before and after some main targets. They are:
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -pre-init: called before initialization of project properties
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -post-init: called after initialization of project properties
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -pre-compile: called before javac compilation
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -post-compile: called after javac compilation
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -pre-compile-single: called before javac compilation of single file
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -post-compile-single: called after javac compilation of single file
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -pre-compile-test: called before javac compilation of JUnit tests
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -post-compile-test: called after javac compilation of JUnit tests
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -pre-compile-test-single: called before javac compilation of single JUnit test
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -post-compile-test-single: called after javac compilation of single JUunit test
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -pre-jar: called before JAR building
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -post-jar: called after JAR building
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -post-clean: called after cleaning build products
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye (Targets beginning with '-' are not intended to be called on their own.)
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye Example of inserting an obfuscator after compilation could look like this:
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <target name="-post-compile">
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <obfuscate>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <fileset dir="${build.classes.dir}"/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye </obfuscate>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye </target>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye For list of available properties check the imported
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye nbproject/build-impl.xml file.
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye Another way to customize the build is by overriding existing main targets.
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye The targets of interest are:
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -init-macrodef-javac: defines macro for javac compilation
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -init-macrodef-junit: defines macro for junit execution
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -init-macrodef-debug: defines macro for class debugging
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -init-macrodef-java: defines macro for class execution
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -do-jar-with-manifest: JAR building (if you are using a manifest)
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -do-jar-without-manifest: JAR building (if you are not using a manifest)
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye run: execution of project
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -javadoc-build: Javadoc generation
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye test-report: JUnit report generation
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye An example of overriding the target for project execution could look like this:
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <target name="run" depends="opengrok-impl.jar">
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <exec dir="bin" executable="launcher.exe">
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <arg file="${dist.jar}"/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye </exec>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye </target>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye Notice that the overridden target depends on the jar target and not only on
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye the compile target as the regular run target does. Again, for a list of available
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye properties which you can use, check the target you are overriding in the
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye nbproject/build-impl.xml file.
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -->
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen
46014450c7a107b2f10690b17559958ddb79f960Vladimir Kotal <property name="version" value="0.12.1"/>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <property name="distname" value="opengrok"/>
7e33e87b7d6c9a61ff11d23e37c02274b1223ce1Jens Elkner <property name="src.dir" location="src"/>
7e33e87b7d6c9a61ff11d23e37c02274b1223ce1Jens Elkner <property name="src.generatedsrc.dir" location="generatedsrc"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <property name="findbugs.home" value="${user.home}/.ant/lib/findbugs"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <property name="checkstyle.home" value="${user.home}/.ant/lib/checkstyle"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <property name="pmd.home" value="${user.home}/.ant/lib/pmd"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <property name="test.repositories" value="testdata/repositories"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <property name="test.sources" value="testdata/sources"/>
f754dd2bbc98a89a613ab4f76dad5534dc13e929Vladimir Kotal <property name="test.cvs" value="${test.repositories}/cvs_test"/>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <property name="test.cvs.repo" value="${test.cvs}/cvsrepo"/>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <property name="test.cvs.root" value="${test.cvs}/cvsroot"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <property name="test.hg" value="${test.repositories}/mercurial"/>
5dd7583c971e0c2c9e99378930d83df43de56098Lubos Kosco <property name="test.git" value="${test.repositories}/git"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <property name="test.svn" value="${test.repositories}/svn"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <property name="test.razor" value="${test.repositories}/razor"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <property name="mvn.repository" value="http://repo1.maven.org/maven2/"/>
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco
0466de7c67573e1ce5e0733325c1e5383270f5d5Knut Anders Hatlen <available property="compileSystrayClient" classname="java.awt.TrayIcon"/>
0466de7c67573e1ce5e0733325c1e5383270f5d5Knut Anders Hatlen
0466de7c67573e1ce5e0733325c1e5383270f5d5Knut Anders Hatlen <target name="-exclude-client" unless="compileSystrayClient">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <echo>JDK doesn't have java.awt.TrayIcon, excluding building of systray client ... </echo>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property name="excludes" value="org/opensolaris/opengrok/management/client/**"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco </target>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <property name="jflex-version" value="1.5.1"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <path id="lib.search.path">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement path="${user.home}/.ant/lib"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement path="${java.class.path}"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement path="lib"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathelement path="/lib"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <pathelement location="lib/jflex-${jflex-version}.jar"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco </path>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <path id="findbugs.lib.search.path">
a6ba9d291f880aa068794453a58c7a95154f4e5eLubos Kosco <pathelement path="${findbugs.home}/lib/"/>
a6ba9d291f880aa068794453a58c7a95154f4e5eLubos Kosco <pathelement path="${java.class.path}"/>
a6ba9d291f880aa068794453a58c7a95154f4e5eLubos Kosco <pathelement path="lib/findbugs/lib/"/>
a6ba9d291f880aa068794453a58c7a95154f4e5eLubos Kosco </path>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <path id="checkstyle.lib.search.path">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement path="${checkstyle.home}/"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <pathelement path="${java.class.path}"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco </path>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <path id="pmd.lib.search.path">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement path="${pmd.home}/lib/"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <pathelement path="${java.class.path}"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <pathelement path="lib/pmd/lib/"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco </path>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <target name="-check-jflex" description="Check that jflex jar file is present">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <available file="jflex-${jflex-version}.jar" type="file" property="JFlex.present">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <filepath refid="lib.search.path"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco </available>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <condition property="jflex_not_downloaded">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <not>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <isset property="JFlex.present"/>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal </not>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco </condition>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal </target>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <target name="download-jflex" depends="-check-jflex" if="jflex_not_downloaded">
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <get src="${mv.repository}/de/jflex/jflex/${jflex-version}/jflex-${jflex-version}.jar"
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal dest="lib/jflex-${jflex-version}.jar" verbose="true" usetimestamp="true"/>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal </target>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <target name="jflex" depends="download-jflex">
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <taskdef classname="jflex.anttask.JFlexTask" name="jflex" classpathref="lib.search.path" />
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <mkdir dir="${src.generatedsrc.dir}"/>
688a9806745b344428dffd6864dfd46ee1b79d88Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CxxSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CxxXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/fortran/FortranSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/fortran/FortranXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/java/JavaSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/java/JavaXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/javascript/JavaScriptSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/javascript/JavaScriptXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/python/PythonSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/python/PythonXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/perl/PerlSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/perl/PerlXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/php/PhpSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/php/PhpXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/lisp/LispSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/lisp/LispXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/tcl/TclSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/tcl/TclXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/scala/ScalaSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/scala/ScalaXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainFullTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/XMLXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sql/SQLXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sql/PLSQLXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/document/TroffXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/document/TroffFullTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sh/ShSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sh/ShXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/vb/VBSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/vb/VBXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/csharp/CSharpSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/csharp/CSharpXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/uue/UuencodeXref.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/uue/UuencodeFullTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/search/context/HistoryLineTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/search/context/PlainLineTokenizer.lex" destdir="${src.generatedsrc.dir}" inputstreamctor="false"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco </target>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <property name="git" value="git"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <!-- Get the id of the changeset we're building from using a
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco git command.
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco -->
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <target name="-get-changeset-from-command"
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye depends="-check-is-git-repo" if="build.from.repo">
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <exec executable="${git}"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen failifexecutionfails="no"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen outputproperty="changeset">
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal <arg value="rev-parse"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <arg value="HEAD"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen </exec>
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco </target>
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <!-- Check if we build from a checked out copy of the repository,
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye so that we have history information from git available.
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco -->
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <target name="-check-is-git-repo">
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <available property="build.from.repo" file=".git" type="dir"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye </target>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <target name="-check-is-archived-git-repo">
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <available property="build.from.archived.repo"
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco file=".git_archival.txt"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen type="file"/>
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco </target>
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <!-- Get the id of the changeset we're building from by reading
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal .git_archival.txt file created by git archive. This will only
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal be used when we're not building from a checked out copy of
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal the repository, for example the source distribution.
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal -->
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal <target name="-get-changeset-from-file"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen depends="-check-is-archived-git-repo" if="build.from.archived.repo">
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <tempfile property="git.archival.temp" deleteonexit="true"/>
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <copy file=".git_archival.txt" tofile="${git.archival.temp}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <replaceregexp file="${git.archival.temp}" flags="s"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen match=".*node: ([0-9a-f]{12}).*"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen replace="\1"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <loadfile srcFile="${git.archival.temp}" property="changeset"/>
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal </target>
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <target name="-set-changeset" unless="changeset">
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <property name="changeset" value="unknown"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen </target>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <target name="-update-build-info"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen depends="-get-changeset-from-command,-get-changeset-from-file,-set-changeset">
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <mkdir dir="${build.classes.dir}/org/opensolaris/opengrok"/>
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal <propertyfile
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal file="${build.classes.dir}/org/opensolaris/opengrok/info.properties">
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal <entry key="version" value="${version}"/>
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal <entry key="changeset" value="${changeset}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen </propertyfile>
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal </target>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <property name="coverage.dir" value="${basedir}/coverage"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <target name="-pre-compile" depends="jrcs,jflex,download-lucene"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <target name="eclipse" depends="-pre-compile"
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye description="satisfy eclipse dependencies"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <target name="-post-clean">
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <delete dir="${src.generatedsrc.dir}"/>
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal <delete file="${manifest.file}"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <delete dir="${coverage.dir}"/>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <antcall target="-delete-generated-repository-files"/>
81a83bbf0a20e99b5b27be2bcc34c5dbb703c898jel+opengrok </target>
81a83bbf0a20e99b5b27be2bcc34c5dbb703c898jel+opengrok
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <target name="clean-lib" depends="init">
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <delete file="${file.reference.lucene-core.jar}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <delete file="${file.reference.lucene-analyzers-common.jar}"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <delete file="${file.reference.lucene-queryparser.jar}"/>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <delete file="${file.reference.lucene-suggest.jar}"/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye </target>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <!--
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco Create an empty manifest file so that nbproject/build-impl.xml
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco notices that a manifest should be added to the jar file
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco -->
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <target name="-touch-manifest">
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <!-- no attributes, main-class and class-path will be added later -->
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <manifest file="manifest.mf" mode="replace"/>
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen </target>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <target name="-pre-init" depends="-touch-manifest, -exclude-client"/>
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <!--
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen Initialize a property holding a list of jar files on which
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye opengrok.jar depends
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen -->
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <target name="-post-init">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <pathconvert property="opengrok.lib.files" pathsep=" ">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <path>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <pathelement path="${javac.classpath}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </path>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <flattenmapper/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <map from="" to="lib/"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </pathconvert>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <mkdir dir="${build.test.classes.dir}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <mkdir dir="${build.dir}/src/jsp"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <!-- Update the manifest file with a classpath attribute -->
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="-update-manifest-classpath">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <manifest file="${manifest.file}" mode="update">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <attribute name="Class-Path"
81a83bbf0a20e99b5b27be2bcc34c5dbb703c898jel+opengrok value="${opengrok.lib.files} lib/derbyclient.jar lib/derby.jar"/>
81a83bbf0a20e99b5b27be2bcc34c5dbb703c898jel+opengrok </manifest>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </target>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <target name="-pre-jar" depends="-update-manifest-classpath,-update-build-info"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <!--
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye Copy the jars from lib to dist/lib manually if we don't have
752fbd3cf33aada419c8258959ff5574d2d2047dTrond Norbye the copylibs task from NetBeans
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye -->
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <target name="-copy-lib-without-netbeans"
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen unless="manifest.available+main.class+mkdist.available">
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <copy todir="${dist.dir}/lib">
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <fileset file="${file.reference.ant.jar}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </copy>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <copy todir="${dist.dir}">
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <fileset dir="." includes="${opengrok.lib.files}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </copy>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </target>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path id="plainlib.search.path">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathelement path="lib"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathelement path="/lib"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </path>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="-check-lucene" description="Check that lucene jar files are present">
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen <available file="${lucene-core.jar}" type="file" property="lucene-core.jar.present">
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <filepath refid="plainlib.search.path"/>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco </available>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <available file="${lucene-analyzers-common.jar}" type="file" property="lucene-analyzers-common.jar.present">
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <filepath refid="plainlib.search.path"/>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco </available>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <available file="${lucene-queryparser.jar}" type="file" property="lucene-queryparser.jar.present">
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <filepath refid="plainlib.search.path"/>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco </available>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <available file="${lucene-suggest.jar}" type="file" property="lucene-suggest.jar.present">
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <filepath refid="plainlib.search.path"/>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco </available>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <condition property="lucene_not_downloaded">
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <not>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <and>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <isset property="lucene-core.jar.present"/>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <isset property="lucene-analyzers-common.jar.present"/>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <isset property="lucene-queryparser.jar.present"/>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <isset property="lucene-suggest.jar.present"/>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco </and>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco </not>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco </condition>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco </target>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <target name="download-lucene" depends="-check-lucene" if="lucene_not_downloaded">
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <get src="${mvn.repository}/org/apache/lucene/lucene-core/${lucene.version}/${lucene-core.jar}"
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco dest="lib/${lucene-core.jar}" verbose="true" usetimestamp="true"/>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <get src="${mvn.repository}/org/apache/lucene/lucene-analyzers-common/${lucene.version}/${lucene-analyzers-common.jar}"
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco dest="lib/${lucene-analyzers-common.jar}" verbose="true" usetimestamp="true"/>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <get src="${mvn.repository}/org/apache/lucene/lucene-queryparser/${lucene.version}/${lucene-queryparser.jar}"
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco dest="lib/${lucene-queryparser.jar}" verbose="true" usetimestamp="true"/>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <get src="${mvn.repository}/org/apache/lucene/lucene-suggest/${lucene.version}/${lucene-suggest.jar}"
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco dest="lib/${lucene-suggest.jar}" verbose="true" usetimestamp="true"/>
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco </target>
3c390a5cd6f5baf2ceb8607d33fe66f93b7826baLubos Kosco
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <target name="-post-jar" depends="-copy-lib-without-netbeans">
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <war destfile="${dist.war}" webxml="web/WEB-INF/web.xml">
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <fileset dir="web" excludes="META-INF/context.xml"/>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <lib dir="${dist.dir}" includes="opengrok.jar"/>
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <lib dir="${dist.dir}/lib" includes="*.jar" excludes="servlet-api.jar"/>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco </war>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <echo message="Generating man page.."/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <java classname="org.opensolaris.opengrok.index.CommandLineOptions"
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen output="${dist.dir}/opengrok.1" failonerror="true" fork="true">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <classpath>
2c2a50fade805afbf4a5a880a38648613d7e01aeLubos Kosco <pathelement location="dist/opengrok.jar"/>
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye <pathelement path="${java.class.path}"/>
20a0bde399487a651cdeb66fc8b44b2212036355Trond Norbye </classpath>
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye </java>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye </target>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <target name="package" depends="jar">
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <exec os="SunOS" executable="/usr/bin/pkgmk" failonerror="true">
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <arg line="-o -d build -r . -v ${version} -f platform/solaris/pkgdef/prototype"/>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye </exec>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <exec os="SunOS" executable="/usr/bin/pkgtrans" failonerror="true">
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <arg line="-s build /dist/OSOLopengrok-${version}.pkg OSOLopengrok"/>
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye </exec>
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen <exec os="SunOS" executable="platform/solaris/ips/create.sh" failonerror="true">
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen <arg line="-v ${version}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </exec>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="dist" depends="jar">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <tar destfile="${dist.dir}/${distname}-${version}.tar.gz"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye compression="gzip">
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com <tarfileset dir="." prefix="${distname}-${version}/doc">
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com <include name="README.txt"/>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com <include name="CHANGES.txt"/>
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen <include name="LICENSE.txt"/>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <include name="NOTICE.txt"/>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <include name="paths.tsv"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="logging.properties"/>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen </tarfileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <tarfileset dir="." prefix="${distname}-${version}/bin" mode="755">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="OpenGrok"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </tarfileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <tarfileset dir="doc" prefix="${distname}-${version}/doc">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="EXAMPLE.txt"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </tarfileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <tarfileset dir="${dist.dir}" prefix="${distname}-${version}/lib">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="opengrok.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="source.war"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="lib/*"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <exclude name="lib/servlet-api.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </tarfileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <tarfileset dir="${dist.dir}" prefix="${distname}-${version}/man/man1">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="opengrok.1"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </tarfileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </tar>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="dist-src" depends="init">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <mkdir dir="${dist.dir}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <echo message="Creating archive for tag ${version}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <exec executable="${git}">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="archive"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <!--<arg value="-v"/>-->
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <arg value="--prefix=${distname}-${version}-src/"/>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <arg value="-o${dist.dir}/${distname}-${version}-src.zip"/>
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen <arg value="${version}"/>
c6963a7ea2753672325502d342e653700be550a8Lubos Kosco </exec>
c6963a7ea2753672325502d342e653700be550a8Lubos Kosco <echo message="If above suceeds, output is in ${dist.dir}/${distname}-${version}-src.zip"/>
c6963a7ea2753672325502d342e653700be550a8Lubos Kosco </target>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
c6963a7ea2753672325502d342e653700be550a8Lubos Kosco <target name="-check_findbugs" description="Check that findbugs jar files are present">
c6963a7ea2753672325502d342e653700be550a8Lubos Kosco <available file="findbugs.jar" type="file" property="findbugs.jar.present">
c6963a7ea2753672325502d342e653700be550a8Lubos Kosco <filepath refid="findbugs.lib.search.path"/>
c6963a7ea2753672325502d342e653700be550a8Lubos Kosco </available>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fail unless="findbugs.jar.present" message="Please install Findbugs findbugs.jar in ~/.ant/lib-directory (or in ant classpath) to run Findbugs, see README"/>
c6963a7ea2753672325502d342e653700be550a8Lubos Kosco
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen <available file="findbugs-ant.jar" type="file" property="findbugs-ant.jar.present">
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <filepath refid="findbugs.lib.search.path"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </available>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <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"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </target>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <target name="findbugs" depends="jar, -check_findbugs" description="Runs Findbugs on the OpenGrok source code and generate HTML output">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <path id="findbugs.lib" >
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement location="${findbugs.home}/lib/findbugs-ant.jar"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </path>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <mkdir dir="findbugs"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <findbugs projectname="OpenGrok" home="${findbugs.home}" output="html" excludeFilter="tools/findbugs_filter.xml" outputFile="findbugs/findbugs.html" jvmargs="-Xmx512m">
52cf1d63b1f1b231ff1e86eca2058d88560579b5Lubos Kosco <auxClasspath>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <fileset dir="${dist.dir}/lib/">
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <include name="*.jar"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik </fileset>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </auxClasspath>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <sourcePath path="${src.dir}"/>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <sourcePath path="${src.generatedsrc.dir}"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <class location="${dist.dir}/opengrok.jar" />
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik </findbugs>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik </target>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <target name="findbugs-xml" depends="jar, -check_findbugs" description="Runs Findbugs on the OpenGrok source code and generate XML output">
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <path id="findbugs.lib" >
a3a5f5c0500064f4c6ac3658b1e3e4d838912329Lubos Kosco <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
a3a5f5c0500064f4c6ac3658b1e3e4d838912329Lubos Kosco <pathelement location="${findbugs.home}/lib/findbugs-ant.jar"/>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik </path>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib"/>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <mkdir dir="findbugs"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <findbugs projectname="OpenGrok" home="${findbugs.home}" output="xml" excludeFilter="tools/findbugs_filter.xml" outputFile="findbugs/findbugs.xml" jvmargs="-Xmx512m">
52cf1d63b1f1b231ff1e86eca2058d88560579b5Lubos Kosco <auxClasspath>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <fileset dir="${dist.dir}/lib/">
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <include name="*.jar"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik </fileset>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </auxClasspath>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <sourcePath path="${src.dir}"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <sourcePath path="${src.generatedsrc.dir}"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <class location="${dist.dir}/opengrok.jar" />
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </findbugs>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </target>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <target name="-check_checkstyle" description="Check that checkstyle jar files are present">
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <available file="checkstyle-all.jar" type="file" property="checkstyle.jar.present">
a3a5f5c0500064f4c6ac3658b1e3e4d838912329Lubos Kosco <filepath refid="checkstyle.lib.search.path"/>
a3a5f5c0500064f4c6ac3658b1e3e4d838912329Lubos Kosco </available>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <fail unless="checkstyle.jar.present" message="Please install checkstyle-all.jar in lib-directory (or in ant classpath) to run Checkstyle, see README."/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </target>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <target name="checkstyle" depends="compile, -check_checkstyle" description="Run checkstyle on OpenGrok source code">
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <taskdef resource="checkstyletask.properties" classpath="${checkstyle.home}/checkstyle-all.jar"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <checkstyle config="checkstyle/style.xml" failOnViolation="false">
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <fileset dir="src" includes="**/*.java"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <fileset dir="test" includes="**/*.java"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <formatter type="plain"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <formatter type="plain" toFile="checkstyle/checkstyle_errors.txt"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <formatter type="xml" toFile="checkstyle/checkstyle_errors.xml"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </checkstyle>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </target>
45cf976b01987ad147e9edb54ffab0938dd6c016Trond Norbye
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <target name="-check_pmd" description="Check that pmd jar files are present">
54ba62a2c6e74332ffc742cb23faf21615b5d39fLubos Kosco <available file="pmd.jar" type="file" property="pmd.jar.present">
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <filepath refid="pmd.lib.search.path"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </available>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <fail unless="pmd.jar.present" message="Please install pmd.jar in lib-directory (or in ant classpath) to run PMD, see README."/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </target>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <target name="pmd" depends="compile, -check_pmd" description="Run PMD on OpenGrok source code">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <path id="pmd.lib" >
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <pathelement location="${pmd.home}/lib/pmd.jar"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <pathelement location="${pmd.home}/lib/jaxen.jar"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <pathelement location="${pmd.home}/lib/asm.jar"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </path>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.lib"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <mkdir dir="pmd"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <pmd failuresPropertyName="pmd.num.warnings" rulesetfiles="tools/pmd_ruleset.xml">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <sourcelanguage name="java" version="${javac.source}" />
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <formatter type="html" toFile="pmd/pmd_report.html"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <formatter type="xml" toFile="pmd/pmd_report.xml"/>
8a841dc6dc54985806558f1af0542d271d57259fLubos Kosco <fileset dir="src" includes="**/*.java"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik<!-- <fileset dir="test" includes="**/*.java"/> -->
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik<!-- <fileset dir="web" includes="**/*.jsp"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <fileset dir="web" includes="**/*.jspf"/> -->
8a841dc6dc54985806558f1af0542d271d57259fLubos Kosco </pmd>
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <echo message="PMD finished, found ${pmd.num.warnings} warnings, see pmd/pmd_report.html"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </target>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <target name="cpd-xml" depends="compile, -check_pmd" description="Run CPD on OpenGrok source code, print output in xml">
fcb68bae47907ba23c545e379c81c3ee6e19f778Lubos Kosco <path id="pmd.lib" >
fcb68bae47907ba23c545e379c81c3ee6e19f778Lubos Kosco <pathelement location="${pmd.home}/lib/pmd.jar"/>
fcb68bae47907ba23c545e379c81c3ee6e19f778Lubos Kosco <pathelement location="${pmd.home}/lib/jaxen.jar"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </path>
2ef63dc9adc693ddad2206d323b0a85a1afe70ecJorgen Austvik <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" classpathref="pmd.lib"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <cpd minimumTokenCount="100" format="xml" outputFile="pmd/cpd_report.xml">
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <fileset dir="src">
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <include name="**/*.java"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <fileset dir="test">
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <include name="**/*.java"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </cpd>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="cpd" depends="compile, -check_pmd" description="Run CPD on OpenGrok source code">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path id="pmd.lib" >
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathelement location="${pmd.home}/lib/pmd.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathelement location="${pmd.home}/lib/jaxen.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </path>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" classpathref="pmd.lib"/>
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <cpd minimumTokenCount="100" outputFile="pmd/cpd_report.txt">
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <fileset dir="src">
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <include name="**/*.java"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <fileset dir="test">
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <include name="**/*.java"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </cpd>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="-check_emma" description="Check that emma jar files are present">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <available file="emma.jar" type="file" property="emma.jar.present">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <filepath refid="lib.search.path"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </available>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fail unless="emma.jar.present" message="Please install emma.jar in lib-directory (or in ant classpath) to run Emma, see README."/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <available file="emma_ant.jar" type="file" property="emma_ant.jar.present">
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <filepath refid="lib.search.path"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </available>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <fail unless="emma_ant.jar.present" message="Please install emma_ant.jar in lib-directory (or in ant classpath) to run Emma, see README."/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </target>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
a6ba9d291f880aa068794453a58c7a95154f4e5eLubos Kosco <target name="emma-instrument" depends="compile, -check_emma" description="Instruments the source code for Emma code coverage analysis">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <path id="emma.lib" >
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <pathelement location="lib/emma.jar"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <pathelement location="lib/emma_ant.jar"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </path>
a6ba9d291f880aa068794453a58c7a95154f4e5eLubos Kosco <taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
a6ba9d291f880aa068794453a58c7a95154f4e5eLubos Kosco <mkdir dir="${coverage.dir}" />
a6ba9d291f880aa068794453a58c7a95154f4e5eLubos Kosco <emma enabled="true">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <instr instrpath="build/classes"
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco metadatafile="${coverage.dir}/coverage.em"
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco mode="overwrite"
a6ba9d291f880aa068794453a58c7a95154f4e5eLubos Kosco filter="+org.opensolaris.*,-org.opensolaris.opengrok.management.client.*"/>
a6ba9d291f880aa068794453a58c7a95154f4e5eLubos Kosco </emma>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </target>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <target name="-pre-compile-test">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <property name="test-sys-prop.emma.coverage.out.file" value="${coverage.dir}/coverage.ec"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <property name="test-sys-prop.emma.coverage.out.merge" value="true"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </target>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <target name="check_repositories_zip" description="check if repositores.zip was generated">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <available
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco file="${build.test.classes.dir}/org/opensolaris/opengrok/history/repositories.zip"
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco type="file" property="repos_exists">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </available>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <condition property="repos_missing">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <not>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <isset property="repos_exists"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </not>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </condition>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </target>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <target depends="check_repositories_zip" name="-post-compile-test" if="repos_missing">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <antcall target="-create-svn-repository"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <antcall target="-create-razor-repository"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <!-- Change root in CVS test repository -->
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <!-- Strange indentation in line two levels below to get newline correctly -->
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <concat destfile="${test.cvs.repo}/CVS/Root" append="no" force="yes" eol="unix">${basedir}/${test.cvs.root}/
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </concat>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <!-- Generate ZIP files used for unit testing git/.git are renamed -->
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <copy todir="${test.git}/.git">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <fileset dir="${test.git}/git"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </copy>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <!-- Generate ZIP files used for unit testing mercurial/.hg and mercurial/.hgignore are renamed -->
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <copy todir="${test.hg}/.hg">
f09d46eefeb5e4db6dc11e02e417b448fa9362a9Jorgen Austvik <fileset dir="${test.hg}/hg"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </copy>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <copy file="${test.hg}/hgignore" tofile="${test.hg}/.hgignore"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <zip destfile="${build.test.classes.dir}/org/opensolaris/opengrok/index/source.zip"
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik basedir="${test.sources}"
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik update="false"
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik defaultexcludes="no"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <zip destfile="${build.test.classes.dir}/org/opensolaris/opengrok/history/repositories.zip"
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik basedir="${test.repositories}"
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco excludes="mercurial/hg/**, mercurial/hgignore, git/git/**"
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik update="false"
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik defaultexcludes="no"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <antcall target="-delete-generated-repository-files"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik </target>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <target name="-create-svn-repository">
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <delete dir="${test.svn}"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <delete dir="${build.test.reposroots}/svn"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <mkdir dir="${build.test.reposroots}"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <exec executable="svnadmin" failifexecutionfails="false">
63e0f31920b0818d6f471a066c12da991fb35346Trond Norbye <arg value="create"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <arg value="${build.test.reposroots}/svn"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik </exec>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <!-- need absolute path for svn url -->
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <pathconvert property="test.svn.url">
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <map from="" to="file://"/>
ede8ae04a015c7d2ae4916e5bb36813b81cb7c30Jorgen Austvik <path location="${build.test.reposroots}/svn"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </pathconvert>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
49180e08afc7cf03413ab108bc71c14e9de1a880Jorgen Austvik <exec executable="svn" failifexecutionfails="false">
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <arg value="import"/>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <arg value="${test.sources}"/>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <arg value="${test.svn.url}"/>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <arg value="-m"/>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <arg value="Initial import"/>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal </exec>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <!-- Unit test for issue #694 -->
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <exec executable="svn" failifexecutionfails="false">
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <arg value="checkout"/>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <arg value="${test.svn.url}"/>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <arg value="${build.test.reposroots}/svn-working"/>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal </exec>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <mkdir dir="${build.test.reposroots}/svn-working/parent"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <mkdir dir="${build.test.reposroots}/svn-working/parent/module1"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <mkdir dir="${build.test.reposroots}/svn-working/parent/module2"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <touch file="${build.test.reposroots}/svn-working/parent/module1/file1.txt"/>
2f93a8465131cf5f18613f02f25a3663575bfe57Lubos Kosco <touch file="${build.test.reposroots}/svn-working/parent/module1/file2.txt"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <exec executable="svn" failifexecutionfails="false" dir="${build.test.reposroots}/svn-working">
5dd7583c971e0c2c9e99378930d83df43de56098Lubos Kosco <arg value="add"/>
5dd7583c971e0c2c9e99378930d83df43de56098Lubos Kosco <arg value="parent"/>
5dd7583c971e0c2c9e99378930d83df43de56098Lubos Kosco </exec>
5dd7583c971e0c2c9e99378930d83df43de56098Lubos Kosco <exec executable="svn" failifexecutionfails="false" dir="${build.test.reposroots}/svn-working">
629f5f1dc42d96d37676b093b89f011f143dad0aJorgen Austvik <arg value="commit"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <arg value="-m"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <arg value="files in 2 modules"/>
629f5f1dc42d96d37676b093b89f011f143dad0aJorgen Austvik </exec>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <!-- move the file1 from module1 to module2, and commit to finish our test case -->
629f5f1dc42d96d37676b093b89f011f143dad0aJorgen Austvik <exec executable="svn" failifexecutionfails="false" dir="${build.test.reposroots}/svn-working">
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye <arg value="move"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <arg value="parent/module1/file1.txt"/>
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye <arg value="parent/module2"/>
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye </exec>
629f5f1dc42d96d37676b093b89f011f143dad0aJorgen Austvik <exec executable="svn" failifexecutionfails="false" dir="${build.test.reposroots}/svn-working">
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <arg value="commit"/>
5dd7583c971e0c2c9e99378930d83df43de56098Lubos Kosco <arg value="-m"/>
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye <arg value="move file1.txt from module1 to module2"/>
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye </exec>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <delete dir="${build.test.reposroots}/svn-working"/>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <!-- end of unit test for issue #694 -->
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <exec executable="svn" failifexecutionfails="false">
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <arg value="checkout"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="${test.svn.url}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="${test.svn}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </exec>
256d06c803a7465c9886d386c1173b219f37284eLubos Kosco </target>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="-create-razor-repository">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <delete dir="${test.razor}"/>
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen <copy todir="${test.razor}/Razor-Simple">
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <fileset dir="ext/SampleRazorRepository/UserSandbox"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </copy>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <copy todir="${test.razor}/Razor-Simple/SimpleCProgram/.razor">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="ext/SampleRazorRepository/Repository/OpenGrokSample/RAZOR_UNIVERSE/DOMAIN_01/Simple"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </copy>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <!--
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye The support for binaries in Razor repositories is not fully
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye functional, so the next copy target is commented out for now.
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye -->
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <!--copy todir="${test.razor}/Razor-Simple/SimpleCProgram-BinaryRelease/.razor">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="ext/SampleRazorRepository/Repository/OpenGrokSample/RAZOR_UNIVERSE/DOMAIN_01/Simple"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal </copy-->
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal </target>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <!-- clean up generated test repositories -->
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <target name="-delete-generated-repository-files">
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <delete dir="${test.hg}/.hg"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <delete file="${test.hg}/.hgignore"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <delete dir="${test.git}/.git"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <delete dir="${test.svn}"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <delete dir="${test.razor}"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <delete file="${test.cvs.repo}/CVS/Root"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal </target>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <target name="emma-report" description="Analyze" depends="-check_emma">
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <emma enabled="true" >
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <report sourcepath="${src.dir},${src.generatedsrc.dir}">
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <!-- collect all EMMA data dumps (metadata and runtime): -->
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <infileset dir="${coverage.dir}" includes="*.em, *.ec"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <txt outfile="${coverage.dir}/coverage.txt"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <xml outfile="${coverage.dir}/coverage.xml"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <html outfile="${coverage.dir}/index.html"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal </report>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal </emma>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal </target>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <target name="code-coverage" depends="clean, emma-instrument, test, emma-report" description="Make test code coverage reports based on the OpenGrok unit tests"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <target name="jdepend" depends="compile" description="Run JDepend dependency checking">
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <mkdir dir="jdepend"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <java classname="jdepend.xmlui.JDepend" failonerror="true" fork="true">
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="-file"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="jdepend/report.xml"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="${build.classes.dir}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <classpath>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathelement location="${user.home}/.ant/lib/jdepend/lib/jdepend.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathelement path="${java.class.path}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </classpath>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </java>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <java classname="jdepend.textui.JDepend" failonerror="true" fork="true">
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <arg value="-file"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <arg value="jdepend/report.txt"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="${build.classes.dir}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <classpath>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathelement location="${user.home}/.ant/lib/jdepend/lib/jdepend.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathelement path="${java.class.path}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </classpath>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </java>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <!-- Generate HTML test report -->
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <target depends="init" name="test-report">
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <junitreport todir="${build.test.results.dir}">
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <fileset dir="${build.test.results.dir}">
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <include name="TEST-*.xml"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </fileset>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <report todir="${build.test.results.dir}"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </junitreport>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </target>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <!-- Build our patched JRCS library. -->
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <target name="jrcs" depends="-pre-pre-compile">
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <mkdir dir="${build.dir}/jrcs"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <javac srcdir="jrcs/src/main/java" destdir="${build.dir}/jrcs"
5dd7583c971e0c2c9e99378930d83df43de56098Lubos Kosco nowarn="on" source="${javac.source}">
5dd7583c971e0c2c9e99378930d83df43de56098Lubos Kosco <compilerarg value="-Xlint:deprecation"/> <!-- ,unchecked -->
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </javac>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <jar destfile="${file.reference.jrcs.jar}">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="${build.dir}/jrcs" includes="**/*.class"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </jar>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </target>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <!-- compile jsp - just to test -->
4c0668d038ecec0f5f4f4cc3d7a177d8e118c955Knut Anders Hatlen <property name="debug" value="on" />
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <property name="jsdebug" value="off" />
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <property name="compress" value=".gz" />
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <property name="debuglevel" value="source,lines,vars" />
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <property name="optimize" value="on" />
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <property name="deprecation" value="on" />
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <property name="listfiles" value="true" />
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <property name="codebase" value="org/opensolaris/opengrok"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <property name="codebase.dot" value="org.opensolaris.opengrok"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <property name="web.src.dir" location="web" />
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <patternset id="libs">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <include name="*.jar" />
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </patternset>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <path id="classpath.base">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <fileset dir="lib">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <patternset refid="libs" />
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </fileset>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </path>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <property name="AS_HOME" value="glassfish"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <path id="classpath.j2ee">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <fileset dir="${AS_HOME}/modules">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <include name="javaee.jar" />
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <!-- for the **/auth/* stuff, only -->
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <include name="appserv-rt.jar" />
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <include name="appserv-deployment-client.jar" />
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </fileset>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </path>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <path id="classpath.jspc">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <fileset dir="${AS_HOME}/modules">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <include name="javax.servlet.jar"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <include name="javax.servlet.jsp.jar"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <include name="jsp-impl.jar"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <include name="el-impl.jar"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <include name="javax.servlet.jsp.jstl.jar"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <include name="jstl-impl.jar"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <include name="jsf-api.jar"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <include name="jsf-impl.jar"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <include name="tools.jar"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen </fileset>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen </path>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <path id="classpath.web">
d3aa2b921c67d952f62c82503575ea545e274d69Knut Anders Hatlen <path refid="classpath.j2ee"/>
d3aa2b921c67d952f62c82503575ea545e274d69Knut Anders Hatlen <path refid="classpath.base"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </path>
743ae7de6b1d215c8e97b9d19e4c673df4d51ff5Knut Anders Hatlen
7db5dff294beecdc61e810b0b1e6ad0aaea218f7Lubos Kosco <path id="classpath.jsp">
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <path refid="classpath.jspc"/>
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <path refid="classpath.web"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </path>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="-jsp.check" depends="init">
d3aa2b921c67d952f62c82503575ea545e274d69Knut Anders Hatlen <mkdir dir="${build.dir}/src/jsp/${codebase}/jsp" />
d3aa2b921c67d952f62c82503575ea545e274d69Knut Anders Hatlen <uptodate property="jsp.not.changed">
7e33e87b7d6c9a61ff11d23e37c02274b1223ce1Jens Elkner <srcfiles dir="${web.src.dir}" includes="**/*.jsp,**/*.jspf"/>
7e33e87b7d6c9a61ff11d23e37c02274b1223ce1Jens Elkner <mapper type="glob" from="*.jsp"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye to="${build.dir}/src/jsp/${codebase}/jsp/*_jsp.java"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </uptodate>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="-jsp.generate" depends="-jsp.check" unless="jsp.not.changed">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <taskdef name="jasper" classname="org.apache.jasper.JspC"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye classpathref="classpath.jsp" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <mkdir dir="${build.dir}/src/web"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <copy todir="${build.dir}/src/web">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="${web.src.dir}">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="**/*.jsp"/>
7e33e87b7d6c9a61ff11d23e37c02274b1223ce1Jens Elkner <include name="**/*.jspf"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="**/index_body.html"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </copy>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <jasper validateXml="false"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye outputdir="${build.dir}/src/jsp"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye javaencoding="UTF-8"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye uriroot="${build.dir}/src/web"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye package="${codebase.dot}.jsp"
7c9ef1dc8277e4664577a4db666ec72024645c32Trond Norbye compilersourcevm="${javac.source}"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye compilertargetvm="${javac.target}"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye smapsuppressed="false"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye webxmlfragment="${build.dir}/src/servlets_web.xml"
7e33e87b7d6c9a61ff11d23e37c02274b1223ce1Jens Elkner />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <loadfile property="wdd" srcfile="${build.dir}/src/servlets_web.xml"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <copy file="${web.src.dir}/WEB-INF/web.xml" todir="${build.dir}"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye overwrite="true">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <filterset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <filter token="generated servlet mappings"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye value=" generated start -->${wdd}&lt;!-- generated end " />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </filterset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </copy>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="compile.jsp" depends="compile,-jsp.generate"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye description="--> compile java source code and jsp pages"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye >
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <javac srcdir="${build.dir}/src/jsp" destdir="${build.dir}/classes"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye includes="**/*.java"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye optimize="${optimize}" debug="${debug}" debuglevel="${debuglevel}"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye deprecation="${deprecation}" classpathref="classpath.jsp"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye encoding="UTF-8" listfiles="${listfiles}"
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye includeantruntime="false">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <compilerarg value="-Xlint:deprecation,unchecked" compiler="javac${javac.source}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </javac>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="all" depends="clean,jar,compile.jsp,test,javadoc,pmd,findbugs-xml,checkstyle" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye</project>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye