summaryrefslogtreecommitdiffstats
path: root/build/common.xml
diff options
context:
space:
mode:
authorMikael Vappula <mikael@vaadin.com>2011-12-02 15:05:24 +0200
committerMikael Vappula <mikael@vaadin.com>2011-12-02 15:05:24 +0200
commitc1ac1f6b1f0675dece725c5b9d04a8823335cb09 (patch)
tree2f7eff34d3acba9e9ae2a02fedce6cfab29efa2f /build/common.xml
parentc7af8ee743fb3c86d6d369da153ff2a2404a0181 (diff)
downloadvaadin-framework-c1ac1f6b1f0675dece725c5b9d04a8823335cb09.tar.gz
vaadin-framework-c1ac1f6b1f0675dece725c5b9d04a8823335cb09.zip
Cleaned up Ivy configuration
Targets related to Ivy configuration are now in separate common.xml file which is imported to main build files.
Diffstat (limited to 'build/common.xml')
-rw-r--r--build/common.xml53
1 files changed, 53 insertions, 0 deletions
diff --git a/build/common.xml b/build/common.xml
new file mode 100644
index 0000000000..69e8065231
--- /dev/null
+++ b/build/common.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+
+<project xmlns:antcontrib="antlib:net.sf.antcontrib"
+ xmlns:artifact="antlib:org.apache.maven.artifact.ant"
+ xmlns:ivy="antlib:org.apache.ivy.ant"
+ name="common"
+ basedir="../"
+ default="init-deps" >
+
+ <property name="ivy.install.version" value="2.2.0"/>
+ <property name="ivy.jar.name" value="ivy-${ivy.install.version}.jar"/>
+ <property name="ivy.jar.dir" value="${user.home}/.ant/lib" />
+ <property name="ivy.jar.file" value="${ivy.jar.dir}/${ivy.jar.name}" />
+
+ <target name="init-deps" description="Configure Ivy dependency management and load common task definitions"
+ depends="ivy-configure, init-taskdefs" />
+
+ <target name="check-ivy-installed">
+ <available property="ivy.installed" file="${ivy.jar.file}"/>
+ <available property="ivy.installed" classname="org.apache.ivy.ant.IvyConfigure" />
+ <antcall target="common.ivy-download" />
+ </target>
+
+ <target name="ivy-download" unless="ivy.installed">
+ <mkdir dir="${ivy.jar.dir}"/>
+ <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
+ </target>
+
+ <target name="ivy-configure" depends="check-ivy-installed" >
+ <!-- Ivy task definitions -->
+ <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.file}" />
+ <!-- Ivy settings -->
+ <property name="ivy.settings.file" value="build/ivy/ivysettings.xml" />
+ <ivy:configure/>
+ </target>
+
+ <target name="init-taskdefs" depends="ivy-configure" >
+ <echo>Loading Ant tasks</echo>
+ <ivy:resolve file="build/ivy/ivy.xml" conf="taskdefs" />
+ <ivy:cachepath pathid="taskdefs.classpath" conf="taskdefs" />
+ <taskdef resource="emma_ant.properties" classpathref="taskdefs.classpath" />
+
+ <!-- ant contrib required for flow control (for loop, if, property override) -->
+ <!-- Note that we have to use a namespace to avoid clash when running sub-ant. -->
+ <taskdef uri="antlib:net.sf.antcontrib" resource="net/sf/antcontrib/antlib.xml"
+ classpathref="taskdefs.classpath" />
+
+ <!-- ant contrib for Maven integration -->
+ <taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
+ uri="antlib:org.apache.maven.artifact.ant" classpathref="taskdefs.classpath" />
+ </target>
+
+</project>