📜 ⬆️ ⬇️

Automate client optimization

Prehistory

As you know, before you put the site in no, we develop it. And we do it, oddly enough, on the developer's machine. And it has long been noted that javascript, and in some cases, css is more convenient to keep in development in several files. The problem is that, according to the principles described in the article Best Practices for Speech Up Your Web Site To speed up the loading of the site, we need to perform the following manipulations on javascript and css files:
  1. Merge all javascript into one file, and, preferably, so that the necessary order is preserved - that is, say, the jQuery library - was closer to the beginning, and the functions and objects that use it - after it.
  2. Merge all css into one file
  3. Compress these large files using some utility like yui-compressor (except for css-files whose name begins, say, with the prefix ie_, which contain data: URL, and therefore are critical for switching from line to line, so their own peace of mind is better not to compress)
  4. Arrange them in this order - the css-file is as close as possible to the opening head tag, and the js-file is as close as possible to the closing body tag.
  5. Set the expires HTTP header to last for the user’s browser to cache. Well, in order to update js and css for the next build, you need to give these files some unique name.
  6. Compress files with gzip before giving out files to the client.

Why am I doing this?

Items 5 and 6 are already detailed in other places .
I want to consider in this article the question of automating items 1,2,3,4. Or rather, I want to offer a tool with which one (well, a maximum of two or three :) pressing the button can execute items 1, 2, 3, 4 of this list and get javascript and css files ready for uploading to the server.

Tools

Script Algorithm

  1. Download and unpack JSLint4Java and YUI Compressor, put them in the tools folder inside the project. It is more correct, of course, to put it somewhere in the place defined by the system variable, something like $ TOOLS_LOCATION, but in the demo script it will come down, and you will correct the script for yourself as you need.
  2. We set JSLint4Java on all js-files. If JSLint finds any error, output it to the screen and stop the script execution.
  3. We merge all js-files, except for those in whose name there is a phrase test, into one file with a unique name, while keeping the order of the files, which we define somewhere else. As a unique name, let's take the following construction: main.hh.dd.MM.yy.js, where hh, dd, MM, yy, respectively, the current hour, day, month, year.
  4. Merge all css-files, except for those whose name begins with ie_ in one file with a unique name (the name is the same as in the previous paragraph, only the extension will change to `css`). The order in this case is not important.
  5. We set on the resulting files YUI Compressor. If an error occurred during compression, we display an error and stop the script execution.
  6. In the html template, which connects all the style files, we delete all link tags, except for those in the src of which the ie_ files and those that contain style rules are specified, and not the external css file is attached using the src attribute.
  7. In the same template, delete all script tags, except for those that contain javascript code (and do not include an external script file through the src attribute).
  8. In the same template, write the resulting css-file as close as possible to the opening head tag.
  9. In the same template, write the resulting js-file as close as possible to the closing tag of the body or the opening tag of the script, the resulting js-file ... This strange behavior is needed for this: suppose that we registered some library functions in the js-file, but right In the html file, we initialize the js objects with some data right in the server-side code. For this we need to save the script tag, as well as connect the resulting js file to it.
  10. We post the resulting js, css, html files in any directory.

Implementation example

<? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  1. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  2. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  3. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  4. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  5. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  6. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  7. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  8. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  9. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  10. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  11. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  12. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  13. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  14. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  15. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  16. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  17. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  18. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  19. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  20. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  21. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  22. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  23. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  24. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  25. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  26. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  27. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  28. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  29. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  30. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  31. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  32. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  33. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  34. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  35. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  36. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  37. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  38. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  39. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  40. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  41. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  42. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  43. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  44. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  45. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  46. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  47. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  48. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  49. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  50. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  51. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  52. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  53. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  54. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  55. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  56. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  57. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  58. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  59. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  60. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  61. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  62. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  63. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  64. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  65. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  66. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  67. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  68. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  69. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  70. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  71. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  72. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  73. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  74. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  75. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  76. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  77. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  78. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  79. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  80. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  81. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  82. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  83. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  84. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  85. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  86. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  87. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  88. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  89. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  90. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  91. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  92. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  93. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  94. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  95. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  96. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  97. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  98. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  99. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  100. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  101. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  102. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  103. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  104. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  105. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  106. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  107. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  108. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  109. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  110. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  111. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  112. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  113. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  114. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  115. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  116. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  117. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  118. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  119. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  120. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  121. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  122. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  123. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  124. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  125. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  126. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  127. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  128. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  129. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  130. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  131. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  132. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  133. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  134. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  135. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  136. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  137. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  138. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  139. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  140. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  141. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  142. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  143. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  144. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  145. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  146. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  147. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  148. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
  149. <? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
<? xml version ="1.0" encoding ="UTF-8" ? > < project name ="production-build" default ="build" basedir ="." > <!-- , yui-compressor jslint4java --> < property name ="tools.location" value ="tools/" /> <!-- yui compressor' , , jar- --> < property name ="yuicompressor-version" value ="2.4" /> < property name ="yuicompressor-zip" value ="yuicompressor-${yuicompressor-version}.zip" /> < property name ="yuicompressor-unzip-dir" value ="yuicompressor-${yuicompressor-version}" /> < property name ="yuicompressor-location" value ="http://www.julienlecomte.net/yuicompressor/" /> < property name ="yuicompressor-jar" value ="yuicompressor-${yuicompressor-version}.jar" /> <!-- jslint4java , , jar- --> < property name ="jslint-version" value ="1.2.1" /> < property name ="jslint-location" value ="http://jslint4java.googlecode.com/files/" /> < property name ="jslint-zip" value ="jslint4java-${jslint-version}.zip" /> < property name ="jslint-jar" value ="jslint4java-${jslint-version}+rhino.jar" /> < property name ="jslint-unzip-dir" value ="jslint4java-${jslint-version}" /> <!-- js-, css-, html- --> < property environment ="env" /> < property name ="js.src" value ="js/" /> < property name ="css.src" value ="css/" /> < property name ="template.name" value ="index.html" /> < property name ="template" value ="${template.name}" /> <!-- --> < property name ="output.dir" value ="build/" /> < property name ="js.out" value ="${output.dir}/js/" /> < property name ="css.out" value ="${output.dir}/css/" /> < property name ="template.out" value ="${output.dir}/${template.name}" /> <!-- js-. js- --> <!-- --> < property name ="js-required-file-order" value ="jquery-1.2.6.js, some_object.js" /> <!-- --> < target name ="init" > < tstamp > <!-- mm-hh-MM-dd-yyyy --> < format property ="build-time" pattern ="mm-hh-MM-dd-yyyy" /> </ tstamp > <!-- , yui compressor jslint4java --> < mkdir dir ="${tools.location}" /> </ target > < target name ="prepare-tools" depends ="init" > <!-- jslint yui compressor --> < antcall target ="prepare-yuicompressor" /> < antcall target ="prepare-jslint" /> </ target > <!-- jslint --> < target name ="prepare-jslint" depends ="check-if-jslint-exists" unless ="jslint.exist" > < get src ="${jslint-location}${jslint-zip}" dest ="${tools.location}${jslint-zip}" verbose ="true" /> < unzip src ="${tools.location}${jslint-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${jslint-unzip-dir}/${jslint-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${jslint-unzip-dir}" /> < delete file ="${tools.location}${jslint-zip}" /> </ target > <!-- , jslint - js- --> < target name ="check-if-jslint-exists" > < condition property ="jslint.exist" > < and > < available file ="${tools.location}${jslint-jar}" /> </ and > </ condition > </ target > <!-- jslint --> < target name ="prepare-yuicompressor" depends ="check-if-yuicompressor-exists" unless ="yuicompressor.exist" > < get src ="${yuicompressor-location}${yuicompressor-zip}" dest ="${tools.location}${yuicompressor-zip}" verbose ="true" /> < unzip src ="${tools.location}${yuicompressor-zip}" dest ="${tools.location}" /> < copy file ="${tools.location}${yuicompressor-unzip-dir}/build/${yuicompressor-jar}" todir ="${tools.location}" /> < delete dir ="${tools.location}${yuicompressor-unzip-dir}" /> < delete file ="${tools.location}${yuicompressor-zip}" /> </ target > <!-- , jslint - js/css- --> < target name ="check-if-yuicompressor-exists" > < condition property ="yuicompressor.exist" > < and > < available file ="${tools.location}${yuicompressor-jar}" /> </ and > </ condition > </ target > <!-- javascript --> < target name ="validate-javascript" depends ="prepare-tools" > < apply executable ="java" parallel ="false" failonerror ="false" > < fileset dir ="${js.src}" > < include name ="**/*.js" /> <!-- , --> < exclude name ="**/jquery-1.2.6.js" /> </ fileset > < arg value ="-jar" /> < arg file ="${tools.location}${jslint-jar}" /> < arg value ="--bitwise" /> < arg value ="--browser" /> < arg value ="--undef" /> < arg value ="--widget" /> < srcfile /> </ apply > </ target > <!-- js/css- --> < target name ="compress" depends ="prepare-tools, concatenate-files" > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${js.out}" verbose ="true" force ="true" > < fileset dir ="${js.out}" includes ="*.js" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 8000" /> < arg line ="-o" /> < targetfile /> < srcfile /> < mapper type ="glob" from ="*.js" to ="*.js" /> </ apply > < apply executable ="java" parallel ="false" failonerror ="true" dest ="${css.out}" verbose ="true" force ="true" > < fileset dir ="${css.out}" includes ="*.css" excludes ="ie_*.css" /> < arg line ="-jar" /> < arg path ="${tools.location}${yuicompressor-jar}" /> < arg line ="--line-break 0" /> < srcfile /> < arg line ="-o" /> < mapper type ="glob" from ="*.css" to ="*.css" /> < targetfile /> </ apply > </ target > <!-- css js , --> < target name ="update-tags" depends ="prepare-tools" > < copy file ="${template}" tofile ="${template.out}" overwrite ="true" /> < replaceregexp file ="${template.out}" match ="<script\s+type="text/javascript"\s+src="[A-Za-z0-9._\-/]*"></script>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="(<script*|</body>)" flags ="im" replace ="<script type="text/javascript" src="js/main-${build-time}.js"></script>${line.separator}\1" /> < replaceregexp file ="${template.out}" match ="<link[^>]*href="css/[^i>]{1}[^e>]{1}[^_>]{1}[^>]*/>" flags ="igm" replace ="" /> < replaceregexp file ="${template.out}" match ="</head>" flags ="im" replace ="<link rel="stylesheet" href="css/main-${build-time}.css" type="text/css" /></head>" /> </ target > <!-- --> < target name ="concatenate-files" depends ="update-tags" > < concat destfile ="${js.out}/main-${build-time}.js" fixlastline ="true" > < filelist dir ="${js.src}" files ="${js-required-file-order}" /> < fileset dir ="${js.src}" includes ="**/*.js" excludes ="${js-required-file-order}" /> </ concat > < copy todir ="${css.out}" > < fileset dir ="${css.src}" includes ="**/ie_*.css" /> </ copy > < concat destfile ="${css.out}/main-${build-time}.css" fixlastline ="true" > < fileset dir ="${css.src}" includes ="**/*.css" excludes ="**/ie_*.css" /> </ concat > </ target > <!-- --> < target name ="build" > < mkdir dir ="${output.dir}" /> < antcall target ="validate-javascript" /> < antcall target ="compress" /> </ target > </ project > * This source code was highlighted with Source Code Highlighter .
Just in case, example: ant1

Todo

  1. Not too beautiful is the indication of the order of the concatenation of js-files directly in the script. It would be much better if we wrote something like <% javascript: {first: jquery, last: initialize}%> directly in html. With development build, the script would replace this line with several script-tags (convenient for debug-a), and on production, would merge the files into one in the specified order.
  2. Downloading files using ant does not say that it is very convenient - and what if a new version comes out or the download link changes? It is much more convenient to use maven 'om for such cases.
  3. Complete :)
PS crosspost in my blog.

')

Source: https://habr.com/ru/post/45480/


All Articles