>From 09180ce22f2686c929369a3b2fc654991344031c Mon Sep 17 00:00:00 2001
From: Richard Hansen <rhansen@bbn.com>
Date: Sat, 4 Feb 2012 14:18:04 -0500
Subject: [PATCH 5/8] move stuff in build-support into build.xml

---
 build-support/script/build-ivy-base.xml |   65 -------------------------------
 build-support/script/build-ivy.xml      |   29 --------------
 build.xml                               |   57 +++++++++++++++++++++++++--
 3 files changed, 53 insertions(+), 98 deletions(-)
 delete mode 100644 build-support/script/build-ivy-base.xml
 delete mode 100644 build-support/script/build-ivy.xml

diff --git a/build-support/script/build-ivy-base.xml b/build-support/script/build-ivy-base.xml
deleted file mode 100644
index 6812e81..0000000
--- a/build-support/script/build-ivy-base.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<project name="mkgmap.Build.Ivy.Base" default="init-ivy" basedir="."
-	xmlns:ivy="antlib:org.apache.ivy.ant">
-
-	<description>
-		Installs and configures the ivy build dependencies system.
-	</description>
-
-	<!-- Include common build components. -->
-	<property name="build-support.dir" location="../"/>
-
-	<target name="ivy-availability" description="Checks if the ivy library is available">
-		<property name="ivy.version" value="${dependency.version.ivy}" />
-		<property name="ivy.jar.dir" value="${build-support.dir}/ivy" />
-		<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.version}.jar" />
-
-		<!-- Determine if the ivy jar is already available. -->
-		<available property="ivy.available" file="${ivy.jar.file}" />
-	</target>
-
-	<target name="download-ivy" unless="ivy.available" description="Downloads the ivy library from public repositories.">
-		<!-- Delete any existing ivy files -->
-		<delete dir="${ivy.jar.dir}"/>
-
-		<mkdir dir="${ivy.jar.dir}" />
-
-		<!--
-			Download Ivy from web site so that it can be used even without any
-			special installation
-		-->
-		<get
-			src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
-			dest="${ivy.jar.file}" usetimestamp="true"/>
-	</target>
-
-	<target name="init-ivy" depends="ivy-availability, download-ivy" description="Registers ivy with ant and initializes it." unless="ivy.initialized">
-		<!--
-			Try to load ivy in case the user has not already
-			dropped it into ant's lib dir (note that the latter copy will always
-			take precedence). We will not fail as long as local lib dir exists
-			(it may be empty) and ivy is in at least one of ant's lib dir or the
-			local lib dir.
-		-->
-		<path id="ivy.lib.path">
-			<fileset dir="${ivy.jar.dir}" includes="*.jar" />
-		</path>
-		<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant"
-			classpathref="ivy.lib.path" />
-
-		<ivy:configure />
-
-		<!-- Retrieve ivy details from the config file. -->
-		<ivy:info />
-
-		<property name="ivy.initialized" value="true"/>
-	</target>
-
-	<target name="clean-cache" depends="init-ivy" description="Clean the ivy cache.">
-		<ivy:cleancache />
-	</target>
-
-	<target name="clean-ivy" description="Clean the ivy installation.">
-		<delete dir="${ivy.jar.dir}"/>
-	</target>
-</project>
diff --git a/build-support/script/build-ivy.xml b/build-support/script/build-ivy.xml
deleted file mode 100644
index 4956cb3..0000000
--- a/build-support/script/build-ivy.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<project name="mkgmap.Build.Ivy" default="init-ivy" basedir="."
-	xmlns:ivy="antlib:org.apache.ivy.ant">
-
-	<description>Ivy-specific tasks</description>
-
-	<!-- Include common build components. -->
-	<property name="build-support.dir" location="../"/>
-	<import file="${build-support.dir}/script/build-ivy-base.xml"/>
-	<property name="ivy.retrieve.pattern" value="${ivy.lib.dir}/[conf]/[artifact]-[revision].[ext]" />
-
-	<target name="resolve-compile" depends="init-ivy" description="Downloads compile dependencies using ivy.">
-		<ivy:retrieve conf="compile" />
-	</target>
-	<target name="resolve-test" depends="init-ivy" description="Downloads test program dependencies using ivy.">
-		<ivy:retrieve conf="test" />
-	</target>
-	<target name="resolve-macker" depends="init-ivy" description="Downloads macker program dependencies using ivy.">
-		<ivy:retrieve conf="macker" />
-	</target>
-	<target name="resolve" depends="resolve-compile, resolve-test, resolve-macker" description="Downloads all program dependencies using ivy." />
-
-	<property name="ivy.distrib.dir" value="${ivy.project.dir}/dist" />
-	<property name="ivy.publish.src.artifacts.pattern" value="${ivy.distrib.dir}/[artifact].[ext]" />
-	<target name="publish" depends="dist">
-		<ivy:deliver pubrevision="${project.version}"/>
-		<ivy:publish resolver="local" pubrevision="${project.version}" overwrite="true"/>
-	</target>
-</project>
diff --git a/build.xml b/build.xml
index 16b9109..113dfa4 100644
--- a/build.xml
+++ b/build.xml
@@ -77,11 +77,11 @@
 	<property name="project.version" value="${project.version.default}" />
 
 	<!-- ivy dependency support -->
-	<property name="build-support.dir" location="build-support"/>
-	<property name="dependency.version.ivy" value="2.2.0"/>
+	<property name="ivy.version" value="2.2.0"/>
 	<property name="ivy.lib.dir" value="${basedir}/lib" />
-	<import file="${build-support.dir}/script/build-ivy-base.xml"/>
-	<import file="${build-support.dir}/script/build-ivy.xml"/>
+	<property name="ivy.jar.dir" value="${ivy.lib.dir}/build" />
+	<property name="ivy.retrieve.pattern" value="${ivy.lib.dir}/[conf]/[artifact]-[revision].[ext]" />
+	<property name="ivy.publish.src.artifacts.pattern" value="${dist}/[artifact].[ext]" />
 
 	<!-- For class paths -->
 	<path id="ivy.classpath.compile">
@@ -107,6 +107,55 @@
 		<pathelement location="test"/>
 	</path>
 
+	<!-- ******************** TARGETS ******************** -->
+
+	<!-- targets for downloading and registering ivy -->
+	<target name="ivy-availability" description="Checks if the ivy library is available">
+		<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.version}.jar" />
+		<available property="ivy.available" file="${ivy.jar.file}" />
+	</target>
+	<target name="download-ivy" unless="ivy.available" description="Downloads the ivy library from public repositories.">
+		<delete dir="${ivy.jar.dir}"/>
+		<mkdir dir="${ivy.jar.dir}" />
+		<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
+		     dest="${ivy.jar.file}" usetimestamp="true"/>
+	</target>
+	<target name="init-ivy" depends="ivy-availability, download-ivy" description="Registers ivy with ant and initializes it." unless="ivy.initialized">
+		<path id="ivy.lib.path">
+			<fileset dir="${ivy.jar.dir}" includes="*.jar" />
+		</path>
+		<taskdef resource="org/apache/ivy/ant/antlib.xml"
+			 uri="antlib:org.apache.ivy.ant"
+			 classpathref="ivy.lib.path" />
+		<ivy:configure />
+		<ivy:info />
+		<property name="ivy.initialized" value="true"/>
+	</target>
+	<target name="clean-cache" depends="init-ivy" description="Clean the ivy cache.">
+		<ivy:cleancache />
+	</target>
+	<target name="clean-ivy" description="Clean the ivy installation.">
+		<delete dir="${ivy.jar.dir}"/>
+	</target>
+
+	<!-- targets for fetching dependencies via ivy -->
+	<target name="resolve-compile" depends="init-ivy" description="Downloads compile dependencies using ivy.">
+		<ivy:retrieve conf="compile" />
+	</target>
+	<target name="resolve-test" depends="init-ivy" description="Downloads test program dependencies using ivy.">
+		<ivy:retrieve conf="test" />
+	</target>
+	<target name="resolve-macker" depends="init-ivy" description="Downloads macker program dependencies using ivy.">
+		<ivy:retrieve conf="macker" />
+	</target>
+	<target name="resolve" depends="resolve-compile, resolve-test, resolve-macker" description="Downloads all program dependencies using ivy." />
+
+	<!-- targets for publishing mkgmap (locally) via ivy -->
+	<target name="publish" depends="dist">
+		<ivy:deliver pubrevision="${project.version}"/>
+		<ivy:publish resolver="local" pubrevision="${project.version}" overwrite="true"/>
+	</target>
+
 	<!-- Prepare - make all the directories -->
 	<target name="prepare">
 		<mkdir dir="${build.classes}" />
-- 
1.7.8.3

