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.7KB

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