build.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="TEMPLATE_PROJECT" default="help">
  3. <property file="local.properties" />
  4. <property file="ant.properties" />
  5. <loadproperties srcFile="project.properties" />
  6. <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project -t 1 -p . -s'" unless="sdk.dir"/>
  7. <fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
  8. <condition>
  9. <not>
  10. <or>
  11. <os family="unix"/>
  12. <os family="windows"/>
  13. </or>
  14. </not>
  15. </condition>
  16. </fail>
  17. <macrodef name="build-native">
  18. <attribute name="location"/>
  19. <sequential>
  20. <exec osfamily="unix" dir="@{location}/android" executable="ndk-build">
  21. <arg value="-j4"/>
  22. </exec>
  23. <exec osfamily="windows" dir="@{location}/android" executable="cmd">
  24. <arg value="/c"/>
  25. <arg value="ndk-build -j4"/>
  26. </exec>
  27. </sequential>
  28. </macrodef>
  29. <target name="-pre-build">
  30. <build-native location="../GAMEPLAY_PATH/gameplay"/>
  31. <build-native location=".."/>
  32. <mkdir dir="../src/org/gameplay3d"/>
  33. <copy todir="../src/org/gameplay3d">
  34. <fileset dir="../GAMEPLAY_PATH/gameplay/src/org/gameplay3d"/>
  35. </copy>
  36. </target>
  37. <target name="-post-compile">
  38. <copy todir="assets/res">
  39. <fileset dir="../res" />
  40. </copy>
  41. <copy todir="assets/res/shaders">
  42. <fileset dir="../GAMEPLAY_PATH/gameplay/res/shaders" />
  43. </copy>
  44. <copy todir="assets/res/ui">
  45. <fileset dir="../GAMEPLAY_PATH/gameplay/res/ui" />
  46. </copy>
  47. </target>
  48. <!-- version-tag: 1 -->
  49. <import file="${sdk.dir}/tools/ant/build.xml" />
  50. </project>