Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

173 lines (149 sloc) 9.762 kB
<?xml version="1.0" encoding="UTF-8"?>
<project name="YuiModuleTargets">
<dirname property="module.basedir" file="${ant.file.YuiModuleTargets}"/>
<import file="${module.basedir}/../shared/targets.xml" description="Targets common to Rollup/Module" />
<target name="build" depends="buildcore, -rollupjs, buildskins, buildlangs" />
<target name="buildskins" depends="-buildskins, -rollupcss" />
<target name="buildlangs" depends="-buildlangs, -rolluplangs" />
<!-- CORE -->
<target name="buildcore" depends="builddebug, -createcore, -loggerregex" description="Create component.js">
<fixcrlf srcdir="${component.builddir}" includes="${component.basefilename}.js" eol="${buildfiles.eol}" />
</target>
<target name="-createcore">
<copy file="${component.builddir}/${component.basefilename}-debug.js" tofile="${component.builddir}/${component.basefilename}.js" />
</target>
<target name="-loggerregex" description="Replace logger statements" unless="component.logger.regex.skip">
<echo level="verbose">Replacing Logger Statements in ${component.builddir}/${component.basefilename}.js</echo>
<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>
<!-- DEBUG -->
<target name="builddebug" depends="-concatdebug, -registerdebug, -prependdebug, -appenddebug" description="Create component-debug.js">
<fixcrlf srcdir="${component.builddir}" includes="${component.basefilename}-debug.js" eol="${buildfiles.eol}" />
</target>
<target name="-concatdebug">
<concatsource destfile="${component.builddir}/${component.basefilename}-debug.js" sourcedir="${component.jsfiles.base}" sourcefiles="${component.jsfiles}" />
</target>
<target name="-registerdebug" unless="register.skip">
<addmodule module="${component.module}" file="${component.builddir}/${component.basefilename}-debug.js" details="${component.details.hash}" />
</target>
<target name="-rollupjs" if="rollup">
<if>
<isset property="rollup.sub"/>
<then>
<echo level="verbose">Module: Build a rollup of a rollup; moving rollup.sub properties into rollup properties.</echo>
<var name="rollup.builddir" unset="true"/>
<var name="rollup.component" unset="true"/>
<var name="rollup.component.basefilename" unset="true"/>
<propertycopy name="rollup.builddir" from="rollup.sub.builddir"/>
<propertycopy name="rollup.component" from="rollup.sub.component"/>
<propertycopy name="rollup.component.basefilename" from="rollup.sub.component.basefilename"/>
</then>
</if>
<echo level="verbose">Module: Rolling up ${component.basefilename}-debug.js into ${rollup.component.basefilename}-debug.js</echo>
<concat destfile="${rollup.builddir}/${rollup.component.basefilename}.js" append="true" fixlastline="true">
<filelist dir="${component.builddir}" files="${component.basefilename}.js" />
</concat>
<concat destfile="${rollup.builddir}/${rollup.component.basefilename}-debug.js" append="true" fixlastline="true">
<filelist dir="${component.builddir}" files="${component.basefilename}-debug.js" />
</concat>
</target>
<!-- SKINS -->
<target name="-buildskins" depends="-concatskins" description="Create skin rollup in local component build directory" if="component.skins.exist">
<for param="skin.dir">
<path>
<dirset dir="${component.assets.base}/skins/" includes="*"/>
</path>
<sequential>
<basename property="skin.name" file="@{skin.dir}"/>
<echo level="verbose">Fixing CRLF for Skin files for @{skin.dir} :: ${skin.name}</echo>
<fixcrlf srcdir="${component.builddir}/assets/skins/${skin.name}" includes="${component}.css" eol="${buildfiles.eol}" />
<var name="skin.name" unset="true" />
</sequential>
</for>
<!--fixcrlf srcdir="${component.builddir}/assets/skins/sam" includes="${component}.css" eol="${buildfiles.eol}" /-->
</target>
<target name="-buildlangs" description="Create language packs in the local component build directory" if="component.langs.exist">
<mkdir dir="${component.builddir}/lang" />
<for list="${component.lang}" param="lang" trim="true">
<sequential>
<addlang dir="${component.lang.base}" module="${component}" lang="@{lang}" dest="${component.builddir}/lang" />
</sequential>
</for>
<addlang dir="${component.lang.base}" module="${component}" lang="" dest="${component.builddir}/lang/" />
</target>
<target name="-rolluplangs" if="rolluplangs">
<for list="${component.lang}" param="lang" trim="true">
<sequential>
<concat destfile="${rollup.builddir}/lang/${rollup.component}_@{lang}.js" append="true" fixlastline="true">
<fileset dir="${component.builddir}/lang" includes="*_@{lang}.js" />
</concat>
</sequential>
</for>
<concat destfile="${rollup.builddir}/lang/${rollup.component}.js" append="true" fixlastline="true">
<filelist dir="${component.builddir}/lang" files="${component}.js" />
</concat>
</target>
<target name="-concatskins" if="component.skins.exist">
<echo level="verbose">Concating Skins</echo>
<for param="skin.dir">
<path>
<dirset dir="${component.assets.base}/skins/" includes="*"/>
</path>
<sequential>
<basename property="skin.name" file="@{skin.dir}"/>
<echo level="verbose">Concating Skin files for @{skin.dir} :: ${skin.name}</echo>
<concatsource destfile="${component.builddir}/assets/skins/${skin.name}/${component}.css" sourcedir="${component.assets.base}" sourcefiles="${component}-core.css, skins/${skin.name}/${component}-skin.css" />
<!-- Stamp Skin CSS -->
<stampcss file="${component.builddir}/assets/skins/${skin.name}/${component}.css" module="skin-${skin.name}-${component}" />
<yuicompress type="css" src="${component.builddir}/assets/skins/${skin.name}/${component}.css" dest="${component.builddir}/assets/skins/${skin.name}/${component}.css" args="${yuicompressor.css.args.internal}" />
<var name="skin.name" unset="true" />
</sequential>
</for>
<!--concatsource destfile="${component.builddir}/assets/skins/sam/${component}.css" sourcedir="${component.assets.base}" sourcefiles="${component}-core.css, skins/sam/${component}-skin.css" />
<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">
<echo level="verbose">Rolling up ${component}.css into ${rollup.component}.css</echo>
<for param="skin.dir">
<path>
<dirset dir="${component.assets.base}/skins/" includes="*"/>
</path>
<sequential>
<basename property="skin.name" file="@{skin.dir}"/>
<echo level="verbose">Concating Skin files for @{skin.dir} :: ${skin.name}</echo>
<concat destfile="${rollup.builddir}/assets/skins/${skin.name}/${rollup.component}.css" append="true" fixlastline="true">
<filelist dir="${component.builddir}/assets/skins/${skin.name}" files="${component}.css" />
</concat>
<var name="skin.name" unset="true" />
</sequential>
</for>
<!--concat destfile="${rollup.builddir}/assets/skins/sam/${rollup.component}.css" append="true" fixlastline="true">
<filelist dir="${component.builddir}/assets/skins/sam" files="${component}.css" />
</concat-->
</target>
<!-- Tests -->
<target name="tests" depends="-lint-server">
<echo level="info">Generating test module for ${component}</echo>
<echo level="info"> Test module: ${tests.component}</echo>
<echo level="info"> Test module source directory: ${tests.srcdir}</echo>
<echo level="info"> Test module source files: ${tests.jsfiles}</echo>
<echo level="info"> Test module output directory: ${tests.builddir}</echo>
<echo level="info"> Test module file: ${tests.builddir}/${tests.component}.js</echo>
<echo level="info"> </echo>
<available file="${tests.srcdir}" type="dir" property="tests.srcdir.exists"/>
<var name="buildfile" value="${tests.builddir}/${tests.component}.js"/>
<arrayliteral from="tests.requires" to="tests.details.requires" key="requires"/>
<concatsource destfile="${buildfile}" sourcedir="${tests.srcdir}" sourcefiles="${tests.jsfiles}"/>
<addmodule file="${buildfile}" module="${tests.component}" details="{${tests.details.requires}}"/>
<jslint>
<jsfiles>
<fileset file="${buildfile}"/>
</jsfiles>
</jslint>
<echo level="info">Test module ${tests.component} created</echo>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.