build.xml revision f89c1800b05de5e9fb4e5375354220f206fbf68b
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye<?xml version="1.0" encoding="UTF-8"?>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan<!--
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond NorbyeCDDL HEADER START
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond NorbyeThe contents of this file are subject to the terms of the
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry PanCommon 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
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos KoscoCopyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye-->
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco<project name="OpenGrok" default="jar" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
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" />
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <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
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan There exist several targets which are by default empty and which can be
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan used for execution of your tasks. These targets are usually executed
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan 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
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan For list of available properties check the imported
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan nbproject/build-impl.xml file.
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye Another way to customize the build is by overriding existing main targets.
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan 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)
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan 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
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan Notice that the overridden target depends on the jar target and not only on
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan 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
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan nbproject/build-impl.xml file.
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -->
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen
b4e6476f30c188b68c91dbfc12fe3b41d22ccc26Lubos Kosco <property name="version" value="0.13"/>
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"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
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/"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
0466de7c67573e1ce5e0733325c1e5383270f5d5Knut Anders Hatlen <available property="compileSystrayClient" classname="java.awt.TrayIcon"/>
0466de7c67573e1ce5e0733325c1e5383270f5d5Knut Anders Hatlen
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <target name="-exclude-client" unless="compileSystrayClient">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <echo>JDK doesn't have java.awt.TrayIcon, excluding building of systray client ... </echo>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <property name="excludes" value="org/opensolaris/opengrok/management/client/**"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
4e6518cbafefc8e0cac2440d25b814cc7d947160Lubos Kosco <property name="jflex-version" value="1.6.1"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <path id="lib.search.path">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement path="${user.home}/.ant/lib"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement path="${java.class.path}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathelement path="lib"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <pathelement path="/lib"/>
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <pathelement location="lib/jflex-${jflex-version}.jar"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </path>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <path id="jacoco.lib.search.path">
e96b618669f8ee799cef20c204c60bf2d2f5ad6dLubos Kosco <pathelement path="${jacoco.home}/lib"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <pathelement path="${java.class.path}"/>
e96b618669f8ee799cef20c204c60bf2d2f5ad6dLubos Kosco <pathelement path="lib/jacoco/lib"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </path>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <path id="findbugs.lib.search.path">
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <pathelement path="${findbugs.home}/lib/"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco <pathelement path="${java.class.path}"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement path="lib/findbugs/lib/"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </path>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <path id="checkstyle.lib.search.path">
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <pathelement path="${checkstyle.home}/"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco <pathelement path="${java.class.path}"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </path>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <path id="pmd.lib.search.path">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <pathelement path="${pmd.home}/lib/"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco <pathelement path="${java.class.path}"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </path>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <target name="-check-jflex" description="Check that jflex jar file is present">
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <available file="jflex-${jflex-version}.jar" type="file" property="JFlex.present">
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <filepath refid="lib.search.path"/>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal </available>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <condition property="jflex_not_downloaded">
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <not>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <isset property="JFlex.present"/>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal </not>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </condition>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <target name="download-jflex" depends="-check-jflex" if="jflex_not_downloaded">
688a9806745b344428dffd6864dfd46ee1b79d88Lubos Kosco <get src="${mvn.repository}/de/jflex/jflex/${jflex-version}/jflex-${jflex-version}.jar"
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco dest="lib/jflex-${jflex-version}.jar" verbose="true" usetimestamp="true"/>
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal </target>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco
b411dcdf67df825303fcb366759169c881936ac9Vladimir Kotal <target name="jflex" depends="download-jflex">
474ac6921d21d2e44cf9c1e91f17d6bcbb15c9e8Lubos Kosco <taskdef classname="jflex.anttask.JFlexTask" name="jflex" classpathref="lib.search.path" />
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <mkdir dir="${src.generatedsrc.dir}"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <macrodef name="run-jflex">
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <attribute name="file"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <sequential>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <jflex file="@{file}" destdir="${src.generatedsrc.dir}" nobak="on" inputstreamctor="false"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco </sequential>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco </macrodef>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CxxSymbolTokenizer.lex"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CxxXref.lex"/>
901a436889cb2a6b2921b09f601b43c2cea360c8Haitao Li <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CScopeParser.lex"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/erlang/ErlangSymbolTokenizer.lex"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/erlang/ErlangXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/fortran/FortranSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/fortran/FortranXref.lex"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/haskell/HaskellSymbolTokenizer.lex"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/haskell/HaskellXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/java/JavaSymbolTokenizer.lex"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/java/JavaXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/java/JavaScopeParser.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/javascript/JavaScriptSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/javascript/JavaScriptXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/python/PythonSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/python/PythonXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/perl/PerlSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/perl/PerlXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/php/PhpSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/php/PhpXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/lisp/LispSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/lisp/LispXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/tcl/TclSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/tcl/TclXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/scala/ScalaSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/scala/ScalaXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainFullTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainXref.lex"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/XMLXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sql/SQLXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sql/PLSQLXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/document/TroffXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/document/TroffFullTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sh/ShSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sh/ShXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/vb/VBSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/vb/VBXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/csharp/CSharpSymbolTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/csharp/CSharpXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/uue/UuencodeXref.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/analysis/uue/UuencodeFullTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/search/context/HistoryLineTokenizer.lex"/>
6602c01097c66d242046fb0490e0a5dcc1ca36c5Lubos Kosco <run-jflex file="${src.dir}/org/opensolaris/opengrok/search/context/PlainLineTokenizer.lex"/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <property name="git" value="git"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <!-- Get the id of the changeset we're building from using a
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal git command.
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen -->
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <target name="-get-changeset-from-command"
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco depends="-check-is-git-repo" if="build.from.repo">
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <exec executable="${git}"
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye failifexecutionfails="no"
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye outputproperty="changeset">
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <arg value="rev-parse"/>
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <arg value="HEAD"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye </exec>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye </target>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <!-- Check if we build from a checked out copy of the repository,
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco so that we have history information from git available.
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen -->
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <target name="-check-is-git-repo">
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <available property="build.from.repo" file=".git" type="dir"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen </target>
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal <target name="-check-is-archived-git-repo">
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal <available property="build.from.archived.repo"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan file=".git_archival.txt"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan type="file"/>
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal </target>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <!-- Get the id of the changeset we're building from by reading
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco .git_archival.txt file created by git archive. This will only
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen be used when we're not building from a checked out copy of
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen the repository, for example the source distribution.
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen -->
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <target name="-get-changeset-from-file"
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal depends="-check-is-archived-git-repo" if="build.from.archived.repo">
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <tempfile property="git.archival.temp" deleteonexit="true"/>
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <copy file=".git_archival.txt" tofile="${git.archival.temp}"/>
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <replaceregexp file="${git.archival.temp}" flags="s"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen match=".*node: ([0-9a-f]{12}).*"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen replace="\1"/>
9cf771c10c134cc953a502f895eaf321ec927f13Lubos Kosco <loadfile srcFile="${git.archival.temp}" property="changeset"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen </target>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal <target name="-set-changeset" unless="changeset">
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal <property name="changeset" value="unknown"/>
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal </target>
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <target name="-update-build-info"
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal depends="-get-changeset-from-command,-get-changeset-from-file,-set-changeset">
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <mkdir dir="${build.classes.dir}/org/opensolaris/opengrok"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <propertyfile
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye file="${build.classes.dir}/org/opensolaris/opengrok/info.properties">
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <entry key="version" value="${version}"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <entry key="changeset" value="${changeset}"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </propertyfile>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye </target>
0e633a1629c696cc57f02d620a8be7a118fd7956Vladimir Kotal
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <property name="coverage.dir" value="${basedir}/coverage"/>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <target name="-pre-compile" depends="jrcs,jflex,download-lucene,download-servlet-api"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <target name="eclipse" depends="-pre-compile"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan description="satisfy eclipse dependencies"/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <target name="-post-clean">
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <delete dir="${src.generatedsrc.dir}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <delete file="${manifest.file}"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <delete dir="${coverage.dir}"/>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <antcall target="-delete-generated-repository-files"/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen <!--
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen Create an empty manifest file so that nbproject/build-impl.xml
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen notices that a manifest should be added to the jar file
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen -->
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <target name="-touch-manifest">
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <!-- no attributes, main-class and class-path will be added later -->
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <manifest file="manifest.mf" mode="replace"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </target>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <!-- injecting jacoco, too -->
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <target name="-pre-init" depends="-touch-manifest, -exclude-client, -set-jacocoagent"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <!--
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen Initialize a property holding a list of jar files on which
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen opengrok.jar depends
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen -->
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <target name="-post-init">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathconvert property="opengrok.lib.files" pathsep=" ">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathelement path="${javac.classpath}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </path>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <flattenmapper/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <map from="" to="lib/"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </pathconvert>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <mkdir dir="${build.test.classes.dir}"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <mkdir dir="${build.dir}/src/jsp"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </target>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <!-- Update the manifest file with a classpath attribute -->
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <target name="-update-manifest-classpath">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <manifest file="${manifest.file}" mode="update">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <attribute name="Class-Path"
752fbd3cf33aada419c8258959ff5574d2d2047dTrond Norbye value="${opengrok.lib.files} lib/derbyclient.jar lib/derby.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </manifest>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </target>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <target name="-pre-jar" depends="-update-manifest-classpath,-update-build-info"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <!--
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen Copy the jars from lib to dist/lib manually if we don't have
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen the copylibs task from NetBeans
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen -->
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <target name="-copy-lib-without-netbeans"
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen unless="manifest.available+main.class+mkdist.available">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <copy todir="${dist.dir}/lib">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset file="${file.reference.ant.jar}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </copy>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <copy todir="${dist.dir}">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="." includes="${opengrok.lib.files}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </copy>
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <path id="plainlib.search.path">
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <pathelement path="lib"/>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <pathelement path="/lib"/>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco </path>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <target name="-check-lucene" description="Check that lucene jar files are present">
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <available file="${lucene-core.jar}" type="file" property="lucene-core.jar.present">
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <filepath refid="plainlib.search.path"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </available>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <available file="${lucene-analyzers-common.jar}" type="file" property="lucene-analyzers-common.jar.present">
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <filepath refid="plainlib.search.path"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </available>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <available file="${lucene-queryparser.jar}" type="file" property="lucene-queryparser.jar.present">
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <filepath refid="plainlib.search.path"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </available>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <available file="${lucene-suggest.jar}" type="file" property="lucene-suggest.jar.present">
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <filepath refid="plainlib.search.path"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </available>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <condition property="lucene_not_downloaded">
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <not>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <and>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <isset property="lucene-core.jar.present"/>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <isset property="lucene-analyzers-common.jar.present"/>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <isset property="lucene-queryparser.jar.present"/>
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco <isset property="lucene-suggest.jar.present"/>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco </and>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco </not>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </condition>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco <target name="download-lucene" depends="-check-lucene" if="lucene_not_downloaded">
feb6e09b8a97b44f8ea6a26171bc8332eb5380d1Lubos Kosco <delete>
feb6e09b8a97b44f8ea6a26171bc8332eb5380d1Lubos Kosco <fileset dir="lib">
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <include name="lucene-*.jar"/>
feb6e09b8a97b44f8ea6a26171bc8332eb5380d1Lubos Kosco </fileset>
feb6e09b8a97b44f8ea6a26171bc8332eb5380d1Lubos Kosco </delete>
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <get src="${mvn.repository}/org/apache/lucene/lucene-core/${lucene.version}/${lucene-core.jar}"
3c390a5cd6f5baf2ceb8607d33fe66f93b7826baLubos Kosco dest="lib/${lucene-core.jar}" verbose="true" usetimestamp="true"/>
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <get src="${mvn.repository}/org/apache/lucene/lucene-analyzers-common/${lucene.version}/${lucene-analyzers-common.jar}"
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco dest="lib/${lucene-analyzers-common.jar}" verbose="true" usetimestamp="true"/>
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <get src="${mvn.repository}/org/apache/lucene/lucene-queryparser/${lucene.version}/${lucene-queryparser.jar}"
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco dest="lib/${lucene-queryparser.jar}" verbose="true" usetimestamp="true"/>
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <get src="${mvn.repository}/org/apache/lucene/lucene-suggest/${lucene.version}/${lucene-suggest.jar}"
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco dest="lib/${lucene-suggest.jar}" verbose="true" usetimestamp="true"/>
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco </target>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <target name="-check-servlet-api" description="Check that servlet-api jar file is present">
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <available file="${servlet-api.jar}" type="file" property="servlet-api.jar.present">
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <filepath refid="plainlib.search.path"/>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco </available>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <condition property="servlet-api_not_downloaded">
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <not>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <isset property="servlet-api.jar.present"/>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco </not>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco </condition>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco </target>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <target name="download-servlet-api" depends="-check-servlet-api" if="servlet-api_not_downloaded">
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <delete>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <fileset dir="lib">
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <include name="servlet-api-*.jar"/>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco </fileset>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco </delete>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <get src="${mvn.repository}/javax/servlet/servlet-api/${servlet-api.version}/${servlet-api.jar}"
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco dest="lib/${servlet-api.jar}" verbose="true" usetimestamp="true"/>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco </target>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen <target name="-post-jar" depends="-copy-lib-without-netbeans">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <war destfile="${dist.war}" webxml="web/WEB-INF/web.xml">
2c2a50fade805afbf4a5a880a38648613d7e01aeLubos Kosco <fileset dir="web" excludes="META-INF/context.xml"/>
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye <lib dir="${dist.dir}" includes="opengrok.jar"/>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <lib dir="${dist.dir}/lib" includes="*.jar" excludes="${servlet-api.jar}"/>
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye </war>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <echo message="Generating man page.."/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <java classname="org.opensolaris.opengrok.index.CommandLineOptions"
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye output="${dist.dir}/opengrok.1" failonerror="true" fork="true">
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <classpath>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <pathelement location="dist/opengrok.jar"/>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <pathelement path="${java.class.path}"/>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye </classpath>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye </java>
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye </target>
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen <target name="package" depends="jar">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <exec os="SunOS" executable="/usr/bin/pkgmk" failonerror="true">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg line="-o -d build -r . -v ${version} -f platform/solaris/pkgdef/prototype"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </exec>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <exec os="SunOS" executable="/usr/bin/pkgtrans" failonerror="true">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg line="-s build /dist/OSOLopengrok-${version}.pkg OSOLopengrok"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </exec>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <exec os="SunOS" executable="platform/solaris/ips/create.sh" failonerror="true">
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <arg line="-v ${version}"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </exec>
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen </target>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <target name="dist" depends="jar">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <tar destfile="${dist.dir}/${distname}-${version}.tar.gz"
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen compression="gzip">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <tarfileset dir="." prefix="${distname}-${version}/doc">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="README.txt"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="CHANGES.txt"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="LICENSE.txt"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="NOTICE.txt"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="paths.tsv"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="logging.properties"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </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/*"/>
f89c1800b05de5e9fb4e5375354220f206fbf68bLubos Kosco <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>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen </target>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen <target name="dist-src" depends="init">
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <mkdir dir="${dist.dir}"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <echo message="Creating archive for tag ${version}"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <exec executable="${git}">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="archive"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <!--<arg value="-v"/>-->
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <arg value="--prefix=${distname}-${version}-src/"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <arg value="-o${dist.dir}/${distname}-${version}-src.zip"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <arg value="${version}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </exec>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <echo message="If above suceeds, output is in ${dist.dir}/${distname}-${version}-src.zip"/>
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <target name="-check_findbugs" description="Check that findbugs jar files are present">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <available file="findbugs.jar" type="file" property="findbugs.jar.present">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <filepath refid="findbugs.lib.search.path"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </available>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <fail unless="findbugs.jar.present" message="Please install Findbugs findbugs.jar in ~/.ant/lib-directory (or in ant classpath) to run Findbugs, see README"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <available file="findbugs-ant.jar" type="file" property="findbugs-ant.jar.present">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <filepath refid="findbugs.lib.search.path"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </available>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen 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>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
52cf1d63b1f1b231ff1e86eca2058d88560579b5Lubos Kosco <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" >
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <pathelement location="${findbugs.home}/lib/findbugs-ant.jar"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </path>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib"/>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <mkdir dir="findbugs"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <findbugs projectname="OpenGrok" home="${findbugs.home}" output="html" excludeFilter="tools/findbugs_filter.xml" outputFile="findbugs/findbugs.html" jvmargs="-Xmx512m">
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <auxClasspath>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <fileset dir="${dist.dir}/lib/">
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <include name="*.jar"/>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik </fileset>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik </auxClasspath>
a3a5f5c0500064f4c6ac3658b1e3e4d838912329Lubos Kosco <sourcePath path="${src.dir}"/>
a3a5f5c0500064f4c6ac3658b1e3e4d838912329Lubos Kosco <sourcePath path="${src.generatedsrc.dir}"/>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <class location="${dist.dir}/opengrok.jar" />
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik </findbugs>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
52cf1d63b1f1b231ff1e86eca2058d88560579b5Lubos Kosco <target name="findbugs-xml" depends="jar, -check_findbugs" description="Runs Findbugs on the OpenGrok source code and generate XML output">
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <path id="findbugs.lib" >
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <pathelement location="${findbugs.home}/lib/findbugs-ant.jar"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </path>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <mkdir dir="findbugs"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <findbugs projectname="OpenGrok" home="${findbugs.home}" output="xml" excludeFilter="tools/findbugs_filter.xml" outputFile="findbugs/findbugs.xml" jvmargs="-Xmx512m">
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <auxClasspath>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <fileset dir="${dist.dir}/lib/">
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <include name="*.jar"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </fileset>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </auxClasspath>
a3a5f5c0500064f4c6ac3658b1e3e4d838912329Lubos Kosco <sourcePath path="${src.dir}"/>
a3a5f5c0500064f4c6ac3658b1e3e4d838912329Lubos Kosco <sourcePath path="${src.generatedsrc.dir}"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <class location="${dist.dir}/opengrok.jar" />
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </findbugs>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <target name="-check_checkstyle" description="Check that checkstyle jar files are present">
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <available file="checkstyle-all.jar" type="file" property="checkstyle.jar.present">
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <filepath refid="checkstyle.lib.search.path"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </available>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <fail unless="checkstyle.jar.present" message="Please install checkstyle-all.jar in lib-directory (or in ant classpath) to run Checkstyle, see README."/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
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"/>
45cf976b01987ad147e9edb54ffab0938dd6c016Trond Norbye <checkstyle config="checkstyle/style.xml" failOnViolation="false">
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <fileset dir="src" includes="**/*.java"/>
54ba62a2c6e74332ffc742cb23faf21615b5d39fLubos Kosco <fileset dir="test" includes="**/*.java"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <formatter type="plain"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <formatter type="plain" toFile="checkstyle/checkstyle_errors.txt"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <formatter type="xml" toFile="checkstyle/checkstyle_errors.xml"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </checkstyle>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </target>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <target name="-check_pmd" description="Check that pmd jar files are present">
77128b975f74663eb8a2cb46ebd7274f72979504Lubos Kosco <available file="${pmd.home}/lib" type="dir" property="pmd-lib.present">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <filepath refid="pmd.lib.search.path"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </available>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <fail unless="pmd-lib.present" message="Please point pmd.home to proper directory to run PMD, see README."/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </target>
5859d902e2cc362a4032f583bdeb65b8da29ea8cLubos Kosco
5859d902e2cc362a4032f583bdeb65b8da29ea8cLubos Kosco <path id="pmd.lib" >
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <fileset followsymlinks="false" dir="${pmd.home}/lib">
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <include name="*.jar"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </fileset>
5859d902e2cc362a4032f583bdeb65b8da29ea8cLubos Kosco </path>
5859d902e2cc362a4032f583bdeb65b8da29ea8cLubos Kosco
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <target name="pmd" depends="compile, -check_pmd" description="Run PMD on OpenGrok source code">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.lib"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <mkdir dir="pmd"/>
8a841dc6dc54985806558f1af0542d271d57259fLubos Kosco <pmd failuresPropertyName="pmd.num.warnings" rulesetfiles="tools/pmd_ruleset.xml">
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <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"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <fileset dir="src" includes="**/*.java"/>
fcb68bae47907ba23c545e379c81c3ee6e19f778Lubos Kosco<!-- <fileset dir="test" includes="**/*.java"/> -->
fcb68bae47907ba23c545e379c81c3ee6e19f778Lubos Kosco<!-- <fileset dir="web" includes="**/*.jsp"/>
fcb68bae47907ba23c545e379c81c3ee6e19f778Lubos Kosco <fileset dir="web" includes="**/*.jspf"/> -->
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </pmd>
2ef63dc9adc693ddad2206d323b0a85a1afe70ecJorgen Austvik <echo message="PMD finished, found ${pmd.num.warnings} warnings, see pmd/pmd_report.html"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </target>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <target name="cpd-xml" depends="compile, -check_pmd" description="Run CPD on OpenGrok source code, print output in xml">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" classpathref="pmd.lib"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <cpd minimumTokenCount="100" format="xml" outputFile="pmd/cpd_report.xml">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="src">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="**/*.java"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="test">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="**/*.java"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </cpd>
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco </target>
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco <target name="cpd" depends="compile, -check_pmd" description="Run CPD on OpenGrok source code">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" classpathref="pmd.lib"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <cpd minimumTokenCount="100" outputFile="pmd/cpd_report.txt">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="src">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="**/*.java"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="test">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="**/*.java"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </cpd>
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco </target>
30637745bf5a7db2ff9684a2536cc9f8c9df2218Lubos Kosco
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <target name="-check_jacoco" description="Check that jacoco jar files are present">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <available file="jacocoant.jar" type="file" property="jacocoant.jar.present">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <filepath refid="jacoco.lib.search.path"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </available>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <fail unless="jacocoant.jar.present" message="Please install jacocoant.jar in lib-directory (or in ant classpath) to run Jacoco, see README."/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpathref="jacoco.lib.search.path"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
e96b618669f8ee799cef20c204c60bf2d2f5ad6dLubos Kosco <property name="jacoco_out" value="jacoco.exec"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
a6ba9d291f880aa068794453a58c7a95154f4e5eLubos Kosco <target name="-set-jacocoagent" if="jacoco">
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <antcall target="-check_jacoco"/>
586b81c280d887d5c6d6d6c460a336f76816daebLubos Kosco <jacoco:agent property="jacocoagent" includes="org.opensolaris.*" excludes="org.opensolaris.opengrok.management.client.*:org.apache.*" destfile="${jacoco_out}"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <!-- Ugly hack to leverage IDE variable to inject jacoco
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco this will most probably break once Netbeans folks will drop this variable!
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco -->
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <property name="run.jvmargs.ide" value="${jacocoagent}" />
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <echo level="warn" message="Jacoco agent was enabled and injected to run.jvmargs.ide"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </target>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <target name="jacocoreport" depends="-check_jacoco,-jacocoreport-without-test" />
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <target name="jacoco-code-coverage" depends="clean, test, jacocoreport" description="Make jacoco test code coverage reports based on the OpenGrok unit tests" if="jacoco"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <target name="-jacocoreport-without-test"> <!--depends="-set-jacocoagent"> -->
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <jacoco:report>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <executiondata>
e96b618669f8ee799cef20c204c60bf2d2f5ad6dLubos Kosco <file file="${jacoco_out}"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </executiondata>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <structure name="Opengrok">
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <classfiles>
50c60fa3feefb22293e30dfba92e0d571db5cd6bLubos Kosco <fileset dir="build/classes">
50c60fa3feefb22293e30dfba92e0d571db5cd6bLubos Kosco <exclude name="**/org/opensolaris/opengrok/management/client/*.class" />
50c60fa3feefb22293e30dfba92e0d571db5cd6bLubos Kosco </fileset>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </classfiles>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <sourcefiles encoding="UTF-8">
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <fileset dir="src"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </sourcefiles>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </structure>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <html destdir="jacoco"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <csv destfile="jacoco/report.csv"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <xml destfile="jacoco/report.xml"/>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco </jacoco:report>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </target>
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco
37187cd476e30232cba3afb116e079cb640f984eLubos Kosco <target name="-pre-compile-test"><!-- depends="-set-jacocoagent"> -->
ede8ae04a015c7d2ae4916e5bb36813b81cb7c30Jorgen Austvik </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco <!-- <target name="-pre-compile-test-single" depends="-set-jacocoagent"/> -->
49180e08afc7cf03413ab108bc71c14e9de1a880Jorgen Austvik
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <target name="check_repositories_zip" description="check if repositores.zip was generated">
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <available
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan file="${build.test.classes.dir}/org/opensolaris/opengrok/history/repositories.zip"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan type="file" property="repos_exists">
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal </available>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <condition property="repos_missing">
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <not>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <isset property="repos_exists"/>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal </not>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal </condition>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal </target>
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal
da3326b2bbe839609b0f5cf91c86698f1523c8a5Vladimir Kotal <target depends="check_repositories_zip" name="-post-compile-test" if="repos_missing">
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <antcall target="-create-svn-repository"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <antcall target="-create-razor-repository"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <!-- Change root in CVS test repository -->
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <!-- Strange indentation in line two levels below to get newline correctly -->
2f93a8465131cf5f18613f02f25a3663575bfe57Lubos Kosco <concat destfile="${test.cvs.repo}/CVS/Root" append="no" force="yes" eol="unix">${basedir}/${test.cvs.root}/
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </concat>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <!-- Generate ZIP files used for unit testing git/.git are renamed -->
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <copy todir="${test.git}/.git">
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <fileset dir="${test.git}/git"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </copy>
629f5f1dc42d96d37676b093b89f011f143dad0aJorgen Austvik <!-- Generate ZIP files used for unit testing mercurial/.hg and mercurial/.hgignore are renamed -->
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <copy todir="${test.hg}/.hg">
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <fileset dir="${test.hg}/hg"/>
629f5f1dc42d96d37676b093b89f011f143dad0aJorgen Austvik </copy>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <copy file="${test.hg}/hgignore" tofile="${test.hg}/.hgignore"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye <zip destfile="${build.test.classes.dir}/org/opensolaris/opengrok/index/source.zip"
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik basedir="${test.sources}"
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye update="false"
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye defaultexcludes="no"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <zip destfile="${build.test.classes.dir}/org/opensolaris/opengrok/history/repositories.zip"
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik basedir="${test.repositories}"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan excludes="mercurial/hg/**, mercurial/hgignore, git/git/**"
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye update="false"
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye defaultexcludes="no"/>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <antcall target="-delete-generated-repository-files"/>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen </target>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <target name="-create-svn-repository">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <delete dir="${test.svn}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <delete dir="${build.test.reposroots}/svn"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <mkdir dir="${build.test.reposroots}"/>
256d06c803a7465c9886d386c1173b219f37284eLubos Kosco <exec executable="svnadmin" failifexecutionfails="false">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="create"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="${build.test.reposroots}/svn"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </exec>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <!-- need absolute path for svn url -->
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <pathconvert property="test.svn.url">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <map from="" to="file://"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path location="${build.test.reposroots}/svn"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </pathconvert>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <exec executable="svn" failifexecutionfails="false">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="import"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="${test.sources}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="${test.svn.url}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="-m"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="Initial import"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </exec>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <!-- Unit test for issue #694 -->
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <exec executable="svn" failifexecutionfails="false">
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="checkout"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="${test.svn.url}"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="${build.test.reposroots}/svn-working"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal </exec>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <mkdir dir="${build.test.reposroots}/svn-working/parent"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <mkdir dir="${build.test.reposroots}/svn-working/parent/module1"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <mkdir dir="${build.test.reposroots}/svn-working/parent/module2"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <touch file="${build.test.reposroots}/svn-working/parent/module1/file1.txt"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <touch file="${build.test.reposroots}/svn-working/parent/module1/file2.txt"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <exec executable="svn" failifexecutionfails="false" dir="${build.test.reposroots}/svn-working">
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="add"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="parent"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal </exec>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <exec executable="svn" failifexecutionfails="false" dir="${build.test.reposroots}/svn-working">
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="commit"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="-m"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="files in 2 modules"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal </exec>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <!-- move the file1 from module1 to module2, and commit to finish our test case -->
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <exec executable="svn" failifexecutionfails="false" dir="${build.test.reposroots}/svn-working">
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="move"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="parent/module1/file1.txt"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="parent/module2"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal </exec>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <exec executable="svn" failifexecutionfails="false" dir="${build.test.reposroots}/svn-working">
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="commit"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="-m"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal <arg value="move file1.txt from module1 to module2"/>
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal </exec>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <delete dir="${build.test.reposroots}/svn-working"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <!-- end of unit test for issue #694 -->
0fbfe32f2fe7b0faa283441ba59f99ea05691d9dVladimir Kotal
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <exec executable="svn" failifexecutionfails="false">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="checkout"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="${test.svn.url}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <arg value="${test.svn}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </exec>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <target name="-create-razor-repository">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <delete dir="${test.razor}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <copy todir="${test.razor}/Razor-Simple">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <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>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <!--
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen The support for binaries in Razor repositories is not fully
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen functional, so the next copy target is commented out for now.
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen -->
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <!--copy todir="${test.razor}/Razor-Simple/SimpleCProgram-BinaryRelease/.razor">
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <fileset dir="ext/SampleRazorRepository/Repository/OpenGrokSample/RAZOR_UNIVERSE/DOMAIN_01/Simple"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </copy-->
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </target>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <!-- clean up generated test repositories -->
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <target name="-delete-generated-repository-files">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <delete dir="${test.hg}/.hg"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <delete file="${test.hg}/.hgignore"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <delete dir="${test.git}/.git"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <delete dir="${test.svn}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <delete dir="${test.razor}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <delete file="${test.cvs.repo}/CVS/Root"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </target>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <target name="jdepend" depends="compile" description="Run JDepend dependency checking">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <mkdir dir="jdepend"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <java classname="jdepend.xmlui.JDepend" failonerror="true" fork="true">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <arg value="-file"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <arg value="jdepend/report.xml"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <arg value="${build.classes.dir}"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <classpath>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <pathelement location="${user.home}/.ant/lib/jdepend/lib/jdepend.jar"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <pathelement path="${java.class.path}"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </classpath>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </java>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <java classname="jdepend.textui.JDepend" failonerror="true" fork="true">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <arg value="-file"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <arg value="jdepend/report.txt"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <arg value="${build.classes.dir}"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <classpath>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <pathelement location="${user.home}/.ant/lib/jdepend/lib/jdepend.jar"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <pathelement path="${java.class.path}"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan </classpath>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </java>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </target>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <!-- Generate HTML test report -->
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <target depends="init" name="test-report">
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <junitreport todir="${build.test.results.dir}">
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <fileset dir="${build.test.results.dir}">
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <include name="TEST-*.xml"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen </fileset>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <report todir="${build.test.results.dir}"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen </junitreport>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen </target>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen
d3aa2b921c67d952f62c82503575ea545e274d69Knut Anders Hatlen <!-- Build our patched JRCS library. -->
d3aa2b921c67d952f62c82503575ea545e274d69Knut Anders Hatlen <target name="jrcs" depends="-pre-pre-compile">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <mkdir dir="${build.dir}/jrcs"/>
743ae7de6b1d215c8e97b9d19e4c673df4d51ff5Knut Anders Hatlen <javac srcdir="jrcs/src/main/java" destdir="${build.dir}/jrcs"
7db5dff294beecdc61e810b0b1e6ad0aaea218f7Lubos Kosco nowarn="on" source="${javac.source}" compiler="javac${javac.source}">
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <compilerarg value="-Xlint:deprecation"/> <!-- ,unchecked -->
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco </javac>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <jar destfile="${file.reference.jrcs.jar}">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="${build.dir}/jrcs" includes="**/*.class"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </jar>
d3aa2b921c67d952f62c82503575ea545e274d69Knut Anders Hatlen </target>
d3aa2b921c67d952f62c82503575ea545e274d69Knut Anders Hatlen
7e33e87b7d6c9a61ff11d23e37c02274b1223ce1Jens Elkner
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <!-- compile jsp - just to test -->
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property name="debug" value="on" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property name="jsdebug" value="off" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property name="compress" value=".gz" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property name="debuglevel" value="source,lines,vars" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property name="optimize" value="on" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property name="deprecation" value="on" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property name="listfiles" value="true" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <property name="codebase" value="org/opensolaris/opengrok"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property name="codebase.dot" value="org.opensolaris.opengrok"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <property name="web.src.dir" location="web" />
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <patternset id="libs">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="*.jar" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </patternset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path id="classpath.base">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="lib">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <patternset refid="libs" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </path>
7c9ef1dc8277e4664577a4db666ec72024645c32Trond Norbye <property name="AS_HOME" value="glassfish"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path id="classpath.j2ee">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="${AS_HOME}/modules">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="javaee.jar" />
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <!-- for the **/auth/* stuff, only -->
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="appserv-rt.jar" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="appserv-deployment-client.jar" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </path>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path id="classpath.jspc">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="${AS_HOME}/modules">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="javax.servlet.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="javax.servlet.jsp.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="jsp-impl.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="el-impl.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="javax.servlet.jsp.jstl.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="jstl-impl.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="jsf-api.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="jsf-impl.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="tools.jar"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </path>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path id="classpath.web">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path refid="classpath.j2ee"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path refid="classpath.base"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </path>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path id="classpath.jsp">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path refid="classpath.jspc"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <path refid="classpath.web"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </path>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="-jsp.check" depends="init">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <mkdir dir="${build.dir}/src/jsp/${codebase}/jsp" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <uptodate property="jsp.not.changed">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <srcfiles dir="${web.src.dir}" includes="**/*.jsp,**/*.jspf"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <mapper type="glob" from="*.jsp"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan to="${build.dir}/src/jsp/${codebase}/jsp/*_jsp.java"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </uptodate>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="-jsp.generate" depends="-jsp.check" unless="jsp.not.changed">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <taskdef name="jasper" classname="org.apache.jasper.JspC"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan classpathref="classpath.jsp" />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <mkdir dir="${build.dir}/src/web"/>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <copy todir="${build.dir}/src/web">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <fileset dir="${web.src.dir}">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="**/*.jsp"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="**/*.jspf"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <include name="**/index_body.html"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </fileset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </copy>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <jasper validateXml="false"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan outputdir="${build.dir}/src/jsp"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan javaencoding="UTF-8"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan uriroot="${build.dir}/src/web"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan package="${codebase.dot}.jsp"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan compilersourcevm="${javac.source}"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan compilertargetvm="${javac.target}"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan smapsuppressed="false"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan webxmlfragment="${build.dir}/src/servlets_web.xml"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan />
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}"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan overwrite="true">
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <filterset>
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan <filter token="generated servlet mappings"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan value=" generated start -->${wdd}&lt;!-- generated end " />
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </filterset>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </copy>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
7e33e87b7d6c9a61ff11d23e37c02274b1223ce1Jens Elkner
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <target name="compile.jsp" depends="compile,-jsp.generate"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan description="--> compile java source code and jsp pages"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan >
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye <javac srcdir="${build.dir}/src/jsp" destdir="${build.dir}/classes"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan includes="**/*.java"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan optimize="${optimize}" debug="${debug}" debuglevel="${debuglevel}"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan deprecation="${deprecation}" classpathref="classpath.jsp"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan encoding="UTF-8" listfiles="${listfiles}"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan includeantruntime="false">
4f2be58ed1e83875854cf4c7258af8079344d26aLubos Kosco <compilerarg value="-Xlint:deprecation,unchecked" compiler="javac${javac.source}"/>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </javac>
d4ce228a333ba2daa19ad8b0672a704c8e42a2dcTrond Norbye </target>
7e33e87b7d6c9a61ff11d23e37c02274b1223ce1Jens Elkner
60776cc3939a32a5de92eed6808b45e38bbaff57Trond Norbye <target name="all" depends="clean,jar,compile.jsp,test,javadoc,pmd,findbugs-xml,checkstyle" />
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye</project>