build.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--*************************************************************************
  3. Filename : build.xml
  4. Project : proj4js
  5. Document Type : XML
  6. Purpose : build file for ant tool
  7. Author Date Description
  8. M.Adair 17-Dec-2001 initial version copied from mapbuilder
  9. $Id: build.xml 2955 2007-07-09 12:12:27Z steven $
  10. ***************************************************************************--><!--
  11. -->
  12. <!-- A "project" describes a set of targets that may be requested
  13. when Ant is executed. The "default" attribute defines the
  14. target which is executed if no specific target is requested,
  15. and the "basedir" attribute defines the current working directory
  16. from which Ant executes the requested task. This is normally
  17. set to the current working directory.
  18. -->
  19. <project basedir=".." default="dist" name="proj4js">
  20. <!-- ===================== Property Definitions =========================== -->
  21. <!--
  22. Each of the following properties are used in the build script.
  23. Values for these properties are set by the first place they are
  24. defined, from the following list:
  25. * Definitions on the "ant" command line (ant -Dfoo=bar compile).
  26. * Definitions from a "build.properties" file in the top level
  27. source directory of this application.
  28. * Definitions from a "build.properties" file in the developer's
  29. home directory.
  30. * Default definitions in this build.xml file.
  31. You will note below that property values can be composed based on the
  32. contents of previously defined properties. This is a powerful technique
  33. that helps you minimize the number of changes required when your development
  34. environment is modified. Note that property composition is allowed within
  35. "build.properties" files as well as in the "build.xml" script.
  36. -->
  37. <property file="build.properties"/>
  38. <property file="${user.home}/build.properties"/>
  39. <property file="default.properties"/>
  40. <!-- ==================== File and Directory Names ======================== -->
  41. <!--
  42. These properties generally define file and directory names (or paths) that
  43. affect where the build process stores its outputs.
  44. app.name Base name of this application, used to
  45. construct filenames and directories.
  46. Defaults to "myapp".
  47. app.path Context path to which this application should be
  48. deployed (defaults to "/" plus the value of the
  49. "app.name" property).
  50. app.version Version number of this iteration of the application.
  51. build.home The directory into which the "prepare" and
  52. "compile" targets will generate their output.
  53. Defaults to "build".
  54. dist.home The name of the base directory in which
  55. distribution files are created.
  56. Defaults to "dist".
  57. -->
  58. <property environment="env"/>
  59. <property name="app.name" value="proj4js"/>
  60. <property name="app.path" value="/${app.name}"/>
  61. <property name="app.version" value="1.1.0"/>
  62. <property name="build.home" value="${basedir}/tempBuild"/>
  63. <property name="dist.home" value="${basedir}/dist"/>
  64. <property name="docs.home" value="${build.home}/docs"/>
  65. <!-- ==================== Prepare Target ================================== -->
  66. <!--
  67. The "prepare" target is used to create the "build" destination directory,
  68. and copy the static contents of your web application to it. If you need
  69. to copy static files from external dependencies, you can customize the
  70. contents of this task.
  71. Normally, this task is executed indirectly when needed.
  72. -->
  73. <target name="prepare">
  74. <!-- Create build directories as needed -->
  75. <mkdir dir="${build.home}"/>
  76. <!-- Copy static content of the mapbuilder project -->
  77. <copy todir="${build.home}">
  78. <fileset dir="${basedir}" excludes="tools/*.pyc "
  79. includes="index.html
  80. lib/proj4js.js,
  81. lib/proj4js-combined.js
  82. lib/proj4js-compressed.js
  83. lib/defs/**
  84. lib/projCode/**
  85. lib/util/**
  86. build/**
  87. demo/**
  88. test/**
  89. tools/**"
  90. />
  91. </copy>
  92. </target>
  93. <!-- ==================== Clean Target ==================================== -->
  94. <!--
  95. The "clean" target deletes any previous "build" and "dist" directory,
  96. so that you can be ensured the application can be built from scratch.
  97. -->
  98. <target description="Delete old build and dist directories" name="clean">
  99. <delete dir="${build.home}"/>
  100. <delete dir="${dist.home}"/>
  101. </target>
  102. <!-- ==================== Documentation =================================== -->
  103. <target description="Create documentation" name="docs" depends="prepare">
  104. <mkdir dir="${build.home}/docs"/>
  105. <mkdir dir="${build.home}/docs/NaturalDocs"/>
  106. <echo message="Generating documentation"/>
  107. <exec executable="cmd" os="Windows XP" dir="${build.home}">
  108. <arg line="/c perl C:\Progra~1\NaturalDocs\NaturalDocs -i ./lib -o html ./docs/NaturalDocs -p ./docs/NaturalDocs -r"/>
  109. </exec>
  110. </target>
  111. <!-- ==================== Dist Target ===================================== -->
  112. <!--
  113. The "dist" target creates the zip file distribution for the Apache/PHP
  114. environment.
  115. -->
  116. <target name="dist" description="Create binary distribution" depends="clean,prepare,docs">
  117. <mkdir dir="${dist.home}"/>
  118. <!-- Create application zip file -->
  119. <zip destfile="${dist.home}/${app.name}-${app.version}.zip" update="true">
  120. <zipfileset dir="${build.home}" prefix="proj4js"/>
  121. </zip>
  122. </target>
  123. </project>