comparison build.xml @ 187:b8534ac8ac67

Added cleanup and rebuild target; option to include debug information
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 14 Apr 2011 01:11:40 +0200
parents 7653bdf82cf0
children 883f1efbcf27
comparison
equal deleted inserted replaced
186:44a34baabea0 187:b8534ac8ac67
19 <description> 19 <description>
20 Build, test and showcase hg4j 20 Build, test and showcase hg4j
21 Targets: 21 Targets:
22 * build - compile and jar binary and source bundles 22 * build - compile and jar binary and source bundles
23 * tests - run tests with JUnit 23 * tests - run tests with JUnit
24 * samples - few command-line counterparts to demonstrate basic capabiliites 24 * samples - few command-line counterparts to demonstrate basic capabiliites
25 * rebuild - clean build
25 </description> 26 </description>
26 27
27 <property name="junit.jar" value="lib/junit-4.8.2.jar" /> 28 <property name="junit.jar" value="lib/junit-4.8.2.jar" />
28 <property name="ver.qualifier" value="" /> 29 <property name="ver.qualifier" value="" />
29 <property name="version.lib" value="0.1.0" /> 30 <property name="version.lib" value="0.1.0" />
30 <property name="version.jar" value="${version.lib}${ver.qualifier}" /> 31 <property name="version.jar" value="${version.lib}${ver.qualifier}" />
32 <property name="compile-with-debug" value="yes"/>
31 33
32 <property name="hg4j.jar" value="hg4j_${version.jar}.jar" /> 34 <property name="hg4j.jar" value="hg4j_${version.jar}.jar" />
33 <property name="hg4j-tests.jar" value="hg4j-tests_${version.jar}.jar" /> 35 <property name="hg4j-tests.jar" value="hg4j-tests_${version.jar}.jar" />
34 <property name="hg4j-console.jar" value="hg4j-console_${version.jar}.jar" /> 36 <property name="hg4j-console.jar" value="hg4j-console_${version.jar}.jar" />
35 <property name="hg4j-src.jar" value="hg4j-src_${version.jar}.jar" /> 37 <property name="hg4j-src.jar" value="hg4j-src_${version.jar}.jar" />
38
36 39
37 <target name="samples" depends="build-cmdline" description="Run sample command-line tools"> 40 <target name="samples" depends="build-cmdline" description="Run sample command-line tools">
38 <path id="path.cmdline" path="${hg4j.jar};${hg4j-console.jar}" /> 41 <path id="path.cmdline" path="${hg4j.jar};${hg4j-console.jar}" />
39 42
40 <echo message="History of a specific file(s)" /> 43 <echo message="History of a specific file(s)" />
92 <fileset dir="test/" includes="org/tmatesoft/hg/**" /> 95 <fileset dir="test/" includes="org/tmatesoft/hg/**" />
93 <fileset dir="cmdline/" includes="org/tmatesoft/hg/**" /> 96 <fileset dir="cmdline/" includes="org/tmatesoft/hg/**" />
94 <fileset file="COPYING"/> 97 <fileset file="COPYING"/>
95 </jar> 98 </jar>
96 </target> 99 </target>
100
101 <target name="rebuild" depends="cleanup, build" description="Clean and build again"/>
102
103 <target name="cleanup">
104 <delete dir="bin/" description="Compiled classes"/>
105 <delete description="Jars">
106 <fileset dir="." includes="${hg4j-console.jar}, ${hg4j-src.jar}, ${hg4j-tests.jar}, ${hg4j.jar}"/>
107 </delete>
108 <delete description="Tests artifacts">
109 <fileset dir="." includes="TEST-*.xml"/>
110 </delete>
111 </target>
97 112
98 <target name="build-lib"> 113 <target name="build-lib">
99 <mkdir dir="bin" /> 114 <mkdir dir="bin" />
100 <javac srcdir="src" destdir="bin" /> 115 <javac srcdir="src" destdir="bin" debug="${compile-with-debug}" />
101 <jar destfile="${hg4j.jar}"> 116 <jar destfile="${hg4j.jar}">
102 <fileset dir="bin/"> 117 <fileset dir="bin/">
103 <include name="org/tmatesoft/hg/core/**" /> 118 <include name="org/tmatesoft/hg/core/**" />
104 <include name="org/tmatesoft/hg/util/**" /> 119 <include name="org/tmatesoft/hg/util/**" />
105 <include name="org/tmatesoft/hg/repo/**" /> 120 <include name="org/tmatesoft/hg/repo/**" />
109 </jar> 124 </jar>
110 </target> 125 </target>
111 126
112 <target name="build-tests" depends="build-lib"> 127 <target name="build-tests" depends="build-lib">
113 <mkdir dir="bin" /> 128 <mkdir dir="bin" />
114 <javac srcdir="test" destdir="bin"> 129 <javac srcdir="test" destdir="bin" debug="${compile-with-debug}" >
115 <classpath> 130 <classpath>
116 <pathelement location="${hg4j.jar}"/> 131 <pathelement location="${hg4j.jar}"/>
117 <pathelement location="${junit.jar}"/> 132 <pathelement location="${junit.jar}"/>
118 </classpath> 133 </classpath>
119 </javac> 134 </javac>
123 </jar> 138 </jar>
124 </target> 139 </target>
125 140
126 <target name="build-cmdline" depends="build-lib"> 141 <target name="build-cmdline" depends="build-lib">
127 <mkdir dir="bin" /> 142 <mkdir dir="bin" />
128 <javac srcdir="cmdline" destdir="bin"/> 143 <javac srcdir="cmdline" destdir="bin" debug="${compile-with-debug}" />
129 <jar destfile="${hg4j-console.jar}"> 144 <jar destfile="${hg4j-console.jar}">
130 <fileset dir="bin/" includes="org/tmatesoft/hg/console/**"/> 145 <fileset dir="bin/" includes="org/tmatesoft/hg/console/**"/>
131 <fileset file="COPYING"/> 146 <fileset file="COPYING"/>
132 </jar> 147 </jar>
133 </target> 148 </target>