Guest User

Untitled

a guest
Feb 20th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. <target name="compress" depends="-fix-config, list-profile-deps"
  2. description="runs compression code over release JS files">
  3. <echo>profileFile: ${profileFile}</echo>
  4.  
  5. <!-- Create the release dir if it doesn't exist. -->
  6. <mkdir dir="${release_dir}"/>
  7. <!-- write the list of files included to the release directory -->
  8. <echo file="${release_dir}/build.txt">
  9. Files baked into this package:
  10.  
  11. ${profileDeps}
  12.  
  13. </echo>
  14.  
  15. <!-- now write 'em all to a single file -->
  16. <concat fixlastline="yes" eol="crlf" destfile="${release_dir}/source.__package__.js">
  17. <!--
  18. <concat fixlastline="yes" eol="crlf" destfile="${release_dir}/dojo.js">
  19. -->
  20. <filelist
  21. dir="."
  22. files="${profileDeps}" />
  23. </concat>
  24. <!--
  25. clobber requireIf and requireAfterIf statements since they
  26. aren't applicable in build
  27. -->
  28. <replaceregexp match="dojo.requireIf\((.*?)\);"
  29. byline="true" flags="g" file="${release_dir}/source.__package__.js">
  30. <substitution expression=""/>
  31. </replaceregexp>
  32.  
  33. <replaceregexp match="dojo.requireAfterIf\((.*?)\);"
  34. byline="true" flags="g" file="${release_dir}/source.__package__.js">
  35. <substitution expression=""/>
  36. </replaceregexp>
  37.  
  38. <!-- Set the version number -->
  39. <script language="jython"><![CDATA[
  40. import sys
  41. # make the python standard library avialable
  42. sys.path.append("lib/pyLib.zip")
  43. sys.path.append(".")
  44.  
  45. # import re
  46. import os
  47. from buildUtil import *
  48.  
  49. print "Setting version for Dojo to: " + dojo.getProperty("version")
  50. replaceVersion(dojo.getProperty("release_dir") + "/source.__package__.js", dojo.getProperty("version"))
  51. print "Removing dojo.require calls in source.__package__.js."
  52. removeRequires(dojo.getProperty("release_dir") + "/source.__package__.js")
  53. ]]></script>
  54.  
  55. <antcall target="-rhino-compress">
  56. <param name="srcFile" value="${release_dir}/source.__package__.js" />
  57. <param name="dstFile" value="${release_dir}/dojo.js" />
  58. </antcall>
  59.  
  60. <antcall target="-no-rhino-compress">
  61. <param name="srcFile" value="${release_dir}/source.__package__.js" />
  62. <param name="dstFile" value="${release_dir}/dojo.js" />
  63. </antcall>
  64.  
  65. <!--
  66. <java jar="./lib/custom_rhino.jar" fork="true" output="${release_dir}/__package__.js">
  67. <arg value="-c" />
  68. <arg value="${release_dir}/source.__package__.js" />
  69. </java>
  70. -->
  71.  
  72. <!-- add build notice -->
  73. <replaceregexp match="^" byline="false" replace="${build_notice}">
  74. <fileset dir="${release_dir}" includes="dojo.js"/>
  75. </replaceregexp>
  76.  
  77.  
  78. <!-- add copyright notice -->
  79. <replaceregexp match="^" byline="false" replace="${copyright}">
  80. <fileset dir="${release_dir}">
  81. <include name="**/*.js" />
  82. <include name="**/*.as" />
  83. <not>
  84. <contains text="copyright" casesensitive="no" />
  85. </not>
  86. </fileset>
  87. </replaceregexp>
  88.  
  89. <delete file="${release_dir}/source.__package__.js"/>
  90.  
  91. <!-- we copy over iframe_history.html here just in case this is a truly
  92. stand-alone build that isn't being kicked off via release -->
  93. <copy file="../iframe_history.html" todir="${release_dir}/" />
  94.  
  95. <replaceregexp match="\t" flags="g" replace=" ">
  96. <fileset dir="${release_dir}">
  97. <include name="dojo.js"/>
  98. <include name="dojo.js.uncompressed.js"/>
  99. </fileset>
  100. </replaceregexp>
  101. </target>
Add Comment
Please, Sign In to add comment