build.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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="dist"/>
  19. </target>
  20. <target name="clean" description="Clean all build products" depends="-check-platform, -update-sdk-platform-config">
  21. <ant dir="engine" target="clean"/>
  22. <ant dir="sdk" target="clean"/>
  23. </target>
  24. <target name="run" description="Runs the SDK" depends="-check-platform, -update-sdk-platform-config">
  25. <ant dir="engine" target="update-sdk"/>
  26. <ant dir="sdk" target="run"/>
  27. </target>
  28. <target name="zip" description="Builds the complete SDK and packs it as a ZIP file" depends="build">
  29. <propertyfile file="sdk/nbproject/project.properties"/>
  30. <move file="sdk/dist/${app.name}.zip" tofile="./jMonkeyEngine-GDE-${app.version}.zip"/>
  31. </target>
  32. <target name="update-platform" description="Updates the base platform to the latest available build" depends="-remove-platform,-check-platform"/>
  33. <target name="-check-platform" depends="-check-platform-present" unless="platform.present">
  34. <property file="sdk/nbproject/project.properties"/>
  35. <echo message="Downloading base platform, this only has to be done once."/>
  36. <get src="http://direct.jmonkeyengine.com/updates/nightly/${app.version}/platform-base.zip" dest="./" skipexisting="false"/>
  37. <unzip src="platform-base.zip" dest="./"/>
  38. <antcall target="-update-sdk-platform-config"/>
  39. <delete file="platform-base.zip"/>
  40. </target>
  41. <target name="-check-platform-present">
  42. <available file="netbeans" property="platform.present"/>
  43. </target>
  44. <target name="-remove-platform">
  45. <delete dir="netbeans" failonerror="false"/>
  46. </target>
  47. <target name="-update-sdk-platform-config">
  48. <property name="nbplatform.dir" location="netbeans"/>
  49. <mkdir dir="sdk/nbproject/private"/>
  50. <echo file="sdk/nbproject/private/platform-private.properties"
  51. message="nbplatform.default.netbeans.dest.dir=${nbplatform.dir}&#xD;&#xA;"/>
  52. <echo file="sdk/nbproject/private/platform-private.properties"
  53. message="nbplatform.default.harness.dir=${nbplatform.dir}${file.separator}harness&#xD;&#xA;" append="true"/>
  54. <replace file="sdk/nbproject/private/platform-private.properties" token="\" value="\\"/>
  55. </target>
  56. <!--
  57. ****************************************************************
  58. Only Relevant for building nightly on Hudson server from here on
  59. ****************************************************************
  60. -->
  61. <target name="hudson-nightly" depends="-check-platform, -update-sdk-platform-config">
  62. <exec executable="svn" dir="engine">
  63. <arg value="cleanup" />
  64. </exec>
  65. <exec executable="svn" dir="engine">
  66. <arg value="revert" />
  67. </exec>
  68. <exec executable="svn" dir="engine">
  69. <arg value="cleanup" />
  70. </exec>
  71. <exec executable="svn" dir="engine">
  72. <arg value="update" />
  73. </exec>
  74. <ant dir="engine" target="dist"/>
  75. <ant dir="engine" target="build-bullet-natives"/>
  76. <ant dir="engine" target="update-sdk"/>
  77. <ant dir="engine" target="copy-javadoc"/>
  78. <ant dir="sdk" target="hudson-nightly"/>
  79. </target>
  80. <target name="hudson-stable" depends="-check-platform, -update-sdk-platform-config">
  81. <exec executable="svn" dir="engine">
  82. <arg value="cleanup" />
  83. </exec>
  84. <exec executable="svn" dir="engine">
  85. <arg value="revert" />
  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. <ant dir="engine" target="dist"/>
  94. <ant dir="engine" target="build-bullet-natives"/>
  95. <ant dir="engine" target="update-sdk"/>
  96. <ant dir="sdk" target="hudson-stable"/>
  97. </target>
  98. </project>