PageRenderTime 5ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/build/macros.xml

https://code.google.com/p/webfabric/
XML | 78 lines | 65 code | 11 blank | 2 comment | 0 complexity | 7266effb038d213ca3a231afb8e80891 MD5 | raw file
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project>
  3. <taskdef resource="scala/tools/ant/antlib.xml">
  4. <classpath>
  5. <pathelement location="build/lib/scala-compiler.jar"/>
  6. <pathelement location="lib/scala-library.jar"/>
  7. </classpath>
  8. </taskdef>
  9. <macrodef name="compile.and.jar">
  10. <attribute name="src"/>
  11. <attribute name="jar"/>
  12. <attribute name="classpathref"/>
  13. <attribute name="version"/>
  14. <attribute name="classes" default="@{jar}.classes"/>
  15. <sequential>
  16. <mkdir dir="@{classes}"/>
  17. <scalac srcdir="@{src}" destdir="@{classes}" classpathref="@{classpathref}" target="jvm-1.5"/>
  18. <javac srcdir="@{src}" destdir="@{classes}" classpathref="@{classpathref}" debug="true" target="1.5"/>
  19. <copy todir="@{classes}">
  20. <fileset dir="@{src}">
  21. <exclude name="**/*.java"/>
  22. <exclude name="**/*.scala"/>
  23. </fileset>
  24. </copy>
  25. <property name="manifest" value="@{jar}.mf"/>
  26. <manifest file="${manifest}">
  27. <attribute name="Built-By" value="${user.name}"/>
  28. <section name="${ant.project.name}">
  29. <attribute name="Specification-Title" value="${ant.project.name}"/>
  30. <attribute name="Specification-Version" value="@{version}"/>
  31. <attribute name="Specification-Vendor" value="${ant.project.name}"/>
  32. <attribute name="Implementation-Title" value="${ant.project.name}"/>
  33. <attribute name="Implementation-Version" value="@{version}"/>
  34. <attribute name="Implementation-Vendor" value="${ant.project.name}"/>
  35. </section>
  36. </manifest>
  37. <jar destfile="@{jar}" basedir="@{classes}" manifest="${manifest}"/>
  38. <delete file="$manifest"/>
  39. <delete dir="@{classes}"/>
  40. </sequential>
  41. </macrodef>
  42. <macrodef name="test">
  43. <attribute name="jar"/>
  44. <attribute name="reports"/>
  45. <attribute name="classpathref"/>
  46. <sequential>
  47. <mkdir dir="@{reports}"/>
  48. <property name="unzipped.jar" value="@{reports}.unzipped.jar"/>
  49. <mkdir dir="${unzipped.jar}"/>
  50. <unzip dest="${unzipped.jar}" src="@{jar}"/>
  51. <junit printsummary="no" fork="on" failureproperty="failed" forkmode="once">
  52. <!--jvmarg value="-Xdebug"/>
  53. <jvmarg value="-Xrunjdwp:transport=dt_socket,server=n,address=5005,suspend=y"/-->
  54. <classpath refid="@{classpathref}"/>
  55. <formatter type="xml"/>
  56. <batchtest todir="@{reports}">
  57. <fileset dir="${unzipped.jar}">
  58. <include name="**/*Test*"/>
  59. <exclude name="**/*$*"/>
  60. </fileset>
  61. </batchtest>
  62. </junit>
  63. <delete dir="${unzipped.jar}"/>
  64. <fail message="Tests failed" if="failed"/>
  65. </sequential>
  66. </macrodef>
  67. </project>