view build.xml @ 155:a4ec5e087017

Dedicated location for various test data
author Artem Tikhomirov <>
date Thu, 24 Feb 2011 22:18:03 +0100
parents a05145db4d0c
children d5268ca7715b
line wrap: on
line source
<?xml version="1.0" encoding="UTF-8"?>
 Copyright (c) 2010-2011 TMate Software Ltd
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; version 2 of the License.
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 GNU General Public License for more details.
 For information on how to redistribute this software under
 the terms of a license other than GNU General Public License
 contact TMate Software at
<project name="hg4j" default="samples">
            Build, test and showcase hg4j 

	<property name="junit.jar" value="lib/junit-4.8.2.jar" />
	<property name="ver.qualifier" value=".rc1" />
	<property name="version.lib" value="0.0.9" />
	<property name="version.jar" value="${version.lib}${ver.qualifier}" />

	<property name="hg4j.jar" value="hg4j_${version.jar}.jar" />
	<property name="hg4j-tests.jar" value="hg4j-tests_${version.jar}.jar" />
	<property name="hg4j-console.jar" value="hg4j-console_${version.jar}.jar" />

	<target name="samples" depends="build-cmdline">
		<path id="path.cmdline" path="${hg4j.jar};${hg4j-console.jar}" />

		<echo message="History of a specific file(s)" />
		<java classpathref="path.cmdline" classname="org.tmatesoft.hg.console.Log">
			<arg line="design.txt .classpath src/org/tmatesoft/hg/core/" />

		<echo message="${line.separator}>>>Latest commit" />
		<java classpathref="path.cmdline" classname="org.tmatesoft.hg.console.Log">
			<arg line="--debug --limit 1" />

		<echo message="${line.separator}>>>Content of a file" />
		<java classpathref="path.cmdline" classname="org.tmatesoft.hg.console.Cat">
			<arg line="src/org/tmatesoft/hg/core/ --rev 1" />

		<echo message="${line.separator}>>>Status between two revisions" />
		<java classpathref="path.cmdline" classname="org.tmatesoft.hg.console.Status">
			<arg line="--rev 140 --rev 142" />

		<echo message="${line.separator}>>>Status, working copy, all" />
		<java classpathref="path.cmdline" classname="org.tmatesoft.hg.console.Status">
			<arg line="-A" />

		<echo message="${line.separator}>>>Manifest" />
		<java classpathref="path.cmdline" classname="org.tmatesoft.hg.console.Manifest">
			<arg line="--debug" />

	<target name="tests" depends="build-tests">
		<property name="test-repos-root" value="${}/hg4j-tests/"/>
		<delete dir="${test-repos-root}" quiet="yes"/>
		<unjar src="test-data/test-repos.jar" dest="${test-repos-root}"/>
			<classpath path="${hg4j.jar};${hg4j-tests.jar};${junit.jar}" />
			<formatter type="xml" />
			<formatter type="plain" usefile="no" />
			<sysproperty key="hg4j.tests.repos" value="${test-repos-root}"/>
			<test name="org.tmatesoft.hg.test.TestHistory" />
			<test name="org.tmatesoft.hg.test.TestManifest" />
			<test name="org.tmatesoft.hg.test.TestStatus" />
			<test name="org.tmatesoft.hg.test.TestStorePath" />

	<target name="build">
		<mkdir dir="bin" />
		<javac srcdir="src" destdir="bin" />
		<jar destfile="${hg4j.jar}">
			<fileset dir="bin/">
				<include name="org/tmatesoft/hg/core/**" />
				<include name="org/tmatesoft/hg/util/**" />
				<include name="org/tmatesoft/hg/repo/**" />
				<include name="org/tmatesoft/hg/internal/**" />
			<fileset file="COPYING"/>

	<target name="build-tests" depends="build">
		<mkdir dir="bin" />
		<javac srcdir="test" destdir="bin" />
		<jar destfile="${hg4j-tests.jar}">
			<fileset dir="bin" includes="org/tmatesoft/hg/test/**"/>
			<fileset file="COPYING"/>

	<target name="build-cmdline" depends="build">
		<mkdir dir="bin" />
		<javac srcdir="cmdline" destdir="bin" />
		<jar destfile="${hg4j-console.jar}">
			<fileset dir="bin/" includes="org/tmatesoft/hg/console/**"/>
			<fileset file="COPYING"/>