Mirror of retrofit, Type-safe HTTP client for Android and Java by Square, Inc.
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.

build-macros.xml 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Copyright 2010 Square, Inc. -->
  3. <!--
  4. - Ant macro definitions.
  5. -->
  6. <project name="Macros" basedir="." default="help">
  7. <target name="help">
  8. <echo>Import this build file into the main build.xml.</echo>
  9. </target>
  10. <!--
  11. - Compiles a module.
  12. -->
  13. <macrodef name="compile.module">
  14. <attribute name="module"
  15. description="The directory name under 'modules'."/>
  16. <element name="compile.main.classpath" optional="true"/>
  17. <element name="compile.tests.classpath" optional="true"/>
  18. <sequential>
  19. <mkdir dir="${build.dir}/@{module}/main"/>
  20. <!-- Compile src/* and place classes in build/[module]/main. -->
  21. <javac srcdir="modules/@{module}/src"
  22. destdir="${build.dir}/@{module}/main"
  23. fork="true"
  24. debug="true"
  25. includeantruntime="false">
  26. <classpath>
  27. <fileset dir="${lib.dir}" includes="*.jar"/>
  28. <compile.main.classpath/>
  29. </classpath>
  30. </javac>
  31. <!-- Compile src-tests/* and place classes in build/[module]/tests. -->
  32. <mkdir dir="${build.dir}/@{module}/tests"/>
  33. <javac srcdir="modules/@{module}/src-tests"
  34. destdir="${build.dir}/@{module}/tests"
  35. fork="true"
  36. debug="true"
  37. includeantruntime="false">
  38. <classpath>
  39. <fileset dir="${lib.dir}" includes="*.jar"/>
  40. <pathelement location="${build.dir}/@{module}/main"/>
  41. <compile.tests.classpath/>
  42. </classpath>
  43. </javac>
  44. </sequential>
  45. </macrodef>
  46. <!--
  47. - Builds a module's JAR file.
  48. -->
  49. <macrodef name="jar.module">
  50. <attribute name="module"
  51. description="The directory name under 'modules'."/>
  52. <element name="compile.main.classpath" optional="true"/>
  53. <element name="compile.tests.classpath" optional="true"/>
  54. <sequential>
  55. <!-- Create the JAR files. -->
  56. <jar jarfile="${build.dir}/retrofit-@{module}-${retrofit.revision}.jar">
  57. <manifest>
  58. <attribute name="Build-Time" value="${build.time}"/>
  59. <attribute name="Copyright"
  60. value="${build.year}, Square, Inc."/>
  61. <attribute name="Commit-Hash" value="${commit.hash}"/>
  62. </manifest>
  63. <fileset dir="${build.dir}/@{module}/main"/>
  64. </jar>
  65. <jar jarfile="${build.dir}/retrofit-@{module}-${retrofit.revision}-src.jar">
  66. <manifest>
  67. <attribute name="Build-Time" value="${build.time}"/>
  68. <attribute name="Copyright"
  69. value="${build.year}, Square, Inc."/>
  70. <attribute name="Commit-Hash" value="${commit.hash}"/>
  71. </manifest>
  72. <fileset dir="modules/@{module}/src"/>
  73. </jar>
  74. </sequential>
  75. </macrodef>
  76. </project>