build.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <project name="extjs" default="build" basedir=".">
  2. <target name="init-antcontrib">
  3. <taskdef resource="net/sf/antcontrib/antlib.xml">
  4. <classpath>
  5. <pathelement location="${cmd.dir}/lib/ant-contrib-1.0b3.jar"/>
  6. <pathelement
  7. location="${cmd..dir}/lib/commons-httpclient-3.0.1.jar"/>
  8. <pathelement
  9. location="${cmd.dir}/lib/commons-logging-1.0.4.jar"/>
  10. <pathelement location="${cmd.dir}/lib/commons-codec-1.3.jar"/>
  11. </classpath>
  12. </taskdef>
  13. </target>
  14. <target name="init-sencha-cmd" depends="init-antcontrib">
  15. <taskdef resource="com/sencha/ant/antlib.xml" classpath="${cmd.dir}/sencha.jar"/>
  16. </target>
  17. <target name="build" depends="init-sencha-cmd">
  18. <property name="build.dir" location="${basedir}"/>
  19. <!--
  20. Produce base concatenation for standard distribution files
  21. -->
  22. <x-sencha-command>
  23. compile
  24. --ignore=diag
  25. --options=debug:true
  26. concatenate
  27. -out=${build.dir}/ext-all-dev.js
  28. and
  29. concatenate
  30. -sandbox=Ext4:x4-
  31. -out=${build.dir}/builds/ext-all-sandbox-dev.js
  32. and
  33. union
  34. -tag=core
  35. and
  36. concatenate
  37. -out=${build.dir}/ext-dev.js
  38. and
  39. concatenate
  40. -out=${build.dir}/builds/ext-core-dev.js
  41. and
  42. union
  43. -tag=foundation
  44. and
  45. concatenate
  46. -out=${build.dir}/builds/ext-foundation-dev.js
  47. and
  48. include
  49. -all
  50. and
  51. --options=debug:false
  52. concatenate
  53. -out=${build.dir}/ext-all-debug-w-comments.js
  54. and
  55. concatenate
  56. -sandbox=Ext4:x4-
  57. -out=${build.dir}/builds/ext-all-sandbox-debug-w-comments.js
  58. and
  59. union
  60. -tag=core
  61. and
  62. concatenate
  63. -out=${build.dir}/ext-debug-w-comments.js
  64. and
  65. concatenate
  66. -out=${build.dir}/builds/ext-core-debug-w-comments.js
  67. and
  68. union
  69. -tag=foundation
  70. and
  71. concatenate
  72. -out=${build.dir}/builds/ext-foundation-debug-w-comments.js
  73. and
  74. union
  75. -not
  76. -tag=${build.dir}/core
  77. and
  78. metadata
  79. +append
  80. +alternates
  81. -base-path=${build.dir}
  82. -output-file=${build.dir}/ext-debug-w-comments.js
  83. and
  84. metadata
  85. +append
  86. +alternates
  87. -base-path=${build.dir}
  88. -output-file=${build.dir}/ext-dev.js
  89. and
  90. metadata
  91. +append
  92. +alias
  93. --base-path=${build.dir}
  94. --output-file=${build.dir}/ext-debug-w-comments.js
  95. and
  96. metadata
  97. +append
  98. +alias
  99. --base-path=${build.dir}
  100. --output-file=${build.dir}/ext-dev.js
  101. </x-sencha-command>
  102. <loadfile property="header.text" srcfile="${build.dir}/license.txt"/>
  103. <property name="header.comment" value="/*&#10;${header.text}&#10;*/&#10;"/>
  104. <!--
  105. Strip comments from uncompressed builds
  106. -->
  107. <x-strip-js srcfile="${build.dir}/ext-all-debug-w-comments.js"
  108. outfile="${build.dir}/ext-all-debug.js"/>
  109. <x-strip-js srcfile="${build.dir}/ext-debug-w-comments.js"
  110. outfile="${build.dir}/ext-debug.js"/>
  111. <x-strip-js srcfile="${build.dir}/builds/ext-core-debug-w-comments.js"
  112. outfile="${build.dir}/builds/ext-core-debug.js"/>
  113. <x-strip-js srcfile="${build.dir}/builds/ext-foundation-debug-w-comments.js"
  114. outfile="${build.dir}/builds/ext-foundation-debug.js"/>
  115. <x-strip-js srcfile="${build.dir}/builds/ext-all-sandbox-debug-w-comments.js"
  116. outfile="${build.dir}/builds/ext-all-sandbox-debug.js"/>
  117. <!--
  118. Apply yui compressor
  119. -->
  120. <x-compress-js
  121. srcfile="${build.dir}/ext-all-debug.js"
  122. outfile="${build.dir}/ext-all.js"/>
  123. <x-compress-js
  124. srcfile="${build.dir}/ext-debug.js"
  125. outfile="${build.dir}/ext.js"/>
  126. <x-compress-js
  127. srcfile="${build.dir}/builds/ext-core-debug.js"
  128. outfile="${build.dir}/builds/ext-core.js"/>
  129. <x-compress-js
  130. srcfile="${build.dir}/builds/ext-foundation-debug.js"
  131. outfile="${build.dir}/builds/ext-foundation.js"/>
  132. <x-compress-js
  133. srcfile="${build.dir}/builds/ext-all-sandbox-debug.js"
  134. outfile="${build.dir}/builds/ext-all-sandbox.js"/>
  135. <!--
  136. Add license headers
  137. -->
  138. <for param="file">
  139. <path>
  140. <fileset dir="${build.dir}" includes="*.js"/>
  141. <fileset dir="${build.dir}/builds" includes="*.js"/>
  142. </path>
  143. <sequential>
  144. <move file="@{file}" tofile="@{file}.tmp"/>
  145. <concat destfile="@{file}">
  146. <header>${header.comment}</header>
  147. <fileset file="@{file}.tmp"/>
  148. </concat>
  149. <delete file="@{file}.tmp"/>
  150. </sequential>
  151. </for>
  152. </target>
  153. </project>