build.xml revision f754dd2bbc98a89a613ab4f76dad5534dc13e929
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
64b763950bf11e9357facbd2b5666631a895c085Trond NorbyeCopyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye-->
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye<project name="OpenGrok" default="jar" basedir=".">
cf1f7b5e81583dfca30972cfef322266a6928e7fKnut Anders Hatlen <description>Builds, tests, and runs the project opengrok.</description>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <property name="build.sysclasspath" value="ignore"/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <property file="${user.home}/config/ant/${ant.project.name}.properties" />
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <property file="${user.home}/config/ant/global.properties" />
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
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
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen nbproject/build-impl.xml file.
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen -->
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <property name="version" value="0.12-dev"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <property name="distname" value="opengrok"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <property name="src.dir" location="src"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco <property name="src.generatedsrc.dir" location="generatedsrc"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <property name="findbugs.home" value="${user.home}/.ant/lib/findbugs"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <property name="checkstyle.home" value="${user.home}/.ant/lib/checkstyle"/>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <property name="pmd.home" value="${user.home}/.ant/lib/pmd"/>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <property name="test.repositories" value="testdata/repositories"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <property name="test.sources" value="testdata/sources"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <property name="test.cvs" value="${test.repositories}/cvs_test"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco <property name="test.cvs.repo" value="${test.cvs}/cvsrepo"/>
0466de7c67573e1ce5e0733325c1e5383270f5d5Knut Anders Hatlen <property name="test.cvs.root" value="${test.cvs}/cvsroot"/>
0466de7c67573e1ce5e0733325c1e5383270f5d5Knut Anders Hatlen <property name="test.hg" value="${test.repositories}/mercurial"/>
0466de7c67573e1ce5e0733325c1e5383270f5d5Knut Anders Hatlen <property name="test.git" value="${test.repositories}/git"/>
0466de7c67573e1ce5e0733325c1e5383270f5d5Knut Anders Hatlen <property name="test.svn" value="${test.repositories}/svn"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco <property name="test.razor" value="${test.repositories}/razor"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco <available property="compileSystrayClient" classname="java.awt.TrayIcon"/>
1ed6b730409d4740e941142599767d5eac7e7d92Lubos Kosco
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <target name="-exclude-client" unless="compileSystrayClient">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <echo>JDK doesn't have java.awt.TrayIcon, excluding building of systray client ... </echo>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <property name="excludes" value="org/opensolaris/opengrok/management/client/**"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco </target>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <path id="lib.search.path">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement path="${user.home}/.ant/lib"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <pathelement path="${java.class.path}"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco <pathelement path="lib"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement path="/lib"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement location="lib/JFlex.jar"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </path>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <path id="findbugs.lib.search.path">
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco <pathelement path="${findbugs.home}/lib/"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <pathelement path="${java.class.path}"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <pathelement path="lib/findbugs/lib/"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </path>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco <path id="checkstyle.lib.search.path">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <pathelement path="${checkstyle.home}/"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <pathelement path="${java.class.path}"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </path>
1ed6b730409d4740e941142599767d5eac7e7d92Lubos Kosco
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <path id="pmd.lib.search.path">
1ed6b730409d4740e941142599767d5eac7e7d92Lubos Kosco <pathelement path="${pmd.home}/lib/"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <pathelement path="${java.class.path}"/>
1ed6b730409d4740e941142599767d5eac7e7d92Lubos Kosco <pathelement path="lib/pmd/lib/"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco </path>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <available file="JFlex.jar" type="file" property="JFlex.present">
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <filepath refid="lib.search.path"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco </available>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <fail unless="JFlex.present" message="Please download JFlex (http://jflex.de/) and put JFlex.jar it into /lib directory (or in ant classpath)."/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <target name="download-jflex" unless="JFlex.present">
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <get src="http://repo1.maven.org/maven2/de/jflex/jflex/1.4.3/jflex-1.4.3.jar"
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco dest="lib/JFlex.jar" verbose="true" usetimestamp="true"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco </target>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <taskdef classname="JFlex.anttask.JFlexTask" name="jflex" classpathref="lib.search.path" />
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <target name="jflex">
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <mkdir dir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainXref.lex" destdir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CXref.lex" destdir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CxxSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/c/CxxXref.lex" destdir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/fortran/FortranSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/fortran/FortranXref.lex" destdir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/java/JavaSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/java/JavaXref.lex" destdir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/javascript/JavaScriptSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/javascript/JavaScriptXref.lex" destdir="${src.generatedsrc.dir}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/python/PythonSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/python/PythonXref.lex" destdir="${src.generatedsrc.dir}"/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/perl/PerlSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/perl/PerlXref.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/php/PhpSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/php/PhpXref.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/lisp/LispSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/lisp/LispXref.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/tcl/TclSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/tcl/TclXref.lex" destdir="${src.generatedsrc.dir}"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainFullTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/PlainXref.lex" destdir="${src.generatedsrc.dir}"/>
3d35131df8607ae05b064219b9448afc5c4b550aKnut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/plain/XMLXref.lex" destdir="${src.generatedsrc.dir}"/>
3d35131df8607ae05b064219b9448afc5c4b550aKnut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sql/SQLXref.lex" destdir="${src.generatedsrc.dir}"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sql/PLSQLXref.lex" destdir="${src.generatedsrc.dir}"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/document/TroffXref.lex" destdir="${src.generatedsrc.dir}"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/document/TroffFullTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sh/ShSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/sh/ShXref.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/vb/VBSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/vb/VBXref.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/csharp/CSharpSymbolTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/analysis/csharp/CSharpXref.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/search/context/HistoryLineTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <jflex file="${src.dir}/org/opensolaris/opengrok/search/context/PlainLineTokenizer.lex" destdir="${src.generatedsrc.dir}"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen </target>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <property name="git" value="git"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <!-- Get the id of the changeset we're building from using a
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen Mercurial command.
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen -->
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <target name="-get-changeset-from-command"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen depends="-check-is-git-repo" if="build.from.repo">
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <exec executable="${git}"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen failifexecutionfails="no"
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen outputproperty="changeset">
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <arg value="rev-parse"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen <arg value="HEAD"/>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen </exec>
a5cc1506d5c0704805c6733a46c7f1f8f91ae724Knut Anders Hatlen </target>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye
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.
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye -->
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <target name="-check-is-git-repo">
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye <available property="build.from.repo" file=".git" type="dir"/>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye </target>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <!-- Get the id of the changeset we're building from by reading
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye .git_archival.txt file created by git archive. This will only
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye be used when we're not building from a checked out copy of
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco the repository, for example the source distribution.
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen -->
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <target name="-get-changeset-from-file"
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen depends="-check-is-git-repo" unless="build.from.repo">
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <tempfile property="git.archival.temp" deleteonexit="true"/>
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <copy file=".git_archival.txt" tofile="${git.archival.temp}"/>
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen <replaceregexp file="${git.archival.temp}" flags="s"
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen match=".*node: ([0-9a-f]{12}).*"
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen replace="\1"/>
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen <loadfile srcFile="${git.archival.temp}" property="changeset"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </target>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <target name="-update-build-info"
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen depends="-get-changeset-from-command,-get-changeset-from-file">
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <mkdir dir="${build.classes.dir}/org/opensolaris/opengrok"/>
5a0c5ad4116f5a4dd0dd5a0a4e6d02973cd5eef9Lubos Kosco <propertyfile
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen file="${build.classes.dir}/org/opensolaris/opengrok/info.properties">
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <entry key="version" value="${version}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <entry key="changeset" value="${changeset}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </propertyfile>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </target>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <property name="coverage.dir" value="${basedir}/coverage"/>
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen <target name="-pre-compile" depends="jrcs,download-jflex,jflex,download-lucene"/>
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen <target name="eclipse" depends="-pre-compile"
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen description="satisfy eclipse dependencies"/>
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen <target name="-post-clean">
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <delete dir="${src.generatedsrc.dir}"/>
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen <delete file="${manifest.file}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <delete dir="${coverage.dir}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <antcall target="-delete-generated-repository-files"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </target>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <target name="clean-lib" depends="init">
f53d230f3e516218f38a7f1f2866e42bb3e0290eKnut Anders Hatlen <delete file="${file.reference.lucene-core.jar}"/>
752fbd3cf33aada419c8258959ff5574d2d2047dTrond Norbye <delete file="${file.reference.lucene-analyzers-common.jar}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <delete file="${file.reference.lucene-queryparser.jar}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <delete file="${file.reference.lucene-suggest.jar}"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen </target>
7b046969a1b2565787df8ae3a8126359e8cd6fafTrond Norbye
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut 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
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen -->
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <target name="-touch-manifest">
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <!-- no attributes, main-class and class-path will be added later -->
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <manifest file="manifest.mf" mode="replace"/>
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen </target>
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen <target name="-pre-init" depends="-touch-manifest, -exclude-client"/>
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen
2dbc1835e0ae88ad102e2b9a85e5c7b5298b14b6Knut Anders Hatlen <!--
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen Initialize a property holding a list of jar files on which
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen opengrok.jar depends
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye -->
9cf297d9a579835e9336d587eaee187ca0954767Knut Anders Hatlen <target name="-post-init">
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco <pathconvert property="opengrok.lib.files" pathsep=" ">
2c2a50fade805afbf4a5a880a38648613d7e01aeLubos Kosco <path>
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye <pathelement path="${javac.classpath}"/>
20a0bde399487a651cdeb66fc8b44b2212036355Trond Norbye </path>
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye <flattenmapper/>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <map from="" to="lib/"/>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye </pathconvert>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <mkdir dir="${build.test.classes.dir}"/>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <mkdir dir="${build.dir}/src/jsp"/>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye </target>
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <!-- Update the manifest file with a classpath attribute -->
523201f786f6b12b7cf54091c6e5be167878cbeeTrond Norbye <target name="-update-manifest-classpath">
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye <manifest file="${manifest.file}" mode="update">
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen <attribute name="Class-Path"
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen value="${opengrok.lib.files} lib/derbyclient.jar lib/derby.jar"/>
e4d314d81209a23aae928ed62128ad9128c115bdLubos Kosco </manifest>
c67bbf00f725074786ac47867d2276e7b935b570Trond Norbye </target>
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen
e4d314d81209a23aae928ed62128ad9128c115bdLubos Kosco <target name="-pre-jar" depends="-update-manifest-classpath,-update-build-info"/>
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen <!--
0a0811923cbbd2976425db6f4c78eed811c2825bKnut Anders Hatlen Copy the jars from lib to dist/lib manually if we don't have
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen the copylibs task from NetBeans
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen -->
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <target name="-copy-lib-without-netbeans"
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen unless="manifest.available+main.class+mkdist.available">
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco <copy todir="${dist.dir}/lib">
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <fileset file="${file.reference.ant.jar}"/>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen </copy>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <copy todir="${dist.dir}">
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco <fileset dir="." includes="${opengrok.lib.files}"/>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco </copy>
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco </target>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <path id="plainlib.search.path">
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco <pathelement path="lib"/>
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco <pathelement path="/lib"/>
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco </path>
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <target name="-check-lucene" description="Check that lucene jar files are present">
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco <available file="${lucene-core.jar}" type="file" property="lucene-core.jar.present">
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <filepath refid="plainlib.search.path"/>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen </available>
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco <available file="${lucene-analyzers-common.jar}" type="file" property="lucene-analyzers-common.jar.present">
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <filepath refid="plainlib.search.path"/>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen </available>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <available file="${lucene-queryparser.jar}" type="file" property="lucene-queryparser.jar.present">
dce551c28e0e9e0a652e512c1094caef574916ceKnut Anders Hatlen <filepath refid="plainlib.search.path"/>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen </available>
a7f25b0d188e4ea80ddcabf3ac52ade1bdb4ebecLubos Kosco <available file="${lucene-suggest.jar}" type="file" property="lucene-suggest.jar.present">
a7f25b0d188e4ea80ddcabf3ac52ade1bdb4ebecLubos Kosco <filepath refid="plainlib.search.path"/>
a7f25b0d188e4ea80ddcabf3ac52ade1bdb4ebecLubos Kosco </available>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <condition property="lucene_not_downloaded">
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <not>
a07b2874263e3c5f0cd2e83441719415d53059c2Knut Anders Hatlen <and>
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen <isset property="lucene-core.jar.present"/>
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen <isset property="lucene-analyzers-common.jar.present"/>
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen <isset property="lucene-queryparser.jar.present"/>
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen <isset property="lucene-suggest.jar.present"/>
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen </and>
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen </not>
a7f25b0d188e4ea80ddcabf3ac52ade1bdb4ebecLubos Kosco </condition>
a7f25b0d188e4ea80ddcabf3ac52ade1bdb4ebecLubos Kosco </target>
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen <target name="download-lucene" depends="-check-lucene" if="lucene_not_downloaded">
edcb01bf549171673fd0bb4239f2edfc7a810397Knut Anders Hatlen <get src="http://repo1.maven.org/maven2/org/apache/lucene/lucene-core/${lucene.version}/${lucene-core.jar}"
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik dest="lib/${lucene-core.jar}" verbose="true" usetimestamp="true"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <get src="http://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common/${lucene.version}/${lucene-analyzers-common.jar}"
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik dest="lib/${lucene-analyzers-common.jar}" verbose="true" usetimestamp="true"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <get src="http://repo1.maven.org/maven2/org/apache/lucene/lucene-queryparser/${lucene.version}/${lucene-queryparser.jar}"
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik dest="lib/${lucene-queryparser.jar}" verbose="true" usetimestamp="true"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <get src="http://repo1.maven.org/maven2/org/apache/lucene/lucene-suggest/${lucene.version}/${lucene-suggest.jar}"
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik dest="lib/${lucene-suggest.jar}" verbose="true" usetimestamp="true"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </target>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <target name="-post-jar" depends="-copy-lib-without-netbeans">
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <war destfile="${dist.war}" webxml="web/WEB-INF/web.xml">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <fileset dir="web" excludes="META-INF/context.xml"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <lib dir="${dist.dir}" includes="opengrok.jar"/>
52cf1d63b1f1b231ff1e86eca2058d88560579b5Lubos Kosco <lib dir="${dist.dir}/lib" includes="*.jar" excludes="servlet-api.jar"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </war>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <echo message="Generating man page.."/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <java classname="org.opensolaris.opengrok.index.CommandLineOptions"
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik output="${dist.dir}/opengrok.1" failonerror="true" fork="true">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <classpath>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <pathelement location="dist/opengrok.jar"/>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <pathelement path="${java.class.path}"/>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik </classpath>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik </java>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik </target>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <target name="package" depends="jar">
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <exec os="SunOS" executable="/usr/bin/pkgmk" failonerror="true">
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <arg line="-o -d build -r . -v ${version} -f platform/solaris/pkgdef/prototype"/>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik </exec>
85e0595857351c6e22f75b8928967d14cb679ac5Jorgen Austvik <exec os="SunOS" executable="/usr/bin/pkgtrans" failonerror="true">
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <arg line="-s build /dist/OSOLopengrok-${version}.pkg OSOLopengrok"/>
52cf1d63b1f1b231ff1e86eca2058d88560579b5Lubos Kosco </exec>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </target>
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <target name="dist" depends="jar">
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <tar destfile="${dist.dir}/${distname}-${version}.tar.gz"
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye compression="gzip">
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <tarfileset dir="." prefix="${distname}-${version}/doc">
c7eb123c8b2081a261deff3c401fbf92ddba1b58Jorgen Austvik <include name="README.txt"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <include name="CHANGES.txt"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <include name="LICENSE.txt"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <include name="NOTICE.txt"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <include name="paths.tsv"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <include name="logging.properties"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </tarfileset>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <tarfileset dir="." prefix="${distname}-${version}/bin" mode="755">
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <include name="OpenGrok"/>
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye </tarfileset>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <tarfileset dir="doc" prefix="${distname}-${version}/doc">
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <include name="EXAMPLE.txt"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </tarfileset>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <tarfileset dir="${dist.dir}" prefix="${distname}-${version}/lib">
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <include name="opengrok.jar"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <include name="source.war"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <include name="lib/*"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <exclude name="lib/servlet-api.jar"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </tarfileset>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <tarfileset dir="${dist.dir}" prefix="${distname}-${version}/man/man1">
45cf976b01987ad147e9edb54ffab0938dd6c016Trond Norbye <include name="opengrok.1"/>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </tarfileset>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </tar>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik </target>
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik
49f592091468eac515dde6139fbc8efa26056b0aJorgen Austvik <target name="dist-src" depends="init">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <mkdir dir="${dist.dir}"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <exec executable="hg">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <arg value="archive"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <arg value="-t"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <arg value="tgz"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik<!-- <arg value="-p"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <arg value="${distname}-${version}-src"/> -->
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <arg value="${dist.dir}/${distname}-${version}-src.tar.gz"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </exec>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </target>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <target name="-check_findbugs" description="Check that findbugs jar files are present">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <available file="findbugs.jar" type="file" property="findbugs.jar.present">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <filepath refid="findbugs.lib.search.path"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </available>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen 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"/>
1e13442ac5687540ace78411d98155fca4b3791eKnut Anders Hatlen
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <available file="findbugs-ant.jar" type="file" property="findbugs-ant.jar.present">
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik <filepath refid="findbugs.lib.search.path"/>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik </available>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen 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"/>
2ef63dc9adc693ddad2206d323b0a85a1afe70ecJorgen Austvik </target>
945f4c3c36a15447913781dfb1894b34f2941c57Jorgen Austvik
1f17ba9e3c026d75f488227451416bd72a222afeTrond Norbye <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" >
f09d46eefeb5e4db6dc11e02e417b448fa9362a9Jorgen Austvik <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen 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"/>
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">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <auxClasspath>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <fileset dir="${dist.dir}/lib/">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <include name="*.jar"/>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </fileset>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik </auxClasspath>
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <sourcePath path="${src.dir}"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <sourcePath path="${src.generatedsrc.dir}"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <class location="${dist.dir}/opengrok.jar" />
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik </findbugs>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik </target>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <target name="findbugs-xml" depends="jar, -check_findbugs" description="Runs Findbugs on the OpenGrok source code and generate XML output">
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <path id="findbugs.lib" >
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <pathelement location="${findbugs.home}/lib/findbugs.jar"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <pathelement location="${findbugs.home}/lib/findbugs-ant.jar"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik </path>
63e0f31920b0818d6f471a066c12da991fb35346Trond Norbye <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen 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">
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <auxClasspath>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <fileset dir="${dist.dir}/lib/">
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <include name="*.jar"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik </fileset>
ede8ae04a015c7d2ae4916e5bb36813b81cb7c30Jorgen Austvik </auxClasspath>
49180e08afc7cf03413ab108bc71c14e9de1a880Jorgen Austvik <sourcePath path="${src.dir}"/>
ede8ae04a015c7d2ae4916e5bb36813b81cb7c30Jorgen Austvik <sourcePath path="${src.generatedsrc.dir}"/>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <class location="${dist.dir}/opengrok.jar" />
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </findbugs>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik </target>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik
2f93a8465131cf5f18613f02f25a3663575bfe57Lubos Kosco <target name="-check_checkstyle" description="Check that checkstyle jar files are present">
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <available file="checkstyle-all.jar" type="file" property="checkstyle.jar.present">
629f5f1dc42d96d37676b093b89f011f143dad0aJorgen Austvik <filepath refid="checkstyle.lib.search.path"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik </available>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <fail unless="checkstyle.jar.present" message="Please install checkstyle-all.jar in lib-directory (or in ant classpath) to run Checkstyle, see README."/>
629f5f1dc42d96d37676b093b89f011f143dad0aJorgen Austvik </target>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik
629f5f1dc42d96d37676b093b89f011f143dad0aJorgen Austvik <target name="checkstyle" depends="compile, -check_checkstyle" description="Run checkstyle on OpenGrok source code">
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye <taskdef resource="checkstyletask.properties" classpath="${checkstyle.home}/checkstyle-all.jar"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <checkstyle config="checkstyle/style.xml" failOnViolation="false">
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye <fileset dir="src" includes="**/*.java"/>
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye <fileset dir="test" includes="**/*.java"/>
629f5f1dc42d96d37676b093b89f011f143dad0aJorgen Austvik <formatter type="plain"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <formatter type="plain" toFile="checkstyle/checkstyle_errors.txt"/>
629f5f1dc42d96d37676b093b89f011f143dad0aJorgen Austvik <formatter type="xml" toFile="checkstyle/checkstyle_errors.xml"/>
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye </checkstyle>
d5734522e5d6f8e329d005a0f93f8c2f30df9516Trond Norbye </target>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <target name="-check_pmd" description="Check that pmd jar files are present">
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <available file="pmd.jar" type="file" property="pmd.jar.present">
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <filepath refid="pmd.lib.search.path"/>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen </available>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <fail unless="pmd.jar.present" message="Please install pmd.jar in lib-directory (or in ant classpath) to run PMD, see README."/>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen </target>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <target name="pmd" depends="compile, -check_pmd" description="Run PMD on OpenGrok source code">
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <path id="pmd.lib" >
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <pathelement location="${pmd.home}/lib/pmd.jar"/>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <pathelement location="${pmd.home}/lib/jaxen.jar"/>
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen <pathelement location="${pmd.home}/lib/asm.jar"/>
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen </path>
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.lib"/>
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen <mkdir dir="pmd"/>
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen <pmd failuresPropertyName="pmd.num.warnings" rulesetfiles="tools/pmd_ruleset.xml">
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen <sourcelanguage name="java" version="1.7" />
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen <formatter type="html" toFile="pmd/pmd_report.html"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <formatter type="xml" toFile="pmd/pmd_report.xml"/>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <fileset dir="src" includes="**/*.java"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik<!-- <fileset dir="test" includes="**/*.java"/> -->
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen<!-- <fileset dir="web" includes="**/*.jsp"/>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <fileset dir="web" includes="**/*.jspf"/> -->
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen </pmd>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <echo message="PMD finished, found ${pmd.num.warnings} warnings, see pmd/pmd_report.html"/>
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik </target>
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen <target name="cpd-xml" depends="compile, -check_pmd" description="Run CPD on OpenGrok source code, print output in xml">
780cc7d1b57609ff15fb283201e93cb501ebe9e6Jorgen Austvik <path id="pmd.lib" >
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen <pathelement location="${pmd.home}/lib/pmd.jar"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <pathelement location="${pmd.home}/lib/jaxen.jar"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik </path>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" classpathref="pmd.lib"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <cpd minimumTokenCount="100" format="xml" outputFile="pmd/cpd_report.xml">
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <fileset dir="src">
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <include name="**/*.java"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </fileset>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <fileset dir="test">
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <include name="**/*.java"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </fileset>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </cpd>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </target>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <target name="cpd" depends="compile, -check_pmd" description="Run CPD on OpenGrok source code">
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <path id="pmd.lib" >
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <pathelement location="${pmd.home}/lib/pmd.jar"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <pathelement location="${pmd.home}/lib/jaxen.jar"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </path>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" classpathref="pmd.lib"/>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <cpd minimumTokenCount="100" outputFile="pmd/cpd_report.txt">
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <fileset dir="src">
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <include name="**/*.java"/>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen </fileset>
d3d2404f9a49bf70b124053feabe666f85ef5361Knut Anders Hatlen <fileset dir="test">
b8cabd0296e9adcd3cd5db090d292ad75d36fbf8Knut Anders Hatlen <include name="**/*.java"/>
b8cabd0296e9adcd3cd5db090d292ad75d36fbf8Knut Anders Hatlen </fileset>
b8cabd0296e9adcd3cd5db090d292ad75d36fbf8Knut Anders Hatlen </cpd>
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen </target>
cfb127cc9c800f5e29f3103b9d2b2415e22e3babKnut Anders Hatlen
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <target name="-check_emma" description="Check that emma jar files are present">
7b9f9a1761f76744fc3772181877d5e301f122adKnut Anders Hatlen <available file="emma.jar" type="file" property="emma.jar.present">
7ecd52b03dc1f0b03ff8f522b4891c8531896c3dJorgen Austvik <filepath refid="lib.search.path"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik </available>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <fail unless="emma.jar.present" message="Please install emma.jar in lib-directory (or in ant classpath) to run Emma, see README."/>
4c0668d038ecec0f5f4f4cc3d7a177d8e118c955Knut Anders Hatlen
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <available file="emma_ant.jar" type="file" property="emma_ant.jar.present">
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <filepath refid="lib.search.path"/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik </available>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <fail unless="emma_ant.jar.present" message="Please install emma_ant.jar in lib-directory (or in ant classpath) to run Emma, see README."/>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik </target>
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <target name="emma-instrument" depends="compile, -check_emma" description="Instruments the source code for Emma code coverage analysis">
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <path id="emma.lib" >
2e3c025fdd5908a27cc82eb1d5346368a8be4e0dJorgen Austvik <pathelement location="lib/emma.jar"/>
4b08e2231abb7a3b44ab9255eca7963e6309aba4Jorgen Austvik <pathelement location="lib/emma_ant.jar"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </path>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <mkdir dir="${coverage.dir}" />
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <emma enabled="true">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <instr instrpath="build/classes"
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik metadatafile="${coverage.dir}/coverage.em"
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik mode="overwrite"
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik filter="+org.opensolaris.*,-org.opensolaris.opengrok.management.client.*"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </emma>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </target>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <target name="-pre-compile-test">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <property name="test-sys-prop.emma.coverage.out.file" value="${coverage.dir}/coverage.ec"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <property name="test-sys-prop.emma.coverage.out.merge" value="true"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </target>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <target name="-post-compile-test">
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <antcall target="-create-svn-repository"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <antcall target="-create-razor-repository"/>
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <!-- Change root in CVS test repository -->
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <!-- Strange indentation in line two levels below to get newline correctly -->
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik <concat destfile="${test.cvs.repo}/CVS/Root" append="no" force="yes" eol="unix">${basedir}/${test.cvs.root}/
92ed85d851c9108d821e93d3aacc9faf3588e17eJorgen Austvik </concat>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <!-- Generate ZIP files used for unit testing git/.git are renamed -->
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <copy todir="${test.git}/.git">
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <fileset dir="${test.git}/git"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen </copy>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <!-- Generate ZIP files used for unit testing mercurial/.hg and mercurial/.hgignore are renamed -->
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <copy todir="${test.hg}/.hg">
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <fileset dir="${test.hg}/hg"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen </copy>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen <copy file="${test.hg}/hgignore" tofile="${test.hg}/.hgignore"/>
8a667c39dc64db336c7bd14db6bde1e38fb5c117Knut Anders Hatlen
64b763950bf11e9357facbd2b5666631a895c085Trond Norbye <zip destfile="${build.test.classes.dir}/org/opensolaris/opengrok/index/source.zip"
basedir="${test.sources}"
update="false"
defaultexcludes="no"/>
<zip destfile="${build.test.classes.dir}/org/opensolaris/opengrok/history/repositories.zip"
basedir="${test.repositories}"
excludes="mercurial/hg/**, mercurial/hgignore, git/git/**"
update="false"
defaultexcludes="no"/>
<antcall target="-delete-generated-repository-files"/>
</target>
<target name="-create-svn-repository">
<delete dir="${test.svn}"/>
<delete dir="${build.test.reposroots}/svn"/>
<mkdir dir="${build.test.reposroots}"/>
<exec executable="svnadmin" failifexecutionfails="true">
<arg value="create"/>
<arg value="${build.test.reposroots}/svn"/>
</exec>
<!-- need absolute path for svn url -->
<pathconvert property="test.svn.url">
<map from="" to="file://"/>
<path location="${build.test.reposroots}/svn"/>
</pathconvert>
<exec executable="svn" failifexecutionfails="false">
<arg value="import"/>
<arg value="${test.sources}"/>
<arg value="${test.svn.url}"/>
<arg value="-m"/>
<arg value="Initial import"/>
</exec>
<exec executable="svn" failifexecutionfails="false">
<arg value="checkout"/>
<arg value="${test.svn.url}"/>
<arg value="${test.svn}"/>
</exec>
</target>
<target name="-create-razor-repository">
<delete dir="${test.razor}"/>
<copy todir="${test.razor}/Razor-Simple">
<fileset dir="ext/SampleRazorRepository/UserSandbox"/>
</copy>
<copy todir="${test.razor}/Razor-Simple/SimpleCProgram/.razor">
<fileset dir="ext/SampleRazorRepository/Repository/OpenGrokSample/RAZOR_UNIVERSE/DOMAIN_01/Simple"/>
</copy>
<!--
The support for binaries in Razor repositories is not fully
functional, so the next copy target is commented out for now.
-->
<!--copy todir="${test.razor}/Razor-Simple/SimpleCProgram-BinaryRelease/.razor">
<fileset dir="ext/SampleRazorRepository/Repository/OpenGrokSample/RAZOR_UNIVERSE/DOMAIN_01/Simple"/>
</copy-->
</target>
<!-- clean up generated test repositories -->
<target name="-delete-generated-repository-files">
<delete dir="${test.hg}/.hg"/>
<delete file="${test.hg}/.hgignore"/>
<delete dir="${test.git}/.git"/>
<delete dir="${test.svn}"/>
<delete dir="${test.razor}"/>
<delete file="${test.cvs.repo}/CVS/Root"/>
</target>
<target name="emma-report" description="Analyze" depends="-check_emma">
<taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
<emma enabled="true" >
<report sourcepath="${src.dir},${src.generatedsrc.dir}">
<!-- collect all EMMA data dumps (metadata and runtime): -->
<infileset dir="${coverage.dir}" includes="*.em, *.ec"/>
<txt outfile="${coverage.dir}/coverage.txt"/>
<xml outfile="${coverage.dir}/coverage.xml"/>
<html outfile="${coverage.dir}/index.html"/>
</report>
</emma>
</target>
<target name="code-coverage" depends="clean, emma-instrument, test, emma-report" description="Make test code coverage reports based on the OpenGrok unit tests"/>
<target name="jdepend" depends="compile" description="Run JDepend dependency checking">
<mkdir dir="jdepend"/>
<java classname="jdepend.xmlui.JDepend" failonerror="true" fork="true">
<arg value="-file"/>
<arg value="jdepend/report.xml"/>
<arg value="${build.classes.dir}"/>
<classpath>
<pathelement location="${user.home}/.ant/lib/jdepend/lib/jdepend.jar"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
<java classname="jdepend.textui.JDepend" failonerror="true" fork="true">
<arg value="-file"/>
<arg value="jdepend/report.txt"/>
<arg value="${build.classes.dir}"/>
<classpath>
<pathelement location="${user.home}/.ant/lib/jdepend/lib/jdepend.jar"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
</target>
<!-- Generate HTML test report -->
<target depends="init" name="test-report">
<junitreport todir="${build.test.results.dir}">
<fileset dir="${build.test.results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report todir="${build.test.results.dir}"/>
</junitreport>
</target>
<!-- Build our patched JRCS library. -->
<target name="jrcs" depends="-pre-pre-compile">
<mkdir dir="${build.dir}/jrcs"/>
<javac srcdir="jrcs/src" destdir="${build.dir}/jrcs"
nowarn="on" source="1.4"/>
<jar destfile="${file.reference.jrcs.jar}">
<fileset dir="${build.dir}/jrcs" includes="**/*.class"/>
</jar>
</target>
<!-- compile jsp - just to test -->
<property name="debug" value="on" />
<property name="jsdebug" value="off" />
<property name="compress" value=".gz" />
<property name="debuglevel" value="source,lines,vars" />
<property name="optimize" value="on" />
<property name="deprecation" value="on" />
<property name="listfiles" value="true" />
<property name="codebase" value="org/opensolaris/opengrok"/>
<property name="codebase.dot" value="org.opensolaris.opengrok"/>
<property name="web.src.dir" location="web" />
<patternset id="libs">
<include name="*.jar" />
</patternset>
<path id="classpath.base">
<fileset dir="lib">
<patternset refid="libs" />
</fileset>
</path>
<property name="AS_HOME" value="glassfish"/>
<path id="classpath.j2ee">
<fileset dir="${AS_HOME}/modules">
<include name="javaee.jar" />
<!-- for the **/auth/* stuff, only -->
<include name="appserv-rt.jar" />
<include name="appserv-deployment-client.jar" />
</fileset>
</path>
<path id="classpath.jspc">
<fileset dir="${AS_HOME}/modules">
<include name="javax.servlet.jar"/>
<include name="javax.servlet.jsp.jar"/>
<include name="jsp-impl.jar"/>
<include name="el-impl.jar"/>
<include name="javax.servlet.jsp.jstl.jar"/>
<include name="jstl-impl.jar"/>
<include name="jsf-api.jar"/>
<include name="jsf-impl.jar"/>
<include name="tools.jar"/>
</fileset>
</path>
<path id="classpath.web">
<path refid="classpath.j2ee"/>
<path refid="classpath.base"/>
</path>
<path id="classpath.jsp">
<path refid="classpath.jspc"/>
<path refid="classpath.web"/>
</path>
<target name="-jsp.check" depends="init">
<mkdir dir="${build.dir}/src/jsp/${codebase}/jsp" />
<uptodate property="jsp.not.changed">
<srcfiles dir="${web.src.dir}" includes="**/*.jsp,**/*.jspf"/>
<mapper type="glob" from="*.jsp"
to="${build.dir}/src/jsp/${codebase}/jsp/*_jsp.java"/>
</uptodate>
</target>
<target name="-jsp.generate" depends="-jsp.check" unless="jsp.not.changed">
<taskdef name="jasper" classname="org.apache.jasper.JspC"
classpathref="classpath.jsp" />
<mkdir dir="${build.dir}/src/web"/>
<copy todir="${build.dir}/src/web">
<fileset dir="${web.src.dir}">
<include name="**/*.jsp"/>
<include name="**/*.jspf"/>
<include name="**/index_body.html"/>
</fileset>
</copy>
<jasper validateXml="false"
outputdir="${build.dir}/src/jsp"
javaencoding="UTF-8"
uriroot="${build.dir}/src/web"
package="${codebase.dot}.jsp"
compilersourcevm="1.7"
compilertargetvm="1.7"
smapsuppressed="false"
webxmlfragment="${build.dir}/src/servlets_web.xml"
/>
<loadfile property="wdd" srcfile="${build.dir}/src/servlets_web.xml"/>
<copy file="${web.src.dir}/WEB-INF/web.xml" todir="${build.dir}"
overwrite="true">
<filterset>
<filter token="generated servlet mappings"
value=" generated start -->${wdd}&lt;!-- generated end " />
</filterset>
</copy>
</target>
<target name="compile.jsp" depends="compile,-jsp.generate"
description="--> compile java source code and jsp pages"
>
<javac srcdir="${build.dir}/src/jsp" destdir="${build.dir}/classes"
includes="**/*.java"
optimize="${optimize}" debug="${debug}" debuglevel="${debuglevel}"
deprecation="${deprecation}" classpathref="classpath.jsp"
encoding="UTF-8" listfiles="${listfiles}"
includeantruntime="false">
<compilerarg value="-Xlint:unchecked" compiler="javac1.7"/>
</javac>
</target>
<target name="all" depends="clean,jar,compile.jsp,test,javadoc,pmd,findbugs-xml,checkstyle" />
</project>