comparison build.xml @ 165:b45e612ea750

Build jar with sources along with main jars
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 10 Mar 2011 19:24:33 +0100
parents d5268ca7715b
children 1d0654be1466
comparison
equal deleted inserted replaced
164:d51f1c6aaa28 165:b45e612ea750
15 the terms of a license other than GNU General Public License 15 the terms of a license other than GNU General Public License
16 contact TMate Software at support@hg4j.com 16 contact TMate Software at support@hg4j.com
17 --> 17 -->
18 <project name="hg4j" default="samples"> 18 <project name="hg4j" default="samples">
19 <description> 19 <description>
20 Build, test and showcase hg4j 20 Build, test and showcase hg4j
21 Targets:
22 * build - compile and jar binary and source bundles
23 * tests - run tests with JUnit
24 * samples - few command-line counterparts to demonstrate basic capabiliites
21 </description> 25 </description>
22 26
23 <property name="junit.jar" value="lib/junit-4.8.2.jar" /> 27 <property name="junit.jar" value="lib/junit-4.8.2.jar" />
24 <property name="ver.qualifier" value=".rc1" /> 28 <property name="ver.qualifier" value=".rc1" />
25 <property name="version.lib" value="0.0.9" /> 29 <property name="version.lib" value="0.0.9" />
26 <property name="version.jar" value="${version.lib}${ver.qualifier}" /> 30 <property name="version.jar" value="${version.lib}${ver.qualifier}" />
27 31
28 <property name="hg4j.jar" value="hg4j_${version.jar}.jar" /> 32 <property name="hg4j.jar" value="hg4j_${version.jar}.jar" />
29 <property name="hg4j-tests.jar" value="hg4j-tests_${version.jar}.jar" /> 33 <property name="hg4j-tests.jar" value="hg4j-tests_${version.jar}.jar" />
30 <property name="hg4j-console.jar" value="hg4j-console_${version.jar}.jar" /> 34 <property name="hg4j-console.jar" value="hg4j-console_${version.jar}.jar" />
35 <property name="hg4j-src.jar" value="hg4j-src_${version.jar}.jar" />
31 36
32 <target name="samples" depends="build-cmdline"> 37 <target name="samples" depends="build-cmdline">
33 <path id="path.cmdline" path="${hg4j.jar};${hg4j-console.jar}" /> 38 <path id="path.cmdline" path="${hg4j.jar};${hg4j-console.jar}" />
34 39
35 <echo message="History of a specific file(s)" /> 40 <echo message="History of a specific file(s)" />
78 <test name="org.tmatesoft.hg.test.TestStorePath" /> 83 <test name="org.tmatesoft.hg.test.TestStorePath" />
79 <test name="org.tmatesoft.hg.test.TestByteChannel" /> 84 <test name="org.tmatesoft.hg.test.TestByteChannel" />
80 </junit> 85 </junit>
81 </target> 86 </target>
82 87
83 <target name="build"> 88 <!-- -->
89 <target name="build" depends="build-lib, build-cmdline, build-tests">
90 <jar destfile="${hg4j-src.jar}">
91 <fileset dir="src/" includes="org/tmatesoft/hg/**" />
92 <fileset dir="test/" includes="org/tmatesoft/hg/**" />
93 <fileset dir="cmdline/" includes="org/tmatesoft/hg/**" />
94 <fileset file="COPYING"/>
95 </jar>
96 </target>
97
98 <target name="build-lib">
84 <mkdir dir="bin" /> 99 <mkdir dir="bin" />
85 <javac srcdir="src" destdir="bin" /> 100 <javac srcdir="src" destdir="bin" />
86 <jar destfile="${hg4j.jar}"> 101 <jar destfile="${hg4j.jar}">
87 <fileset dir="bin/"> 102 <fileset dir="bin/">
88 <include name="org/tmatesoft/hg/core/**" /> 103 <include name="org/tmatesoft/hg/core/**" />
92 </fileset> 107 </fileset>
93 <fileset file="COPYING"/> 108 <fileset file="COPYING"/>
94 </jar> 109 </jar>
95 </target> 110 </target>
96 111
97 <target name="build-tests" depends="build"> 112 <target name="build-tests" depends="build-lib">
98 <mkdir dir="bin" /> 113 <mkdir dir="bin" />
99 <javac srcdir="test" destdir="bin" /> 114 <javac srcdir="test" destdir="bin" />
100 <jar destfile="${hg4j-tests.jar}"> 115 <jar destfile="${hg4j-tests.jar}">
101 <fileset dir="bin" includes="org/tmatesoft/hg/test/**"/> 116 <fileset dir="bin" includes="org/tmatesoft/hg/test/**"/>
102 <fileset file="COPYING"/> 117 <fileset file="COPYING"/>
103 </jar> 118 </jar>
104 </target> 119 </target>
105 120
106 <target name="build-cmdline" depends="build"> 121 <target name="build-cmdline" depends="build-lib">
107 <mkdir dir="bin" /> 122 <mkdir dir="bin" />
108 <javac srcdir="cmdline" destdir="bin" /> 123 <javac srcdir="cmdline" destdir="bin" />
109 <jar destfile="${hg4j-console.jar}"> 124 <jar destfile="${hg4j-console.jar}">
110 <fileset dir="bin/" includes="org/tmatesoft/hg/console/**"/> 125 <fileset dir="bin/" includes="org/tmatesoft/hg/console/**"/>
111 <fileset file="COPYING"/> 126 <fileset file="COPYING"/>
112 </jar> 127 </jar>
113 </target> 128 </target>
114 129
115 </project> 130 </project>