Author: nickboldt
Date: 2011-01-19 23:32:56 -0500 (Wed, 19 Jan 2011)
New Revision: 28425
Modified:
trunk/build/aggregate/site/build.xml
Log:
refactor; simplify cleanup step + reduce log clutter
Modified: trunk/build/aggregate/site/build.xml
===================================================================
--- trunk/build/aggregate/site/build.xml 2011-01-20 04:31:18 UTC (rev 28424)
+++ trunk/build/aggregate/site/build.xml 2011-01-20 04:32:56 UTC (rev 28425)
@@ -59,37 +59,37 @@
<!-- fetch zip.list.txt file, if available -->
<var unset="true" name="ALL_ZIPS" />
<var unset="true" name="wget.return" />
- <exec executable="wget" dir="${aggegate.zips.dir}"
failonerror="false" failifexecutionfails="true"
resultproperty="wget.return" outputproperty="null">
+ <exec executable="wget" dir="${aggregate.zips.dir}"
failonerror="false" failifexecutionfails="true"
resultproperty="wget.return" outputproperty="null">
<arg line="${location.cleaned}/logs/zip.list.txt -q --no-clobber" />
</exec>
<echo level="verbose">Fetch SVN_REVISION.txt if it exists (return 8 if
not found)</echo>
- <var name="svnRevTXT"
value="${aggegate.zips.dir}/SVN_REVISION.txt" />
- <exec executable="wget" dir="${aggegate.zips.dir}"
failonerror="false" failifexecutionfails="true"
resultproperty="wget.return" outputproperty="null">
+ <var name="svnRevTXT"
value="${aggregate.zips.dir}/SVN_REVISION.txt" />
+ <exec executable="wget" dir="${aggregate.zips.dir}"
failonerror="false" failifexecutionfails="true"
resultproperty="wget.return" outputproperty="null">
<arg line="${location.cleaned}/logs/SVN_REVISION.txt -q --no-clobber"
/>
</exec>
<echo level="verbose">Fetch SVN_REVISION.xml if it exists (return 8 if
not found)</echo>
- <var name="svnRevXML"
value="${aggegate.zips.dir}/SVN_REVISION.xml" />
- <exec executable="wget" dir="${aggegate.zips.dir}"
failonerror="false" failifexecutionfails="true"
resultproperty="wget.return" outputproperty="null">
+ <var name="svnRevXML"
value="${aggregate.zips.dir}/SVN_REVISION.xml" />
+ <exec executable="wget" dir="${aggregate.zips.dir}"
failonerror="false" failifexecutionfails="true"
resultproperty="wget.return" outputproperty="null">
<arg line="${location.cleaned}/logs/SVN_REVISION.xml -q --no-clobber"
/>
</exec>
<echo level="verbose">Fetch build.properties if it exists (return 8 if
not found)</echo>
- <var name="buildProperties"
value="${aggegate.zips.dir}/build.properties" />
- <exec executable="wget" dir="${aggegate.zips.dir}"
failonerror="false" failifexecutionfails="true"
resultproperty="wget.return" outputproperty="null">
+ <var name="buildProperties"
value="${aggregate.zips.dir}/build.properties" />
+ <exec executable="wget" dir="${aggregate.zips.dir}"
failonerror="false" failifexecutionfails="true"
resultproperty="wget.return" outputproperty="null">
<arg line="${location.cleaned}/logs/build.properties -q --no-clobber"
/>
</exec>
<if>
<and>
<equals arg1="${wget.return}" arg2="0" />
- <available file="${aggegate.zips.dir}/zip.list.txt"
type="file" />
+ <available file="${aggregate.zips.dir}/zip.list.txt"
type="file" />
</and>
<then>
<!-- load zip.list.txt file, get ALL_ZIPS list -->
<var unset="true" name="ALL_ZIPS" />
- <property file="${aggegate.zips.dir}/zip.list.txt" />
+ <property file="${aggregate.zips.dir}/zip.list.txt" />
<if>
<isset property="ALL_ZIPS" />
<then>
@@ -104,24 +104,24 @@
<propertyregex override="true"
property="buildPropertiesPath" defaultvalue=""
input="@{zipPath}" regexp=".zip" replace=".build.properties"
/>
<propertyregex override="true"
property="buildPropertiesPath" defaultvalue="${buildPropertiesPath}"
input="${buildPropertiesPath}" regexp="-Sources-|-Update-"
replace="-" />
- <mkdir dir="${aggegate.zips.dir}/${relativePath}" />
+ <mkdir dir="${aggregate.zips.dir}/${relativePath}" />
<!-- fetch zips to local dir -->
<echo level="verbose">repoNum = @{repoNum}
relativePath = ${relativePath}
svnrevPath = ${svnrevPath}
buildPropertiesPath = ${buildPropertiesPath}
zipPath = @{zipPath}
-DEST = ${aggegate.zips.dir}/@{zipPath}
+DEST = ${aggregate.zips.dir}/@{zipPath}
</echo>
<echo> Zip URL = ${location.cleaned}/@{zipPath}</echo>
<if>
<isset property="isTest" />
<then>
- <touch file="${aggegate.zips.dir}/@{zipPath}" />
+ <touch file="${aggregate.zips.dir}/@{zipPath}" />
</then>
<else>
<var name="wget.return" unset="true" />
- <exec executable="wget" dir="${aggegate.zips.dir}"
failonerror="false" failifexecutionfails="false"
resultproperty="wget.return" outputproperty="null">
+ <exec executable="wget" dir="${aggregate.zips.dir}"
failonerror="false" failifexecutionfails="false"
resultproperty="wget.return" outputproperty="null">
<arg line="${location.cleaned}/@{zipPath} -q --no-clobber"
/>
</exec>
<if>
@@ -134,24 +134,24 @@
</if>
</else>
</if>
-
+
<!-- rename the svn and build properties files so they align with the zip
names -->
<if>
<available file="${svnRevTXT}" type="file" />
<then>
- <copy file="${svnRevTXT}"
tofile="${aggegate.zips.dir}/${svnrevPath}.txt" />
+ <copy file="${svnRevTXT}"
tofile="${aggregate.zips.dir}/${svnrevPath}.txt" />
</then>
</if>
<if>
<available file="${svnRevXML}" type="file" />
<then>
- <copy file="${svnRevXML}"
tofile="${aggegate.zips.dir}/${svnrevPath}.xml" />
+ <copy file="${svnRevXML}"
tofile="${aggregate.zips.dir}/${svnrevPath}.xml" />
</then>
</if>
<if>
<available file="${buildProperties}" type="file" />
<then>
- <copy file="${buildProperties}"
tofile="${aggegate.zips.dir}/${buildPropertiesPath}.txt" />
+ <copy file="${buildProperties}"
tofile="${aggregate.zips.dir}/${buildPropertiesPath}.txt" />
</then>
</if>
</sequential>
@@ -162,16 +162,15 @@
</then>
</if>
<var unset="true" name="ALL_ZIPS" />
- <delete file="${aggegate.zips.dir}/zip.list.txt" quiet="true"
/>
</then>
<else>
<echo> ** Error [${wget.return}] ** Could not wget
${location.cleaned}/logs/zip.list.txt</echo>
</else>
</if>
<var name="location.cleaned" unset="true" />
- <delete file="${svnRevXML}" quiet="true" />
- <delete file="${svnRevTXT}" quiet="true" />
- <delete file="${buildProperties}" quiet="true" />
+ <delete quiet="true">
+ <fileset dir="${aggregate.zips.dir}" includes="zip.list.txt,
SVN_REVISION.txt, SVN_REVISION.xml, build.properties" />
+ </delete>
<var name="svnRevFile" unset="true" />
</sequential>
</macrodef>
@@ -185,17 +184,17 @@
<echo level="verbose">repo = @{repo}</echo>
<!-- if no zip.list.txt from the inputRepo, then fetch from
@{repo}/compositeArtifacts.xml instead -->
<var name="wget.return" unset="true" />
- <exec executable="wget" dir="${aggegate.zips.dir}"
failonerror="false" failifexecutionfails="true"
resultproperty="wget.return" outputproperty="null">
+ <exec executable="wget" dir="${aggregate.zips.dir}"
failonerror="false" failifexecutionfails="true"
resultproperty="wget.return" outputproperty="null">
<arg line="(a){repo}/compositeArtifacts.xml -q --no-clobber" />
</exec>
<if>
<and>
<equals arg1="${wget.return}" arg2="0" />
- <available file="${aggegate.zips.dir}/compositeArtifacts.xml"
type="file" />
+ <available file="${aggregate.zips.dir}/compositeArtifacts.xml"
type="file" />
</and>
<then>
- <echo level="verbose">Got
${aggegate.zips.dir}/compositeArtifacts.xml</echo>
- <xmlproperty file="${aggegate.zips.dir}/compositeArtifacts.xml"
validate="false" collapseAttributes="true" />
+ <echo level="verbose">Got
${aggregate.zips.dir}/compositeArtifacts.xml</echo>
+ <xmlproperty file="${aggregate.zips.dir}/compositeArtifacts.xml"
validate="false" collapseAttributes="true" />
<echo level="verbose">Found ${repository.children.size} contained
repos to search</echo>
<!-- foreach entry repository.children.child.location -->
<for param="location"
list="${repository.children.child.location}">
@@ -204,7 +203,7 @@
<fetchZipsFromList repo="@{location}" />
</sequential>
</for>
- <delete file="${aggegate.zips.dir}/compositeArtifacts.xml"
quiet="true" />
+ <delete file="${aggregate.zips.dir}/compositeArtifacts.xml"
quiet="true" />
</then>
<else>
<echo> ** Error [${wget.return}] ** Could not wget
@{repo}/compositeArtifacts.xml</echo>
@@ -342,9 +341,9 @@
<!-- look for
http://download.jboss.org/jbosstools/builds/staging/jbosstools-3.2.0.M2.c...;
if found, load file and use ${ALL_ZIPS} to get list of relative path zips to fetch
-->
<target name="collect.zips" description="collect zips from the sites
we aggregated">
- <property name="aggegate.zips.dir" value="${output.dir}/zips"
/>
- <delete dir="${aggegate.zips.dir}" quiet="true" />
- <mkdir dir="${aggegate.zips.dir}" />
+ <property name="aggregate.zips.dir" value="${output.dir}/zips"
/>
+ <delete dir="${aggregate.zips.dir}" quiet="true" />
+ <mkdir dir="${aggregate.zips.dir}" />
<for list="${inputRepos}" delimiter=", "
keepgoing="true" param="repoNum">
<sequential>
<var name="repo" value="${inputRepo@{repoNum}}" />
@@ -409,11 +408,11 @@
</target>
<target name="test.collect.zips"
depends="test.collect.zips.from.metadata,test.collect.zips.from.list.txt,test.collect.zips.from.list.xml">
- <delete dir="${aggegate.zips.dir}" quiet="true" />
+ <delete dir="${aggregate.zips.dir}" quiet="true" />
</target>
<target name="test.collect.zips.with.error"
depends="test.collect.zips.from.metadata.with.errors,test.collect.zips.from.list.with.errors">
- <delete dir="${aggegate.zips.dir}" quiet="true" />
+ <delete dir="${aggregate.zips.dir}" quiet="true" />
</target>
<target name="collect.metadata" description="collect svn revision
files + other metadata (JOB_NAME, BUILD_ID, BUILD_NUMBER, WORKSPACE,
HUDSON_SLAVE)">