Permalink
Browse files

Modified 3.x componentbuild for new directory structure support

  • Loading branch information...
1 parent 25506cd commit 895a1f2fb8736fe3531935f9d1db0aa6e92dd916 @sdesai sdesai committed Dec 20, 2008
Showing with 87 additions and 113 deletions.
  1. +33 −20 componentbuild/3.x/bootstrap.xml
  2. +49 −69 componentbuild/3.x/common.xml
  3. +3 −3 componentbuild/3.x/module.xml
  4. +2 −21 componentbuild/macrolib.xml
@@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="YuiDefault">
+<project name="YuiDefaultProperties">
<taskdef resource="antcontrib.properties">
- <classpath>
- <pathelement location="${builddir}/lib/ant-contrib/ant-contrib-1.0b3-modified.jar" />
- </classpath>
+ <classpath>
+ <pathelement location="${builddir}/lib/ant-contrib/ant-contrib-1.0b3-modified.jar" />
+ </classpath>
</taskdef>
<dirname property="buildfile.dir" file="${ant.file}" />
+ <property name="builddir" location="../../../builder/componentbuild" />
+ <property name="srcdir" location="../.." />
+
<!-- Default Library Version Build -->
<property name="yui.version" value="3"/>
<property name="yui.variable" value="Y"/>
@@ -26,22 +29,30 @@
<property name="global.build.base" location="${srcdir}/build" />
<property name="global.build.component" location="${global.build.base}/${component}" />
<property name="global.build.component.assets" location="${global.build.component}/assets" />
- <property name="global.src.base" location="${srcdir}/src" />
- <property name="global.src.component" location="${global.src.base}/${component}" />
-
- <property name="global.as.src.base" location="${srcdir}/as-src" />
- <property name="global.as.src.component" location="${global.as.src.base}/${component}" />
<!-- Component Defaults -->
<property name="component.module" value="${component}" />
- <property name="component.basedir" value="${buildfile.dir}" />
- <property name="component.builddir" value="${component.basedir}/build_tmp" />
- <property name="component.srcdir" value="${component.basedir}/src" />
+ <property name="component.basedir" location="${buildfile.dir}" />
+ <property name="component.srcdir" value="${component.basedir}" />
<property name="component.jsfiles.base" value="${component.srcdir}/js" />
+ <property name="component.assets.base" value="${component.srcdir}/assets" />
+ <property name="component.skins.base" location="${component.srcdir}/css" />
+ <property name="component.skins.files" value="*.png, *.gif, *.jpg"/>
+ <property name="component.assets.files" value="**/*.*"/>
+ <property name="component.rollup" value="false"/>
+
+ <available file="${component.skins.base}" type="dir" property="component.skins.exist"/>
+ <available file="${component.assets.base}" type="dir" property="component.assets.exist"/>
+
+ <condition property="component.builddir" value="${component.basedir}/build_rollup_tmp" else="${component.basedir}/build_tmp">
+ <istrue value="${component.rollup}"/>
+ </condition>
+
+ <property name="workingdir" location="${component.builddir}/ant" />
+
<condition property="component.basefilename" value="${component}-${component.releasetype}" else="${component}">
<isset property="component.releasetype"/>
</condition>
- <property name="component.skins.imgfiles" value="*.png, *.gif, *.jpg"/>
<!-- Default Logger Regex values if not provided -->
<property name="component.logger.regex" value="^.*?(?:logger|Y.log).*?(?:;|\).*;|(?:\r?\n.*?)*?\).*;).*;?.*?\r?\n" />
@@ -50,16 +61,18 @@
<property name="component.logger.regex.byline" value="false" />
<!-- Rollup Support -->
- <property name="component.rollup" value="false"/>
<property name="component.rollup.target" value="all"/>
- <condition property="targetbase" value="rollup.xml" else="module.xml">
- <istrue value="${component.rollup}"/>
+ <condition property="rollup.skins.exist">
+ <and>
+ <istrue value="${component.rollup}" />
+ <istrue value="${component.skins.exist}" />
+ </and>
</condition>
- <available file="${component.basedir}/README" property="readme.exists"></available>
-
- <property name="workingdir" location="${component.builddir}/anttemp" />
+ <condition property="targetdefs" value="rollup.xml" else="module.xml">
+ <istrue value="${component.rollup}"/>
+ </condition>
- <import file="${targetbase}" description="Base Build Targets" />
+ <import file="${targetdefs}" description="Build Targets" />
</project>
@@ -21,8 +21,6 @@
<echo level="info"> global.build.base : ${global.build.base}</echo>
<echo level="info"> global.build.component : ${global.build.component}</echo>
<echo level="info"> global.build.component.assets : ${global.build.component.assets}</echo>
- <echo level="info"> global.src.base : ${global.src.base}</echo>
- <echo level="info"> global.src.component : ${global.src.component}</echo>
<import file="${builddir}/macrolib.xml" description="Macrodef definitions - jslint, jsmin, registerversion" />
@@ -55,19 +53,21 @@
</target>
<!-- DEPLOY -->
- <target name="deploy" description="Copy files to global build location" depends="-deployassets, -deployskins, -deployreadme, -deploysrc, -deployas, -deployastra">
+ <target name="deploy" description="Copy files to global location" depends="deploybuild, deploydocs"></target>
+
+ <target name="deploybuild" description="Copy built files to global build location" depends="-deployassets, -deployskins">
<copy todir="${global.build.component}" preservelastmodified="true">
<fileset dir="${component.builddir}" includes="*.js" />
</copy>
</target>
- <target name="-deployassets" if="component.assetfiles">
+ <target name="-deployassets" if="component.assets.exist">
<copy todir="${global.build.component.assets}" flatten="true" preservelastmodified="true">
- <fileset dir="${component.srcdir}" includes="${component.assetfiles}" />
+ <fileset dir="${component.assets.base}" includes="${component.assets.files}" />
</copy>
</target>
- <target name="-deployskins" if="component.skins.base">
+ <target name="-deployskins" if="component.skins.exist">
<copy todir="${global.build.component.assets}/skins/sam" preservelastmodified="true">
<fileset dir="${component.builddir}/assets/skins/sam" includes="${component}.css" />
</copy>
@@ -81,77 +81,57 @@
</copy>
<copy todir="${global.build.component.assets}/skins/sam" preservelastmodified="true">
- <fileset dir="${component.skins.base}/skins/sam" includes="${component.skins.imgfiles}" />
- </copy>
- </target>
-
- <target name="-deploysrc" if="component.jsfiles">
- <copy todir="${global.src.component}" preservelastmodified="true">
- <fileset dir="${component.jsfiles.base}" includes="${component.jsfiles}" />
- </copy>
- </target>
-
- <target name="-deployas" if="component.asfiles.base">
- <copy todir="${global.as.src.component}" preservelastmodified="true">
- <fileset dir="${component.asfiles.base}" includes="${component.asfiles}" />
- </copy>
- </target>
-
- <target name="-deployastra" if="component.astrafiles.base">
- <copy todir="${global.as.src.component}" preservelastmodified="true">
- <fileset dir="${component.astrafiles.base}" includes="${component.astrafiles}" />
+ <fileset dir="${component.skins.base}/skins/sam" includes="**/*.*" excludes="**/*.css" />
</copy>
</target>
- <target name="-deployreadme" if="readme.exists">
- <copy file="${component.basedir}/README" todir="${global.build.component}" preservelastmodified="true" />
- </target>
+ <target name="deploydocs" description="Copy doc files to global doc locations"></target>
- <target name="-prepend" if="component.prependfiles">
- <concat destfile="${workingdir}/${component.basefilename}.js.tmp" fixlastline="true">
- <filelist dir="${component.basedir}" files="${component.prependfiles}" />
- <filterchain>
- <tokenfilter>
- <filetokenizer/>
- <replaceregex
+ <target name="-prepend" if="component.prependfiles">
+ <concat destfile="${workingdir}/${component.basefilename}.js.tmp" fixlastline="true">
+ <filelist dir="${component.basedir}" files="${component.prependfiles}" />
+ <filterchain>
+ <tokenfilter>
+ <filetokenizer/>
+ <replaceregex
pattern="${component.logger.regex}"
replace="${component.logger.regex.replace}"
flags="${component.logger.regex.flags}" />
- </tokenfilter>
- </filterchain>
- </concat>
- <concat destfile="${workingdir}/${component.basefilename}.js.tmp" fixlastline="true" append="true">
- <filelist dir="${component.builddir}" files="${component.basefilename}.js" />
- </concat>
- <move file="${workingdir}/${component.basefilename}.js.tmp" tofile="${component.builddir}/${component.basefilename}.js" />
- </target>
-
- <target name="-append" if="component.appendfiles">
- <concat destfile="${component.builddir}/${component.basefilename}.js" fixlastline="true" append="true">
- <filelist dir="${component.basedir}" files="${component.appendfiles}" />
- <filterchain>
- <tokenfilter>
- <filetokenizer/>
- <replaceregex
+ </tokenfilter>
+ </filterchain>
+ </concat>
+ <concat destfile="${workingdir}/${component.basefilename}.js.tmp" fixlastline="true" append="true">
+ <filelist dir="${component.builddir}" files="${component.basefilename}.js" />
+ </concat>
+ <move file="${workingdir}/${component.basefilename}.js.tmp" tofile="${component.builddir}/${component.basefilename}.js" />
+ </target>
+
+ <target name="-append" if="component.appendfiles">
+ <concat destfile="${component.builddir}/${component.basefilename}.js" fixlastline="true" append="true">
+ <filelist dir="${component.basedir}" files="${component.appendfiles}" />
+ <filterchain>
+ <tokenfilter>
+ <filetokenizer/>
+ <replaceregex
pattern="${component.logger.regex}"
replace="${component.logger.regex.replace}"
flags="${component.logger.regex.flags}" />
- </tokenfilter>
- </filterchain>
- </concat>
- </target>
-
- <target name="-prependdebug" if="component.prependfiles">
- <concat destfile="${workingdir}/${component.basefilename}-debug.js.tmp" fixlastline="true" >
- <filelist dir="${component.basedir}" files="${component.prependfiles}" />
- <filelist dir="${component.builddir}" files="${component.basefilename}-debug.js" />
- </concat>
- <move file="${workingdir}/${component.basefilename}-debug.js.tmp" tofile="${component.builddir}/${component.basefilename}-debug.js" />
- </target>
-
- <target name="-appenddebug" if="component.appendfiles">
- <concat destfile="${component.builddir}/${component.basefilename}-debug.js" fixlastline="true" append="true">
- <filelist dir="${component.basedir}" files="${component.appendfiles}" />
- </concat>
- </target>
+ </tokenfilter>
+ </filterchain>
+ </concat>
+ </target>
+
+ <target name="-prependdebug" if="component.prependfiles">
+ <concat destfile="${workingdir}/${component.basefilename}-debug.js.tmp" fixlastline="true" >
+ <filelist dir="${component.basedir}" files="${component.prependfiles}" />
+ <filelist dir="${component.builddir}" files="${component.basefilename}-debug.js" />
+ </concat>
+ <move file="${workingdir}/${component.basefilename}-debug.js.tmp" tofile="${component.builddir}/${component.basefilename}-debug.js" />
+ </target>
+
+ <target name="-appenddebug" if="component.appendfiles">
+ <concat destfile="${component.builddir}/${component.basefilename}-debug.js" fixlastline="true" append="true">
+ <filelist dir="${component.basedir}" files="${component.appendfiles}" />
+ </concat>
+ </target>
</project>
@@ -53,16 +53,16 @@
-->
<!-- SKINS -->
- <target name="-skinsbuild" depends="-concatskins" description="Create skin rollup in local component build directory" if="component.skins.base">
+ <target name="-skinsbuild" depends="-concatskins" description="Create skin rollup in local component build directory" if="component.skins.exist">
<fixcrlf srcdir="${component.builddir}/assets/skins/sam" includes="${component}.css" eol="${buildfiles.eol}" />
</target>
- <target name="-concatskins" if="component.skins.base">
+ <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" />
<cssmin dir="${component.builddir}/assets/skins/sam" file="${component}.css" />
</target>
- <target name="-rollupcss" if="rollup">
+ <target name="-rollupcss" if="rollup.skins.exist">
<echo level="info">Rolling up ${component}.css into ${rollup.component}.css</echo>
<concat destfile="${rollup.builddir}/assets/skins/sam/${rollup.component}.css" append="true" fixlastline="true">
<filelist dir="${component.builddir}/assets/skins/sam" files="${component}.css" />
@@ -185,12 +185,13 @@
<pathconvert pathsep="' '" property="jsfileargs">
<jsfiles />
</pathconvert>
-
+
<java jar="${rhino.jar}" fork="true">
<arg file="${jslintconsole.js}" />
<arg value="${jslintsrc.js}" />
<arg line="'${jsfileargs}'" />
</java>
+
</sequential>
</macrodef>
@@ -279,7 +280,6 @@
<java className="${asdoc.class}" fork="true" failonerror="true">
<classpath>
- <!-- <fileset dir="${FLEX_HOME}/asdoc/lib" includes="*.jar" /> -->
<fileset dir="${flex.home}/lib" includes="*.jar" />
</classpath>
<jvmarg line="-Dapplication.home=${flex.home} -Xms32m -Xmx768m -Dsun.io.useCanonCaches=false -Xbootclasspath/p:${flex.home}/lib/xalan.jar"/>
@@ -293,25 +293,6 @@
<arg line="-templates-path '${asdoc.templatepath}'"/>
<arg line="-output '${srcdir}/as-docs'"/>
</java>
-
- <!--
- <property name="asdoc.executable" value="C:\dev\flexsdk3\bin\asdoc.exe" />
- <property name="asdoc.templatepath" value="C:\dev\flexsdk3\asdoc\templates" />
- <property name="asdoc.windowtitle" value="YUI Flash Component Documentation" />
- <property name="asdoc.maintitle" value="YUI Flash Component Documentation" />
-
- <exec executable="${asdoc.executable}" failonerror="true">
- <arg line="-source-path+='${srcdir}/as-src/charts'"/>
- <arg line="-source-path+='${srcdir}/as-src/uploader'"/>
- <arg line="-library-path+='${srcdir}/as-src/charts/charts.swc'" />
- <arg line="-doc-sources+='${srcdir}/as-src/charts'"/>
- <arg line="-doc-sources+='${srcdir}/as-src/uploader'"/>
- <arg line="-window-title '${asdoc.windowtitle}'"/>
- <arg line="-main-title '${asdoc.maintitle}'"/>
- <arg line="-templates-path '${asdoc.templatepath}'"/>
- <arg line="-output '${srcdir}/as-docs'"/>
- </exec>
- -->
</sequential>
</macrodef>
</project>

0 comments on commit 895a1f2

Please sign in to comment.