<?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>yuicompressor | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/yuicompressor/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Fri, 11 Feb 2011 15:06:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>3 x YuiCompressor im Deploy</title>
		<link>https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/</link>
					<comments>https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Fri, 11 Feb 2011 15:06:26 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[yuicompressor]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1357</guid>

					<description><![CDATA[<p>6 million ways to deploy, choose one Die Aufgabe ist mit dem yuicompressor alle css files einzeln zu komprimieren. Concatenation lasse ich weg. Wir haben zur Auswahl 2 x mal als ant deploy und einmal die gute alte shell. Das yuicompressor jar ist “installiert” und liegt hier: Und es kann losgehen: 1. ant via apply &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/" class="more-link">Continue reading<span class="screen-reader-text"> "3 x YuiCompressor im Deploy"</span></a></p>
The post <a href="https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/">3 x YuiCompressor im Deploy</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p><em>6 million ways to deploy, choose one</em></p>
<p>Die Aufgabe ist mit dem <a href="http://developer.yahoo.com/yui/compressor/">yuicompressor</a> alle css files einzeln zu komprimieren.<br />
Concatenation lasse ich weg.<br />
Wir haben zur Auswahl 2 x mal als <strong>ant</strong> deploy und einmal die gute alte <strong>shell</strong>.</p>
<p>Das yuicompressor jar ist “installiert” und liegt hier:</p>
<pre class="brush: bash; title: ; notranslate">
/usr/share/ant/lib/yuicompressor.jar
</pre>
<p>Und es kann losgehen:</p>
<p><span id="more-1357"></span></p>
<p><strong>1. ant via apply task</strong></p>
<p>Ein Property (im externen property file) für das jar:</p>
<pre class="brush: bash; title: ; notranslate">
yuicompressor=/usr/share/ant/lib/yuicompressor.jar
</pre>
<p>Und nun der task:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;target name=&quot;minifyCSS&quot;&gt;
		&lt;apply executable=&quot;java&quot; parallel=&quot;false&quot; verbose=&quot;true&quot; dest=&quot;${buildir}/project/${updateChannelTemp}/&quot;&gt;
			&lt;fileset dir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/&quot; includes=&quot;*.css&quot; excludes=&quot;*.min.css&quot;/&gt;
			&lt;arg line=&quot;-jar&quot;/&gt;
			&lt;arg path=&quot;${yuicompressor}&quot;/&gt;
			&lt;arg line=&quot;-v&quot;/&gt;
			&lt;arg line=&quot;--charset latin1&quot;/&gt;
			&lt;srcfile /&gt;
			&lt;arg line=&quot;-o&quot;/&gt;
			&lt;mapper type=&quot;glob&quot; from=&quot;*.css&quot; to=&quot;*.css&quot;/&gt;
			&lt;targetfile/&gt;
		&lt;/apply&gt;
		&lt;move todir=&quot;${buildir}/project/${updateChannelTemp}/${SvnExportDir}/scripts/&quot; overwrite=&quot;true&quot;&gt;
			&lt;fileset dir=&quot;${buildir}/project/${updateChannelTemp}/&quot; includes=&quot;*.css&quot; /&gt;
		&lt;/move&gt;
&lt;/target&gt;
</pre>
<p><strong>2. ant via yui-compressor task</strong></p>
<p>Dazu brauch es noch ein paar Vorbereitungen:</p>
<p>Hierzu muss das Task noch “<a href="http://javaflight.blogspot.com/2008/01/introducing-yui-compressor-ant-task.html">installiert</a>” werden, ich packs mal zu den anderen jars und dazu ein Property:</p>
<pre class="brush: bash; title: ; notranslate">
yuicompressortask=/usr/share/ant/lib/yui-compressor-task.jar
</pre>
<p>Weiterhin den Ant ClassPath:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;path id=&quot;project.classpath&quot;&gt;
		&#x5B;...]
&lt;pathelement location=&quot;${yuicompressortask}&quot; /&gt;
		&lt;pathelement location=&quot;${yuicompressor}&quot; /&gt;
&lt;/path&gt;
</pre>
<p>Den Task definieren:</p>
<pre class="brush: bash; title: ; notranslate">
&lt;taskdef name=&quot;yui-compressor&quot; classname=&quot;net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask&quot;&gt;
</pre>
<p>und das eigentliche Target:</p>
<pre class="brush: bash; title: ; notranslate">
&lt;target name=&quot;minifyCSS2&quot;&gt;
&lt;mkdir dir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/css/&quot;/&gt;
&lt;yui-compressor 
    warn=&quot;false&quot; 
    munge=&quot;true&quot; 
    cssSuffix=&quot;.css&quot;
    jsSuffix=&quot;.js&quot; 
    preserveallsemicolons=&quot;false&quot; 
    fromdir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/&quot; 
    todir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/css/&quot;&gt;
  &lt;include name=&quot;*.css&quot; /&gt;
&lt;/yui-compressor&gt;
&lt;move todir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/&quot; overwrite=&quot;true&quot;&gt;
		&lt;fileset dir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/css/&quot; includes=&quot;*.css&quot; /&gt;
&lt;/move&gt;
&lt;delete dir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/css/&quot; /&gt;
&lt;/target&gt;
</pre>
<p><strong>3. via shell</strong></p>
<pre class="brush: bash; title: ; notranslate">
java -jar /usr/share/ant/lib/yuicompressor.jar --type -v css &lt; /home/builds/project/css/*.css &gt; /home/builds/project/css/*.css
</pre>
<p>Fazit:<br />
Ich <del>hasse</del> liebe <strong>ant</strong>.<br />
<em>Achtung: keine Gewähr, dass das die snippets funktionieren, weil ziemlich aus dem Kontext gerissen.</em><br />
Ich wollte nur mal verdeutlichen was für ein overhead <strong>ant</strong> manchmal erzeugt.<br />
Ich benutze es trotzdem ;)</p>The post <a href="https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/">3 x YuiCompressor im Deploy</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
