forked from yui/builder
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced linked file with actual file
- Loading branch information
YUI Builder
committed
Dec 31, 2008
1 parent
d345863
commit 3286e2b
Showing
1 changed file
with
386 additions
and
1 deletion.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,386 @@ | ||
<project name="yui" default="all"> | ||
<!-- | ||
This is the master build for yui. It generates rollup files, the API docs, the | ||
zip distribution, and the files that go to akamai | ||
Requires ant 1.6.5+ | ||
Requires ant-contrib tasks: http://ant-contrib.sourceforge.net/ | ||
--> | ||
<tstamp /> | ||
|
||
<property name="basedir" location="."/> | ||
<property name="localcheckoutdir" value="${basedir}/src" /> | ||
<property name="src" location="${basedir}/src/yui3"/> | ||
<property name="tools" location="${basedir}/src/builder" /> | ||
<property name="build" location="${basedir}/target"/> | ||
<property name="verify" location="${basedir}/verify"/> | ||
<property name="tmp" location="${basedir}/tmp"/> | ||
|
||
<property name="examples.script" location="${tools}/projects/yui3/genexamples3.php" /> | ||
<property name="apidocs.script" location="./apidocs.sh" /> | ||
|
||
<property name="yui" location="${build}/yui"/> | ||
|
||
<property name="as.src" location="${src}/as-src" /> | ||
<property name="as.dest" location="${build}/yui/as-api" /> | ||
<property name="flexhome" location="${basedir}/flex3sdk" /> | ||
<property name="cssProcessor.jar" value="${localcheckoutdir}/cssProcessor/CSSProcessor-0.1.0.jar" /> | ||
<!-- | ||
<property name="examplesdist" location="${basedir}/examples_dist"/> | ||
<property name="examplesydn" location="${basedir}/examples_ydn"/> | ||
<property name="examplesprod" location="${basedir}/examples_prod"/> | ||
--> | ||
|
||
<!-- | ||
<property name="cvs.root" value="vault.yahoo.com:/CVSROOT" /> | ||
<property name="cvs.rsh" value="yssh" /> | ||
--> | ||
|
||
<property name="pr1.builddirs" value="assets/**/*, anim/**/*, attribute/**/*, base/**/*, classnamemanager/**/*, console/**/*, cookie/**/*, cssfonts/**/*, cssbase/**/*, cssreset/**/*, cssgrids/**/*, dd/**/*, dom/**/*, dump/**/*, event/**/*, get/**/*, io/**/*, json/**/*, logreader/**/*, loader/**/*, node/**/*, node-menunav/**/*, oop/**/*, overlay/**/*, plugin/**/*, profiler/**/*, queue/**/*, slider/**/*, substitute/**/*, widget/**/*, yui/**/*, yui-base/**/*, test/**/*" /> | ||
|
||
<!-- | ||
<property name="pr1.srcdirs" value="animation/**/*, attribute/**/*, base/**/*, cookie/**/*, dd/**/*, dd-plugin/**/*, dom/**/*, dump/**/*, event/**/*, get/**/*, substitute/**/*, io/**/*, json-parse/**/*, json-stringify/**/*, loader/**/*, node/**/*, profiler/**/*, queue/**/*, yui/**/*, test/**/*" /> | ||
--> | ||
|
||
<!-- Temporarily, since we need to specify them anyway in apidocs.sh --> | ||
<property name="pr1.srcdirs" value="**/*" /> | ||
<!-- Commenting for PR1, since we don't have critical mass on tests --> | ||
<!-- <property name="pr1.testdirs" value="**/*" /> --> | ||
|
||
<!-- | ||
<propertyregex property="pr1.builddirs" | ||
override="true" | ||
input="${pr1.components}" | ||
regexp="\s*?," | ||
replace="/**/*," /> | ||
--> | ||
|
||
<loadfile property="version" srcFile="${basedir}/version.txt"> | ||
<filterchain> | ||
<striplinebreaks/> | ||
</filterchain> | ||
</loadfile> | ||
<property name="akamai" location="${build}/akamai/${version}"/> | ||
|
||
<taskdef resource="net/sf/antcontrib/antcontrib.properties"> | ||
<classpath> | ||
<pathelement location="${tools}/componentbuild/lib/ant-contrib/ant-contrib-1.0b3-modified.jar" /> | ||
</classpath> | ||
</taskdef> | ||
|
||
<target name="all" depends="test, compile, apidocs, asapidocs, examples, package, verify, akamai"/> | ||
|
||
<target name="compile"> | ||
|
||
<!-- label property ex: yui3-xxx ... strip "yui3-" for Y.add VERSION token --> | ||
<propertyregex property="version.build" | ||
input="${label}" | ||
regexp="yui3\-(.*)" | ||
replace="\1" | ||
casesensitive="false" | ||
defaultValue="" /> | ||
|
||
<!-- clean up build dir and recreate --> | ||
<delete dir="${build}"/> | ||
<delete dir="${tmp}"/> | ||
|
||
<!-- | ||
<delete dir="${examplesdist}"/> | ||
<delete dir="${examplesydn}"/> | ||
<delete dir="${examplesprod}"/> | ||
--> | ||
|
||
<mkdir dir="${build}"/> | ||
<mkdir dir="${tmp}"/> | ||
<mkdir dir="${tmp}/apisrc"/> | ||
<mkdir dir="${akamai}"/> | ||
<!-- | ||
<concat destfile="${src}/build/reset-fonts-grids/reset-fonts-grids.css"> | ||
<filelist dir="${src}/build" files="cssreset/reset-min.css,cssfonts/fonts-min.css,cssgrids/grids-min.css"/> | ||
</concat> | ||
<concat destfile="${src}/build/reset-fonts/reset-fonts.css"> | ||
<filelist dir="${src}/build" files="cssreset/reset-min.css,cssfonts/fonts-min.css"/> | ||
</concat> | ||
--> | ||
<!-- copy global README ... @todo extract latest release notes from all components --> | ||
<copy file="${src}/README" tofile="${yui}/README" preservelastmodified="true" /> | ||
|
||
<!-- copy everything in build except the js/css files --> | ||
<echo message="Copying non JS/CSS files" level="info" /> | ||
<copy todir="${yui}/build" includeEmptyDirs="false" preservelastmodified="true"> | ||
<fileset dir="${src}/build" includes="${pr1.builddirs}"> | ||
<none> | ||
<filename name="**/*.js" /> | ||
<filename name="**/*.css" /> | ||
</none> | ||
</fileset> | ||
</copy> | ||
|
||
<!-- copy build js/css files, updating version token and prepending the copyright info | ||
do NOT preservelastmodified because the file is being modified with the current | ||
build number | ||
includeEmptryDirs needs to be turned off since removed | ||
directories in CVS are not completely removed. | ||
--> | ||
|
||
<echo message="Copying JS/CSS files" level="info" /> | ||
<copy todir="${yui}/build" includeEmptyDirs="false"> | ||
<fileset dir="${src}/build" includes="${pr1.builddirs}"> | ||
<or> | ||
<filename name="**/*.css" /> | ||
<filename name="**/*.js" /> | ||
</or> | ||
</fileset> | ||
<filterchain> | ||
<concatfilter prepend="copyright.txt"/> | ||
<replacetokens> | ||
<token key="VERSION" value="${version}"/> | ||
<token key="BUILD" value="${version.build}"/> | ||
</replacetokens> | ||
</filterchain> | ||
</copy> | ||
|
||
<!-- | ||
<copy todir="${yui}/tests" preservelastmodified="true"> | ||
<fileset dir="${src}/tests" includes="${pr1.testdirs}" /> | ||
</copy> | ||
--> | ||
|
||
<copy todir="${build}/ydnsite" includeEmptyDirs="false" preservelastmodified="true"> | ||
<fileset dir="${src}/site" includes="**/*" /> | ||
</copy> | ||
</target> | ||
|
||
<target name="examples"> | ||
<exec dir="." executable="${examples.script}" output="examples_dist.log"> | ||
<arg value="-u" /> | ||
<arg value="http://localhost/yui3/templates" /> | ||
<arg value="-b" /> | ||
<arg value="true" /> | ||
<arg value="-t" /> | ||
<arg value="src/yui3/templates" /> | ||
<arg value="-d" /> | ||
<arg value="${yui}" /> | ||
<arg value="-v" /> | ||
<arg value="${version}" /> | ||
</exec> | ||
|
||
<exec dir="." executable="${examples.script}" output="examples_ydn.log"> | ||
<arg value="-u" /> | ||
<arg value="http://localhost/yui3/templates" /> | ||
<arg value="-y" /> | ||
<arg value="true" /> | ||
<arg value="-t" /> | ||
<arg value="src/yui3/templates" /> | ||
<arg value="-d" /> | ||
<arg value="${build}/ydn" /> | ||
<arg value="-b" /> | ||
<arg value="true" /> | ||
<arg value="-v" /> | ||
<arg value="${version}" /> | ||
</exec> | ||
|
||
<delete dir="${build}/ydn/assets" /> | ||
|
||
<exec dir="." executable="${examples.script}" output="examples_prod.log"> | ||
<arg value="-u" /> | ||
<arg value="http://localhost/yui3/templates" /> | ||
<arg value="-y" /> | ||
<arg value="true" /> | ||
<arg value="-t" /> | ||
<arg value="src/yui3/templates" /> | ||
<arg value="-d" /> | ||
<arg value="${build}/prod" /> | ||
<arg value="-v" /> | ||
<arg value="${version}" /> | ||
</exec> | ||
|
||
<delete dir="${build}/prod/assets" /> | ||
</target> | ||
|
||
<target name="apidocs" depends="compile"> | ||
<!-- Generate docs and copy to the yui zip dir --> | ||
<copy todir="${tmp}/apisrc" includeEmptyDirs="false" preservelastmodified="true"> | ||
<fileset dir="${src}/src" includes="${pr1.srcdirs}"> | ||
<filename name="**/*.js" /> | ||
</fileset> | ||
</copy> | ||
|
||
<exec dir="." executable="${apidocs.script}" outputproperty="docgen.output" /> | ||
|
||
<copy todir="${yui}/api" preservelastmodified="true"> | ||
<fileset dir="${tmp}/api" /> | ||
</copy> | ||
|
||
<!-- generate the ydn specific docs --> | ||
<exec dir="." executable="${apidocs.script}" outputproperty="docgen.output" > | ||
<arg value="-y" /> | ||
</exec> | ||
|
||
<copy todir="${build}/ydn/api" preservelastmodified="true"> | ||
<fileset dir="${tmp}/api" /> | ||
</copy> | ||
</target> | ||
|
||
<!-- @todo run tests --> | ||
<target name="test"> | ||
</target> | ||
|
||
<!-- zip up everything in the build directory --> | ||
<target name="package" depends="compile"> | ||
<zip destfile="${build}/yui_${version}.zip" basedir="${build}" includes="yui/**" /> | ||
<checksum file="${build}/yui_${version}.zip" /> | ||
|
||
<property name="latestpackage" value="yui_${version}-${version.build}" /> | ||
|
||
<tar destfile="${build}/${latestpackage}_build.tar.gz" compression="gzip"> | ||
<tarfileset dir="${build}" includes="yui/build/**" /> | ||
</tar> | ||
<checksum file="${build}/${latestpackage}_build.tar.gz" /> | ||
|
||
<tar destfile="${build}/${latestpackage}.tar.gz" compression="gzip"> | ||
<tarfileset dir="${build}" includes="yui/**" /> | ||
<tarfileset dir="${src}" includes="src/**" prefix="yui/" /> | ||
</tar> | ||
<checksum file="${build}/${latestpackage}.tar.gz" /> | ||
|
||
<zip destfile="${build}/ydn_${version}.zip" basedir="${build}" includes="ydn/**" /> | ||
|
||
<copy todir="${build}/ydnsite" includeEmptyDirs="false" preservelastmodified="true"> | ||
<fileset dir="${build}/ydn" includes="examples/**/*, api/**/*, inc/**/*" /> | ||
<fileset dir="${yui}" includes="build/**/*" /> | ||
</copy> | ||
</target> | ||
|
||
<target name="akamai" depends="compile"> | ||
<!-- copy only the build files that belong on akamai --> | ||
<copy todir="${akamai}/build"> | ||
<fileset dir="${yui}/build"> | ||
<patternset id="just.min"> | ||
<include name="**/*.js"/> | ||
<include name="**/*.css"/> | ||
<include name="**/assets/**"/> | ||
</patternset> | ||
</fileset> | ||
</copy> | ||
|
||
<java jar="${cssProcessor.jar}" failonerror="true" fork="true"> | ||
<arg value="-b" /> | ||
<arg value="http://yui.yahooapis.com/${version}/build/" /> | ||
<arg file="${akamai}/build" /> | ||
</java> | ||
|
||
<!-- deal with makefiles? --> | ||
<!-- generate script to make all of the subdirs --> | ||
<copy file="push_all.py" tofile="${build}/akamai/${version}/push_all.py" preservelastmodified="true" /> | ||
<zip destfile="${build}/akamai_${version}.zip" basedir="${build}/akamai" /> | ||
</target> | ||
|
||
<target name="verify" depends="compile"> | ||
<!-- copy build verification files --> | ||
<!-- | ||
<copy todir="${build}/verify" preservelastmodified="true"> | ||
<fileset dir="${verify}"/> | ||
</copy> | ||
--> | ||
<copy file="${basedir}/latest_build.html" tofile="${build}/latest_build.html" preservelastmodified="true" /> | ||
<copy file="${basedir}/latest_build_ydn.html" tofile="${build}/latest_build_ydn.html" preservelastmodified="true" /> | ||
</target> | ||
|
||
<target name="updategit"> | ||
|
||
<!-- periods are not allowed in cvs labels --> | ||
<!-- | ||
<propertyregex property="label.scrubbed" | ||
input="${label}" | ||
regexp="yui3\-(.*)" | ||
replace="yui3-\1" | ||
casesensitive="false" | ||
defaultValue="" /> | ||
--> | ||
<!-- committing these files to this location will cause another | ||
build to happen unless I specifically itemize all of the | ||
directories I want to monitor. Added ignoreFiles in | ||
config.xml that will hopefully take care of this --> | ||
|
||
<!-- | ||
<cvs cvsroot="${cvs.root}" cvsrsh="${cvs.rsh}" dest="."> | ||
<commandline> | ||
<argument value="commit"/> | ||
<argument value="-m"/> | ||
<argument value="${label}"/> | ||
<argument value="yahoo/presentation/2.x/build/assets/skins/sam"/> | ||
<argument value="yahoo/presentation/2.x/build/utilities"/> | ||
<argument value="yahoo/presentation/2.x/build/yahoo-dom-event"/> | ||
<argument value="yahoo/presentation/2.x/build/yuiloader-dom-event"/> | ||
<argument value="yahoo/presentation/3.x/build/reset-fonts"/> | ||
<argument value="yahoo/presentation/3.x/build/reset-fonts-grids"/> | ||
</commandline> | ||
</cvs> | ||
--> | ||
<echo message="Tagging git ${label}" level="info" /> | ||
|
||
<exec dir="src/yui3" executable="git" outputproperty="git.tag.output" > | ||
<arg value="tag"/> | ||
<arg value="-a"/> | ||
<arg value="-m"/> | ||
<arg value="${gitcommitid}"/> | ||
<arg value="${label}"/> | ||
</exec> | ||
|
||
<exec dir="src/yui3" executable="git" outputproperty="git.pushtag.output" > | ||
<arg value="push"/> | ||
<arg value="--tags"/> | ||
</exec> | ||
|
||
<!-- | ||
git push git@yuilibrary.com:yui3 master:refs/heads/master | ||
<arg value="git@yuilibrary.com:yui3"/> | ||
<arg value="master:refs/heads/master"/> | ||
git push hyphonhyphonmirror git@yuilibrary.com:builder | ||
<arg value="hyphonhyphonmirror"/> | ||
<arg value="git@yuilibrary.com:yui3"/> | ||
--> | ||
<exec dir="src/yui3" executable="git" outputproperty="git.pushpublic.output" > | ||
<arg value="push"/> | ||
<arg value="git@yuilibrary.com:yui3"/> | ||
<arg value="master:refs/heads/master"/> | ||
</exec> | ||
|
||
</target> | ||
|
||
<macrodef name="asdocgen"> | ||
<attribute name="flexhome" /> | ||
<attribute name="srcdir" /> | ||
<attribute name="destdir" /> | ||
|
||
<sequential> | ||
<!-- WORK IN PROGRESS, HARDCODED VALUES --> | ||
<!--<property name="flex.home" value="C:/dev/flexsdk3" />--> | ||
<property name="asdoc.class" value="flex2.tools.ASDoc" /> | ||
<property name="asdoc.templatepath" location="@{flexhome}/asdoc/templates" /> | ||
<property name="asdoc.windowtitle" value="YUI AS Documentation" /> | ||
<property name="asdoc.maintitle" value="YUI AS Documentation" /> | ||
|
||
<java className="${asdoc.class}" fork="true" failonerror="true"> | ||
<classpath> | ||
<!-- <fileset dir="${FLEX_HOME}/asdoc/lib" includes="*.jar" /> --> | ||
<fileset dir="@{flexhome}/lib" includes="*.jar" /> | ||
</classpath> | ||
<jvmarg line="-Dapplication.home=@{flexhome} -Xms32m -Xmx768m -Dsun.io.useCanonCaches=false -Xbootclasspath/p:@{flexhome}/lib/xalan.jar"/> | ||
<arg line="-source-path+='@{srcdir}/io'"/> | ||
<arg line="-doc-sources+='@{srcdir}/io'"/> | ||
<arg line="-window-title '${asdoc.windowtitle}'"/> | ||
<arg line="-main-title '${asdoc.maintitle}'"/> | ||
<arg line="-templates-path '${asdoc.templatepath}'"/> | ||
<arg line="-output '@{destdir}'"/> | ||
</java> | ||
</sequential> | ||
</macrodef> | ||
|
||
<target name="asapidocs"> | ||
<asdocgen flexhome="${flexhome}" srcdir="${as.src}" destdir="${as.dest}" /> | ||
</target> | ||
|
||
</project> |