build.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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" depends="build">
  31. <propertyfile file="sdk/nbproject/project.properties"/>
  32. <move file="sdk/dist/${app.name}.zip" tofile="./jMonkeyEngine-SDK-${app.version}-NoBundles.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="${netbeans.platform.url}" dest="./platform-base.zip" 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="sdk/nbproject/private/platform-private.properties" property="platform.present"/>
  45. </target>
  46. <target name="-remove-platform">
  47. <delete dir="netbeans" failonerror="false"/>
  48. <delete file="sdk/nbproject/private/platform-private.properties" failonerror="false"/>
  49. </target>
  50. <target name="create-platform-config" depends="-update-sdk-platform-config">
  51. </target>
  52. <target name="-update-sdk-platform-config">
  53. <property name="nbplatform.dir" location="netbeans"/>
  54. <mkdir dir="sdk/nbproject/private"/>
  55. <echo file="sdk/nbproject/private/platform-private.properties"
  56. message="nbplatform.default.netbeans.dest.dir=${nbplatform.dir}&#xD;&#xA;"/>
  57. <echo file="sdk/nbproject/private/platform-private.properties"
  58. message="nbplatform.default.harness.dir=${nbplatform.dir}${file.separator}harness&#xD;&#xA;" append="true"/>
  59. <replace file="sdk/nbproject/private/platform-private.properties" token="\" value="\\"/>
  60. </target>
  61. <!--
  62. ****************************************************************
  63. Only Relevant for building nightly on Hudson server from here on
  64. ****************************************************************
  65. -->
  66. <target name="hudson-nightly" depends="-hudson-revert-changes, -check-platform, -update-sdk-platform-config, -hudson-build-engine">
  67. <!--ant dir="engine" target="copy-javadoc"/-->
  68. <ant dir="engine" target="create-zip-distribution"/>
  69. <ant dir="sdk" target="hudson-nightly"/>
  70. </target>
  71. <target name="hudson-stable" depends="-hudson-revert-changes, -check-platform, -update-sdk-platform-config, -hudson-build-engine">
  72. <!--ant dir="engine" target="dist"/-->
  73. <ant dir="sdk" target="hudson-stable"/>
  74. </target>
  75. <target name="hudson-release" depends="-hudson-revert-changes, -check-platform, -update-sdk-platform-config, -hudson-build-engine">
  76. <ant dir="sdk" target="hudson-release"/>
  77. </target>
  78. <target name="-hudson-revert-changes">
  79. <exec executable="svn" dir="engine" failonerror="true">
  80. <arg value="cleanup" />
  81. </exec>
  82. <exec executable="svn" dir="engine">
  83. <arg value="revert" />
  84. <arg value="-R" />
  85. <arg value="." />
  86. </exec>
  87. <exec executable="svn" dir="engine">
  88. <arg value="cleanup" />
  89. </exec>
  90. <exec executable="svn" dir="engine">
  91. <arg value="update" />
  92. </exec>
  93. <exec executable="svn" dir="sdk">
  94. <arg value="cleanup" />
  95. </exec>
  96. <exec executable="svn" dir="sdk">
  97. <arg value="revert" />
  98. <arg value="." />
  99. <arg value="-R" />
  100. </exec>
  101. <exec executable="svn" dir="sdk">
  102. <arg value="cleanup" />
  103. </exec>
  104. <exec executable="svn" dir="sdk">
  105. <arg value="update" />
  106. </exec>
  107. <exec executable="svn" dir=".">
  108. <arg value="unlock" />
  109. <arg value="engine" />
  110. </exec>
  111. <exec executable="svn" dir=".">
  112. <arg value="unlock" />
  113. <arg value="sdk" />
  114. </exec>
  115. </target>
  116. <target name="-hudson-build-engine">
  117. <!--ant dir="engine" target="build-bullet-natives"/-->
  118. <ant dir="engine" target="jar"/>
  119. <ant dir="engine" target="javadoc"/>
  120. <ant dir="engine" target="update-sdk-nobuild"/>
  121. </target>
  122. </project>