You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

common.xml 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?xml version="1.0"?>
  2. <project xmlns:antcontrib="antlib:net.sf.antcontrib"
  3. xmlns:artifact="antlib:org.apache.maven.artifact.ant" xmlns:ivy="antlib:org.apache.ivy.ant"
  4. name="common" basedir="../" default="init-deps">
  5. <property name="ivy.install.version" value="2.2.0" />
  6. <property name="ivy.jar.name" value="ivy-${ivy.install.version}.jar" />
  7. <property name="ivy.jar.dir" value="${user.home}/.ant/lib" />
  8. <property name="ivy.jar.file" value="${ivy.jar.dir}/${ivy.jar.name}" />
  9. <target name="init-deps"
  10. description="Configure Ivy dependency management and load common task definitions"
  11. depends="init-taskdefs" unless="deps.initialized">
  12. <property name="deps.initialized" value="1" />
  13. </target>
  14. <target name="check-ivy-installed">
  15. <available property="ivy.installed" file="${ivy.jar.file}" />
  16. <available property="ivy.installed" classname="org.apache.ivy.ant.IvyConfigure" />
  17. <antcall target="common.ivy-download" />
  18. </target>
  19. <target name="ivy-download" unless="ivy.installed">
  20. <mkdir dir="${ivy.jar.dir}" />
  21. <get
  22. src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
  23. dest="${ivy.jar.file}" usetimestamp="true" />
  24. </target>
  25. <target name="ivy-configure" depends="check-ivy-installed"
  26. unless="deps.initialized">
  27. <!-- Ivy task definitions -->
  28. <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant"
  29. classpath="${ivy.jar.file}" />
  30. <!-- Ivy settings -->
  31. <property name="ivy.settings.file"
  32. value="${project.root}/build/ivy/ivysettings.xml" />
  33. <ivy:configure />
  34. </target>
  35. <target name="init-taskdefs" depends="ivy-configure" unless="deps.initialized">
  36. <echo>Loading Ant tasks</echo>
  37. <ivy:resolve file="${project.root}/build/ivy/ivy.xml"
  38. conf="taskdefs" />
  39. <ivy:cachepath pathid="taskdefs.classpath" conf="taskdefs" />
  40. <taskdef resource="emma_ant.properties" classpathref="taskdefs.classpath" />
  41. <!-- ant contrib required for flow control (for loop, if, property
  42. override) -->
  43. <!-- Note that we have to use a namespace to avoid clash when running
  44. sub-ant. -->
  45. <taskdef uri="antlib:net.sf.antcontrib" resource="net/sf/antcontrib/antlib.xml"
  46. classpathref="taskdefs.classpath" />
  47. <!-- ant contrib for Maven integration -->
  48. <taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
  49. uri="antlib:org.apache.maven.artifact.ant" classpathref="taskdefs.classpath" />
  50. <!-- jarjar -->
  51. <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
  52. classpathref="taskdefs.classpath" />
  53. </target>
  54. </project>