<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Herbert Yang &#187; Ant</title>
	<atom:link href="http://www.herbertyang.com/tag/ant/feed" rel="self" type="application/rss+xml" />
	<link>http://www.herbertyang.com</link>
	<description></description>
	<lastBuildDate>Wed, 13 Jul 2011 07:02:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>ANT自动化压缩合并JS/CSS和更改版本号</title>
		<link>http://www.herbertyang.com/2010/07/20/ant-automatic-compression-js-css-and-change-the-version-number-2.html</link>
		<comments>http://www.herbertyang.com/2010/07/20/ant-automatic-compression-js-css-and-change-the-version-number-2.html#comments</comments>
		<pubDate>Tue, 20 Jul 2010 13:19:40 +0000</pubDate>
		<dc:creator>Herbert</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Ant]]></category>

		<guid isPermaLink="false">http://www.herbertyang.com/?p=604</guid>
		<description><![CDATA[最近做到了前端优化的一些工作，涉及到了自动化部署的问题。前端优化无非是雅虎的优化法则，不过如果想把优化法则加到自动化部署中去的话，下面的几种方法可以帮助你。 1、JS/CSS压缩脚本 &#60;!-- 压缩JS，CSS --&#62; &#60;target name=&#34;compress&#34;&#62; &#60;apply executable=&#34;java&#34; parallel=&#34;false&#34; failonerror=&#34;true&#34;&#62; &#60;fileset dir=&#34;${html-js}&#34; includes=&#34;**/*.js&#34; /&#62; &#60;arg line=&#34;-jar&#34; /&#62; &#60;arg path=&#34;${yui-compressor}&#34; /&#62; &#60;arg line=&#34;--charset utf-8&#34; /&#62; &#60;srcfile /&#62; &#60;arg line=&#34;-o&#34; /&#62; &#60;mapper type=&#34;glob&#34; from=&#34;*.js&#34; to=&#34;${webhtml-js}/*-min.js&#34; /&#62; &#60;targetfile /&#62; &#60;/apply&#62; &#60;apply executable=&#34;java&#34; parallel=&#34;false&#34; failonerror=&#34;true&#34;&#62; &#60;fileset dir=&#34;${html-css}&#34; includes=&#34;**/*.css&#34; /&#62; &#60;arg line=&#34;-jar&#34; /&#62; &#60;arg path=&#34;${yui-compressor}&#34; /&#62; &#60;arg line=&#34;--charset utf-8&#34;]]></description>
			<content:encoded><![CDATA[<p>最近做到了前端优化的一些工作，涉及到了自动化部署的问题。前端优化无非是雅虎的优化法则，不过如果想把优化法则加到自动化部署中去的话，下面的几种方法可以帮助你。<br />
<strong>1、JS/CSS压缩脚本</strong></p>
<pre class="brush: xml; title: ;">
	&lt;!-- 压缩JS，CSS --&gt;
	&lt;target name=&quot;compress&quot;&gt;
		&lt;apply executable=&quot;java&quot; parallel=&quot;false&quot; failonerror=&quot;true&quot;&gt;
			&lt;fileset dir=&quot;${html-js}&quot; includes=&quot;**/*.js&quot; /&gt;
			&lt;arg line=&quot;-jar&quot; /&gt;
			&lt;arg path=&quot;${yui-compressor}&quot; /&gt;
			&lt;arg line=&quot;--charset utf-8&quot; /&gt;
			&lt;srcfile /&gt;
			&lt;arg line=&quot;-o&quot; /&gt;
			&lt;mapper type=&quot;glob&quot; from=&quot;*.js&quot; to=&quot;${webhtml-js}/*-min.js&quot; /&gt;
			&lt;targetfile /&gt;
		&lt;/apply&gt;
		&lt;apply executable=&quot;java&quot; parallel=&quot;false&quot; failonerror=&quot;true&quot;&gt;
			&lt;fileset dir=&quot;${html-css}&quot; includes=&quot;**/*.css&quot; /&gt;
			&lt;arg line=&quot;-jar&quot; /&gt;
			&lt;arg path=&quot;${yui-compressor}&quot; /&gt;
			&lt;arg line=&quot;--charset utf-8&quot; /&gt;
			&lt;srcfile /&gt;
			&lt;arg line=&quot;-o&quot; /&gt;
			&lt;mapper type=&quot;glob&quot; from=&quot;*.css&quot; to=&quot;${webhtml-css}/*-min.css&quot; /&gt;
			&lt;targetfile /&gt;
		&lt;/apply&gt;
	&lt;/target&gt;
</pre>
<p><strong>2、更新JSS/CSS版本号</strong></p>
<pre class="brush: xml; title: ;">
	&lt;!-- 更新静态文件的版本号 --&gt;
	&lt;target name=&quot;version&quot;&gt;
		&lt;tstamp&gt;
			&lt;format property=&quot;TIMESTAMP&quot; pattern=&quot;yyyyMMddHHmmss&quot; locale=&quot;en&quot; /&gt;
		&lt;/tstamp&gt;
		&lt;loadfile property=&quot;svn.version&quot; srcFile=&quot;./.svn/entries&quot;&gt;
			&lt;filterchain&gt;
				&lt;headfilter lines=&quot;1&quot; skip=&quot;3&quot; /&gt;
				&lt;deletecharacters chars=&quot;\n&quot; /&gt;
			&lt;/filterchain&gt;
		&lt;/loadfile&gt;
		&lt;delete file=&quot;${webinf-ftl}/config.ftl&quot;/&gt;
		&lt;copy file=&quot;${ftl-app}/config.ftl&quot; tofile=&quot;${webinf-ftl}/config.ftl&quot; /&gt;
		&lt;replace file=&quot;${webinf-ftl}/config.ftl&quot; token=&quot;$version$&quot; value=&quot;${svn.version}&quot; /&gt;
	&lt;/target&gt;
</pre>
<p>接下来就是合并JS/CSS文件</p>
<pre class="brush: xml; title: ;">
	&lt;!-- 合并静态文件 --&gt;
	&lt;target name=&quot;js-concat&quot;&gt;
		&lt;concat destfile=&quot;${webhtml-js}/jquery.js&quot; encoding=&quot;utf-8&quot; append=&quot;false&quot;&gt;
			&lt;path path=&quot;${webhtml-js}/jquery.core-min.js&quot; /&gt;
			&lt;path path=&quot;${webhtml-js}/jquery.cookie-min.js&quot; /&gt;
			&lt;path path=&quot;${webhtml-js}/jquery.timeago-min.js&quot; /&gt;
			&lt;path path=&quot;${webhtml-js}/jquery.utils-min.js&quot; /&gt;
			&lt;path path=&quot;${webhtml-js}/jquery.watermarkinput-min.js&quot; /&gt;
		&lt;/concat&gt;
	&lt;/target&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.herbertyang.com/2010/07/20/ant-automatic-compression-js-css-and-change-the-version-number-2.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>使用Ant根据操作系统不同复制到不同目录</title>
		<link>http://www.herbertyang.com/2009/08/22/different-depending-on-your-operating-system-to-use-ant-to-copy-to-a-different-directory.html</link>
		<comments>http://www.herbertyang.com/2009/08/22/different-depending-on-your-operating-system-to-use-ant-to-copy-to-a-different-directory.html#comments</comments>
		<pubDate>Sat, 22 Aug 2009 12:35:33 +0000</pubDate>
		<dc:creator>Herbert</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ant]]></category>

		<guid isPermaLink="false">http://blog.shishuo.com/?p=340</guid>
		<description><![CDATA[&#60;condition property=&#34;release-path&#34; value=&#34;${windows-webroot}&#34; else=&#34;${linux-webroot}&#34;&#62; &#60;os family=&#34;windows&#34; /&#62; &#60;/condition&#62; &#60;copy todir=&#34;${release-path}&#34;&#62; &#60;fileset dir=&#34;${webroot}&#34; /&#62; &#60;/copy&#62;]]></description>
			<content:encoded><![CDATA[<pre class="brush: xml; title: ;">&lt;condition property=&quot;release-path&quot; value=&quot;${windows-webroot}&quot; else=&quot;${linux-webroot}&quot;&gt;
 &lt;os family=&quot;windows&quot; /&gt;
 &lt;/condition&gt;
 &lt;copy todir=&quot;${release-path}&quot;&gt;
 &lt;fileset dir=&quot;${webroot}&quot; /&gt;
 &lt;/copy&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.herbertyang.com/2009/08/22/different-depending-on-your-operating-system-to-use-ant-to-copy-to-a-different-directory.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

