summaryrefslogtreecommitdiff
path: root/ant/ivy-common.xml
diff options
context:
space:
mode:
Diffstat (limited to 'ant/ivy-common.xml')
-rw-r--r--ant/ivy-common.xml57
1 files changed, 57 insertions, 0 deletions
diff --git a/ant/ivy-common.xml b/ant/ivy-common.xml
new file mode 100644
index 0000000..8637e3d
--- /dev/null
+++ b/ant/ivy-common.xml
@@ -0,0 +1,57 @@
+<project name="ivy-common"
+ xmlns:ivy="antlib:org.apache.ivy.ant"
+ xmlns:artifact="antlib:org.apache.maven.artifact.ant">
+
+ <property name="ivy.jar.version" value="2.3.0"/>
+ <property name="ivy.jar.name" value="ivy-${ivy.jar.version}.jar"/>
+ <property name="ivy.home" value="${user.home}/.ivy2"/>
+ <available property="ivy.installed" file="${ivy.home}/${ivy.jar.name}"/>
+
+ <!-- Install ivy jar files in ~/.ivy2 -->
+ <target name="ivy-install" unless="ivy.installed">
+ <mkdir dir="${ivy.home}"/>
+ <get
+ src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.jar.version}/${ivy.jar.name}"
+ dest="${ivy.home}/${ivy.jar.name}" />
+ </target>
+
+ <target name="ivy-init" depends="ivy-install">
+ <taskdef resource="org/apache/ivy/ant/antlib.xml"
+ uri="antlib:org.apache.ivy.ant"
+ classpath="${ivy.home}/${ivy.jar.name}" />
+ <ivy:resolve/>
+ </target>
+
+ <target name="resolve" depends="ivy-init" description="Download project dependencies">
+ <ivy:retrieve />
+ </target>
+
+ <target name="dep-report" depends="resolve" description="Generate dependency report">
+ <ivy:report todir="${build.dir}" />
+ </target>
+
+ <target name="gen-pom" depends="prepare,ivy-init"
+ description="Make a pom file for the project">
+ <ivy:makepom ivyfile="ivy.xml" pomfile="${build.dir}/poms/${ant.project.name}.pom">
+ <!--
+ Mapping confs to scopes is important, otherwise
+ unmapped confs are included as optional. If you
+ have private confs, the best option seems to
+ be marking them as provided or system. See
+ IVY-1201 for an ehancement request.
+ -->
+ <mapping conf="default" scope="compile"/>
+ </ivy:makepom>
+ </target>
+
+ <target name="publish-local" depends="jar,ivy-init,gen-pom"
+ description="Publish to local maven repo for building other projects">
+
+ <ivy:publish resolver="local-m2-publish" forcedeliver="true"
+ overwrite="true" publishivy="false">
+
+ <artifacts pattern="${build.dir}/[type]s/[artifact].[ext]"/>
+ </ivy:publish>
+ </target>
+
+</project>