Skip to content

Commit

Permalink
Support for CSS compression.
Browse files Browse the repository at this point in the history
  • Loading branch information
reid committed Jun 18, 2010
1 parent 018f7b5 commit 6cd8375
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion componentbuild/3.x/module.xml
Expand Up @@ -95,7 +95,7 @@

<target name="-concatskins" if="component.skins.exist">
<concatsource destfile="${component.builddir}/assets/skins/sam/${component}.css" sourcedir="${component.assets.base}" sourcefiles="${component}-core.css, skins/sam/${component}-skin.css" />
<yuicompress src="${component.builddir}/assets/skins/sam/${component}.css" dest="${component.builddir}/assets/skins/sam/${component}.css" args="${yuicompressor.css.args.internal}" />
<yuicompress type="css" src="${component.builddir}/assets/skins/sam/${component}.css" dest="${component.builddir}/assets/skins/sam/${component}.css" args="${yuicompressor.css.args.internal}" />
</target>

<target name="-rollupcss" if="rollupskins">
Expand Down
2 changes: 1 addition & 1 deletion componentbuild/shared/cssmodule.xml
Expand Up @@ -12,7 +12,7 @@
</target>

<target name="minify">
<yuicompress src="${component.builddir}/${component}.css" dest="${component.builddir}/${component}-min.css" args="${yuicompressor.css.args.internal}" />
<yuicompress type="css" src="${component.builddir}/${component}.css" dest="${component.builddir}/${component}-min.css" args="${yuicompressor.css.args.internal}" />
</target>

<target name="lint">
Expand Down
16 changes: 12 additions & 4 deletions componentbuild/shared/macrolib.xml
Expand Up @@ -81,11 +81,19 @@
<macrodef name="yuicompress">
<attribute name="src" />
<attribute name="dest" />
<attribute name="args" />

<attribute name="args" /> <!-- not used anymore -->
<attribute name="type" default="js"/>
<sequential>
<echo level="info">Running yuicompressor [js] on @{src}</echo>
<jscompressor srcfile="@{src}" destfile="@{dest}" charset="${yuicompressor.js.charset}" verbose="${yuicompressor.js.verbose}"/>
<echo level="info">Running yuicompressor on @{src}</echo>
<if>
<equals arg1="@{type}" arg2="css"/>
<then>
<csscompressor srcfile="@{src}" destfile="@{dest}" charset="${yuicompressor.css.charset}" verbose="${yuicompressor.css.verbose}"/>
</then>
<else>
<jscompressor srcfile="@{src}" destfile="@{dest}" charset="${yuicompressor.js.charset}" verbose="${yuicompressor.js.verbose}"/>
</else>
</if>
</sequential>
</macrodef>

Expand Down

0 comments on commit 6cd8375

Please sign in to comment.