Permalink
Browse files

Added support for css modules (fonts, base, grids etc.), Changed css …

…compression to use yuicompressor
  • Loading branch information...
1 parent 4ac5dea commit d00e9605e95c1dae16c587756b35fbf394192f49 @sdesai sdesai committed Jan 12, 2009
@@ -3,5 +3,6 @@
<property name="yui.version" value="2"/>
<import file="${builddir}/shared/properties.xml" description="Properties common to yui2/yui3" />
- <import file="module.xml" description="Build Targets" />
+ <import file="${targets}" description="Build Targets" />
+
</project>
@@ -45,7 +45,7 @@
<target name="-concatskins" if="component.skins.exist">
<concatsource destfile="${component.builddir}/assets/skins/sam/${component}.css" sourcedir="${component.skins.base}" sourcefiles="${component}-core.css, skins/sam/${component}-skin.css" />
- <yuicompress dir="${component.builddir}/assets/skins/sam" file="${component}.css" args="${yuicompressor.css.args.internal} -o ${component.builddir}/assets/skins/sam/${component}.css" />
+ <yuicompress src="${component.builddir}/assets/skins/sam/${component}.css" dest="${component.builddir}/assets/skins/sam/${component}.css" args="${yuicompressor.css.args.internal}" />
</target>
</project>
@@ -8,9 +8,5 @@
<import file="${builddir}/shared/properties.xml" description="Properties common to yui2/yui3" />
- <condition property="targetdefs" value="rollup.xml" else="module.xml">
- <istrue value="${component.rollup}"/>
- </condition>
-
- <import file="${targetdefs}" description="Build Targets" />
+ <import file="${targets}" description="Build Targets" />
</project>
@@ -55,7 +55,7 @@
<target name="-concatskins" if="component.skins.exist">
<concatsource destfile="${component.builddir}/assets/skins/sam/${component}.css" sourcedir="${component.skins.base}" sourcefiles="${component}-core.css, skins/sam/${component}-skin.css" />
- <yuicompress dir="${component.builddir}/assets/skins/sam" file="${component}.css" args="${yuicompressor.css.args.internal} -o ${component.builddir}/assets/skins/sam/${component}.css" />
+ <yuicompress 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="rollup.skins.exist">
@@ -65,4 +65,4 @@
</concat>
</target>
-</project>
+</project>
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="YuiCssModuleTargets">
+
+ <import file="${builddir}/shared/targets.xml" description="Targets common to Rollup/Module" />
+
+ <target name="build" depends="corebuild, contextbuild" />
+
+ <target name="corebuild">
+ <concatsource destfile="${component.builddir}/${component}.css" sourcedir="${component.basedir}/css" sourcefiles="${component.cssfiles}" />
+ </target>
+
+ <target name="contextbuild" if="component.csscontext">
+ <!--
+ <replaceregexp file="${component.builddir}/${component.basefilename}.js"
+ byline="${component.logger.regex.byline}"
+ match="${component.logger.regex}"
+ replace="${component.logger.regex.replace}"
+ flags="${component.logger.regex.flags}" />
+ -->
+ </target>
+
+ <target name="minify">
+ <yuicompress src="${component.builddir}/${component}.css" dest="${component.builddir}/${component}-min.css" args="${yuicompressor.css.args.internal}" />
+ </target>
+
+ <target name="lint">
+ <!-- TODO : Figure out how to use CSS lint -->
+ <!--
+ <jslint>
+ <jsfiles>
+ <fileset dir="${component.builddir}" includes="*.css" />
+ </jsfiles>
+ </jslint>
+ -->
+ </target>
+
+ <target name="deploybuild" description="Copy built files to global build location">
+ <copy todir="${global.build.component}" preservelastmodified="true">
+ <fileset dir="${component.builddir}" includes="*.css" />
+ </copy>
+ </target>
+</project>
@@ -65,6 +65,7 @@
</sequential>
</macrodef>
+ <!-- Deprecated. Remove once everyone is over onto new build -->
<macrodef name="jsmin">
<attribute name="dir" />
<attribute name="file" />
@@ -79,21 +80,21 @@
</macrodef>
<macrodef name="yuicompress">
- <attribute name="dir" />
- <attribute name="file" />
+ <attribute name="src" />
+ <attribute name="dest" />
<attribute name="args" />
<sequential>
- <echo level="info">Running yuicompressor on @{dir}/@{file}</echo>
- <basename file="@{file}" suffix=".js" property="basename" />
+ <echo level="info">Running yuicompressor on @{src}</echo>
<java jar="${yuicompressor.jar}" fork="true">
- <arg line="@{args}" />
- <arg file="@{dir}/@{file}" />
+ <arg line="@{args} -o" />
+ <arg file="@{dest}" />
+ <arg file="@{src}" />
</java>
</sequential>
</macrodef>
- <!-- Deprecated. Remove once everyone is over onto new build -->
+ <!-- Deprecated. Remove once everyone is over onto new build -->
<macrodef name="cssmin">
<attribute name="dir" />
<attribute name="file" />
@@ -81,4 +81,13 @@
</condition>
<property name="workingdir" location="${component.builddir}/ant" />
+
+ <condition property="targetbase" value="rollup" else="module">
+ <istrue value="${component.rollup}"/>
+ </condition>
+
+ <condition property="targets" value="${builddir}/shared/cssmodule.xml" else="${targetbase}.xml">
+ <isset property="component.cssfiles" />
+ </condition>
+
</project>
@@ -25,7 +25,7 @@
<import file="${builddir}/shared/macrolib.xml" description="Macrodef definitions - jslint, jsmin, registerversion" />
<target name="all" depends="local, deploy" description="Build and Deploy to Global Build Directory" />
- <target name="local" depends="clean, init, build, minifyjs, lint" description="Build and Deploy to Local Build Directory" />
+ <target name="local" depends="clean, init, build, minify, lint" description="Build and Deploy to Local Build Directory" />
<target name="init">
<tstamp/>
@@ -40,8 +40,8 @@
<target name="build" />
<!-- MIN -->
- <target name="minifyjs" description="Create component-min.js from component.js">
- <yuicompress dir="${component.builddir}" file="${component.basefilename}.js" args="${yuicompressor.js.args.internal} -o ${component.builddir}/${component.basefilename}-min.js" />
+ <target name="minify" description="Create component-min.js from component.js">
+ <yuicompress src="${component.builddir}/${component.basefilename}.js" dest="${component.builddir}/${component.basefilename}-min.js" args="${yuicompressor.js.args.internal}" />
</target>
<target name="lint" description="Run jslint over the local build files (default settings)" unless="lint.skip">

0 comments on commit d00e960

Please sign in to comment.