build.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 GDE, 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" depends="build">
  31. <propertyfile file="sdk/nbproject/project.properties"/>
  32. <move file="sdk/dist/${app.name}.zip" tofile="./jMonkeyEngine-GDE-${app.version}.zip"/>
  33. </target>
  34. <target name="update-platform" description="Updates the base platform to the latest available build" depends="-remove-platform,-check-platform"/>
  35. <target name="-check-platform" depends="-check-platform-present" unless="platform.present">
  36. <property file="sdk/nbproject/project.properties"/>
  37. <echo message="Downloading base platform, this only has to be done once."/>
  38. <get src="http://direct.jmonkeyengine.com/updates/nightly/${app.version}/platform-base.zip" dest="./" skipexisting="false"/>
  39. <unzip src="platform-base.zip" dest="./"/>
  40. <antcall target="-update-sdk-platform-config"/>
  41. <delete file="platform-base.zip"/>
  42. </target>
  43. <target name="-check-platform-present">
  44. <available file="netbeans" property="platform.present"/>
  45. </target>
  46. <target name="-remove-platform">
  47. <delete dir="netbeans" failonerror="false"/>
  48. </target>
  49. <target name="-update-sdk-platform-config">
  50. <property name="nbplatform.dir" location="netbeans"/>
  51. <mkdir dir="sdk/nbproject/private"/>
  52. <echo file="sdk/nbproject/private/platform-private.properties"
  53. message="nbplatform.default.netbeans.dest.dir=${nbplatform.dir}&#xD;&#xA;"/>
  54. <echo file="sdk/nbproject/private/platform-private.properties"
  55. message="nbplatform.default.harness.dir=${nbplatform.dir}${file.separator}harness&#xD;&#xA;" append="true"/>
  56. <replace file="sdk/nbproject/private/platform-private.properties" token="\" value="\\"/>
  57. </target>
  58. <!--
  59. ****************************************************************
  60. Only Relevant for building nightly on Hudson server from here on
  61. ****************************************************************
  62. -->
  63. <target name="hudson-nightly" depends="-hudson-revert-changes, -check-platform, -update-sdk-platform-config, -hudson-build-engine">
  64. <ant dir="engine" target="copy-javadoc"/>
  65. <ant dir="engine" target="create-zip-distribution"/>
  66. <ant dir="sdk" target="hudson-nightly"/>
  67. </target>
  68. <target name="hudson-stable" depends="-hudson-revert-changes, -check-platform, -update-sdk-platform-config, -hudson-build-engine">
  69. <!--ant dir="engine" target="dist"/-->
  70. <ant dir="sdk" target="hudson-stable"/>
  71. </target>
  72. <target name="hudson-release" depends="-hudson-revert-changes, -check-platform, -update-sdk-platform-config, -hudson-build-engine">
  73. <ant dir="sdk" target="hudson-release"/>
  74. </target>
  75. <target name="-hudson-revert-changes">
  76. <exec executable="svn" dir="engine">
  77. <arg value="cleanup" />
  78. </exec>
  79. <exec executable="svn" dir="engine">
  80. <arg value="revert" />
  81. <arg value="-R" />
  82. <arg value="." />
  83. </exec>
  84. <exec executable="svn" dir="engine">
  85. <arg value="cleanup" />
  86. </exec>
  87. <exec executable="svn" dir="engine">
  88. <arg value="update" />
  89. </exec>
  90. <exec executable="svn" dir="sdk">
  91. <arg value="cleanup" />
  92. </exec>
  93. <exec executable="svn" dir="sdk">
  94. <arg value="revert" />
  95. <arg value="." />
  96. <arg value="-R" />
  97. </exec>
  98. <exec executable="svn" dir="sdk">
  99. <arg value="cleanup" />
  100. </exec>
  101. <exec executable="svn" dir="sdk">
  102. <arg value="update" />
  103. </exec>
  104. <exec executable="svn" dir=".">
  105. <arg value="unlock" />
  106. <arg value="engine" />
  107. </exec>
  108. <exec executable="svn" dir=".">
  109. <arg value="unlock" />
  110. <arg value="sdk" />
  111. </exec>
  112. </target>
  113. <target name="-hudson-build-engine">
  114. <ant dir="engine" target="build-bullet-natives"/>
  115. <ant dir="engine" target="javadoc"/>
  116. <ant dir="engine" target="update-sdk-nobuild"/>
  117. </target>
  118. </project>