build.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="jME3-SDK" default="default" basedir=".">
  3. <description>Builds, tests, and runs the jMonkeyEngine3 SDK.</description>
  4. <fail message="Please build using Ant 1.7.1 or higher.">
  5. <condition>
  6. <not>
  7. <antversion atleast="1.7.1"/>
  8. </not>
  9. </condition>
  10. </fail>
  11. <target name="default" depends="zip"/>
  12. <target name="build" description="Builds the complete SDK, copies over engine libraries." depends="-check-platform, -update-sdk-platform-config">
  13. <ant dir="engine" target="update-sdk"/>
  14. <ant dir="sdk" target="build"/>
  15. </target>
  16. <target name="build-engine" description="Builds the engine libraries only">
  17. <ant dir="engine" target="clean"/>
  18. <ant dir="engine" target="jar"/>
  19. <ant dir="engine" target="javadoc"/>
  20. <ant dir="engine" target="create-zip-distribution"/>
  21. </target>
  22. <target name="clean" description="Clean all build products" depends="-check-platform, -update-sdk-platform-config">
  23. <ant dir="engine" target="clean"/>
  24. <ant dir="sdk" target="clean"/>
  25. </target>
  26. <target name="run" description="Runs the SDK" depends="-check-platform, -update-sdk-platform-config">
  27. <ant dir="engine" target="update-sdk"/>
  28. <ant dir="sdk" target="run"/>
  29. </target>
  30. <target name="zip" description="Builds the complete SDK and packs it as a ZIP file">
  31. <ant dir="engine" target="update-sdk"/>
  32. <ant dir="sdk" target="build-zip"/>
  33. <property file="sdk/nbproject/project.properties"/>
  34. <move file="sdk/dist/${app.name}.zip" tofile="./jMonkeyEngine-SDK-${app.version}-NoBundles.zip"/>
  35. </target>
  36. <target name="update-platform" description="Updates the base platform to the latest available build" depends="-remove-platform,-check-platform"/>
  37. <target name="-check-platform" depends="-check-platform-present" unless="platform.present">
  38. <property file="sdk/nbproject/project.properties"/>
  39. <echo message="Downloading base platform, this only has to be done once."/>
  40. <get src="${netbeans.platform.url}" dest="./platform-base.zip" skipexisting="false"/>
  41. <unzip src="platform-base.zip" dest="./"/>
  42. <antcall target="-update-sdk-platform-config"/>
  43. <delete file="platform-base.zip"/>
  44. </target>
  45. <target name="-check-platform-present">
  46. <available file="sdk/nbproject/private/platform-private.properties" property="platform.present"/>
  47. </target>
  48. <target name="-remove-platform">
  49. <delete dir="netbeans" failonerror="false"/>
  50. <delete file="sdk/nbproject/private/platform-private.properties" failonerror="false"/>
  51. </target>
  52. <target name="create-platform-config" depends="-update-sdk-platform-config">
  53. </target>
  54. <target name="-update-sdk-platform-config">
  55. <property name="nbplatform.dir" location="netbeans"/>
  56. <mkdir dir="sdk/nbproject/private"/>
  57. <echo file="sdk/nbproject/private/platform-private.properties"
  58. message="nbplatform.default.netbeans.dest.dir=${nbplatform.dir}&#xD;&#xA;"/>
  59. <echo file="sdk/nbproject/private/platform-private.properties"
  60. message="nbplatform.default.harness.dir=${nbplatform.dir}${file.separator}harness&#xD;&#xA;" append="true"/>
  61. <replace file="sdk/nbproject/private/platform-private.properties" token="\" value="\\"/>
  62. </target>
  63. <!--
  64. ****************************************************************
  65. Only Relevant for building nightly on Hudson server from here on
  66. ****************************************************************
  67. -->
  68. <target name="hudson-nightly" depends="-hudson-revert-changes, -check-platform, -update-sdk-platform-config, -hudson-build-engine">
  69. <!--ant dir="engine" target="copy-javadoc"/-->
  70. <ant dir="engine" target="create-zip-distribution"/>
  71. <ant dir="sdk" target="hudson-nightly"/>
  72. </target>
  73. <target name="hudson-stable" depends="-hudson-revert-changes, -check-platform, -update-sdk-platform-config, -hudson-build-engine">
  74. <!--ant dir="engine" target="dist"/-->
  75. <ant dir="engine" target="create-zip-distribution"/>
  76. <ant dir="sdk" target="hudson-stable"/>
  77. </target>
  78. <target name="hudson-release" depends="-hudson-revert-changes, -check-platform, -update-sdk-platform-config, -hudson-build-engine">
  79. <ant dir="sdk" target="hudson-release"/>
  80. </target>
  81. <target name="-hudson-revert-changes">
  82. <exec executable="svn" dir="engine" failonerror="true">
  83. <arg value="cleanup" />
  84. </exec>
  85. <exec executable="svn" dir="engine">
  86. <arg value="revert" />
  87. <arg value="-R" />
  88. <arg value="." />
  89. </exec>
  90. <exec executable="svn" dir="engine">
  91. <arg value="cleanup" />
  92. </exec>
  93. <exec executable="svn" dir="engine">
  94. <arg value="update" />
  95. </exec>
  96. <exec executable="svn" dir="sdk">
  97. <arg value="cleanup" />
  98. </exec>
  99. <exec executable="svn" dir="sdk">
  100. <arg value="revert" />
  101. <arg value="." />
  102. <arg value="-R" />
  103. </exec>
  104. <exec executable="svn" dir="sdk">
  105. <arg value="cleanup" />
  106. </exec>
  107. <exec executable="svn" dir="sdk">
  108. <arg value="update" />
  109. </exec>
  110. <exec executable="svn" dir=".">
  111. <arg value="unlock" />
  112. <arg value="engine" />
  113. </exec>
  114. <exec executable="svn" dir=".">
  115. <arg value="unlock" />
  116. <arg value="sdk" />
  117. </exec>
  118. </target>
  119. <target name="-hudson-build-engine">
  120. <!--ant dir="engine" target="build-bullet-natives"/-->
  121. <ant dir="engine" target="jar"/>
  122. <ant dir="engine" target="javadoc"/>
  123. <ant dir="engine" target="update-sdk-nobuild"/>
  124. </target>
  125. </project>