/src/main/resources/ant-macros.xml

http://thoughtsite.googlecode.com/ · XML · 106 lines · 59 code · 8 blank · 39 comment · 0 complexity · 99ae79b47b6d8198e1549d3cc0de2cb8 MD5 · raw file

  1. <!--
  2. This file contains useful Ant definitions for users of App Engine.
  3. To use these macrodefs and taskdefs, import the file into your own build.xml:
  4. <property name="appengine.sdk.dir" location="/some_dir/appengine-java-sdk-trunk"/>
  5. <import file="${appengine.sdk.dir}/config/user/ant-macros.xml"/>
  6. For example uses of the macros, see the template project's build.xml.
  7. -->
  8. <project name="appengine-ant-macros">
  9. <property name="appengine.sdk.home" location="${ant.file.appengine-ant-macros}../../../.."/>
  10. <property name="appengine.tools.classpath"
  11. location="${appengine.sdk.home}/lib/appengine-tools-api.jar"/>
  12. <!--
  13. A macrodef for dev_appserver. Use like:
  14. <dev_appserver war="${war}"/>
  15. -->
  16. <macrodef name="dev_appserver" description="Runs the App Engine Development App Server">
  17. <attribute name="war" description="The exploded war directory containing the application"/>
  18. <attribute name="port" default="8080" description="The port the server starts on"/>
  19. <attribute name="address" default="localhost" description="The interface the server binds to"/>
  20. <element name="options" optional="true" description="Additional options for dev_appserver"/>
  21. <element name="args" optional="true" description="Additional arguments for the java task"/>
  22. <sequential>
  23. <java classname="com.google.appengine.tools.KickStart"
  24. classpath="${appengine.tools.classpath}"
  25. fork="true">
  26. <arg value="com.google.appengine.tools.development.DevAppServerMain"/>
  27. <arg value="--port=@{port}"/>
  28. <arg value="--address=@{address}"/>
  29. <options/>
  30. <arg value="@{war}"/>
  31. <args/>
  32. </java>
  33. </sequential>
  34. </macrodef>
  35. <!--
  36. A macrodef for appcfg. Use like:
  37. <appcfg action="update" war="${war}"/>
  38. -->
  39. <macrodef name="appcfg" description="Manages an application">
  40. <attribute name="war" description="The exploded war directory containing the application"/>
  41. <attribute name="action" description="One of (update, rollback, update_indexes, request_logs)"/>
  42. <element name="options" optional="true" description="Options for appcfg (such as --server, --num_days, etc...)"/>
  43. <element name="args" optional="true" description="Additional arguments for the java task"/>
  44. <sequential>
  45. <java classname="com.google.appengine.tools.admin.AppCfg"
  46. classpath="${appengine.tools.classpath}"
  47. fork="true">
  48. <arg value="--disable_prompt"/>
  49. <options/>
  50. <arg value="@{action}"/>
  51. <arg value="@{war}"/>
  52. <args/>
  53. </java>
  54. </sequential>
  55. </macrodef>
  56. <!--
  57. A taskdef for ORM enhancement. Use like:
  58. <enhance failonerror="true">
  59. <classpath>
  60. <pathelement path="${appengine.tools.classpath}"/>
  61. <pathelement path="@{war}/WEB-INF/classes"/>
  62. <fileset dir="@{war}/WEB-INF/lib" includes="*.jar"/>
  63. </classpath>
  64. <fileset dir="@{war}/WEB-INF/classes" includes="**/*.class"/>
  65. </enhance>
  66. Alternatively, use the <enhance_war/> macrodef below.
  67. -->
  68. <taskdef name="enhance"
  69. classpath="${appengine.tools.classpath}"
  70. classname="com.google.appengine.tools.enhancer.EnhancerTask"/>
  71. <!--
  72. A macrodef for ORM enhancement for a war. Use like:
  73. <enhance_war war="${war}"/>
  74. -->
  75. <macrodef name="enhance_war" description="Run the ORM enhancer on an exploded war">
  76. <attribute name="war" description="The exploded war directory containing the application"/>
  77. <element name="args" optional="true" description="Additional arguments to the enhancer"/>
  78. <sequential>
  79. <enhance failonerror="true">
  80. <args/>
  81. <classpath>
  82. <pathelement path="${appengine.tools.classpath}"/>
  83. <pathelement path="@{war}/WEB-INF/classes"/>
  84. <fileset dir="@{war}/WEB-INF/lib" includes="*.jar"/>
  85. </classpath>
  86. <fileset dir="@{war}/WEB-INF/classes" includes="**/*.class"/>
  87. </enhance>
  88. </sequential>
  89. </macrodef>
  90. </project>