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

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