Author: nickboldt
Date: 2012-10-04 17:19:47 -0400 (Thu, 04 Oct 2012)
New Revision: 44317
Modified:
trunk/build/aggregate/build.xml
Log:
add add.repo.properties task to all aggregate site builds; add cleanup (JBIDE-12432)
Modified: trunk/build/aggregate/build.xml
===================================================================
--- trunk/build/aggregate/build.xml 2012-10-04 21:19:41 UTC (rev 44316)
+++ trunk/build/aggregate/build.xml 2012-10-04 21:19:47 UTC (rev 44317)
@@ -18,6 +18,14 @@
</condition>
<mkdir dir="${COMMON_TOOLS}" />
+ <condition property="WORKINGDIR"
value="/home/hudson/static_build_env/jbds/tools/sources"
else="${basedir}">
+ <available file="/home/hudson/static_build_env/jbds" type="dir"
/>
+ </condition>
+ <mkdir dir="${WORKINGDIR}" />
+
+ <tempfile property="tmpdir" destDir="${java.io.tmpdir}"
prefix="aggregate-site-build"/>
+ <mkdir dir="${tmpdir}" />
+
<property name="update.site.source.dir"
value="${output.dir}/target/site" />
<!-- load properties from file -->
@@ -53,27 +61,27 @@
<antcall target="get.saxon" />
</target>
- <target name="basic.build" description="JBT aggregate update site
extra processing steps"
depends="init,check.target,unpack.content.jar,remove.references,add.associate.sites,remove.uncategorized.category,add.web.content,pack.content.jar,pack.zip"
/>
- <target name="custom.build" description="JBT aggregate update site
extra processing steps"
depends="basic.build,collect.zips,collect.metadata,create.summary.file" />
+ <target name="basic.build" description="JBT aggregate update site
extra processing steps"
depends="init,check.target,add.repo.properties,unpack.content.jar,remove.references,add.associate.sites,remove.uncategorized.category,add.web.content,pack.content.jar,pack.zip,cleanup"
/>
+ <target name="custom.build" description="JBT aggregate update site
extra processing steps"
depends="basic.build,collect.zips,collect.metadata,create.summary.file,cleanup"
/>
<target name="get.ant-contrib"
unless="ant-contrib.jar.exists">
<property name="ANTCONTRIB_MIRROR"
value="http://sourceforge.net/projects/ant-contrib/files/ant-contrib...
/>
<get usetimestamp="true"
dest="${COMMON_TOOLS}/ant-contrib-1.0b2-bin.zip"
src="${ANTCONTRIB_MIRROR}/ant-contrib-1.0b2-bin.zip" />
<touch file="${COMMON_TOOLS}/ant-contrib-1.0b2-bin.zip" />
- <mkdir dir="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_" />
- <unzip src="${COMMON_TOOLS}/ant-contrib-1.0b2-bin.zip"
dest="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_" overwrite="true"
/>
- <copy
file="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_/ant-contrib/lib/ant-contrib.jar"
tofile="${COMMON_TOOLS}/ant-contrib.jar" failonerror="true" />
- <delete dir="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_"
includeemptydirs="true" quiet="true" />
+ <mkdir dir="${tmpdir}/ant-contrib-1.0b2-bin.zip_" />
+ <unzip src="${COMMON_TOOLS}/ant-contrib-1.0b2-bin.zip"
dest="${tmpdir}/ant-contrib-1.0b2-bin.zip_" overwrite="true" />
+ <copy
file="${tmpdir}/ant-contrib-1.0b2-bin.zip_/ant-contrib/lib/ant-contrib.jar"
tofile="${COMMON_TOOLS}/ant-contrib.jar" failonerror="true" />
+ <delete dir="${tmpdir}/ant-contrib-1.0b2-bin.zip_"
includeemptydirs="true" quiet="true" />
</target>
<target name="get.saxon" unless="saxon.jar.exists">
<!-- or use
http://downloads.sourceforge.net/saxon/saxonhe9-3-0-4j.zip ? -->
<property name="SAXON_MIRROR"
value="http://downloads.sourceforge.net/project/saxon/Saxon-HE/9.3/s...
/>
<get usetimestamp="true"
dest="${COMMON_TOOLS}/saxonhe9-3-0-4j.zip" src="${SAXON_MIRROR}"
/>
- <mkdir dir="${java.io.tmpdir}/saxonhe9-3-0-4j.zip_" />
- <unzip src="${COMMON_TOOLS}/saxonhe9-3-0-4j.zip"
dest="${java.io.tmpdir}/saxonhe9-3-0-4j.zip_" overwrite="true" />
- <copy file="${java.io.tmpdir}/saxonhe9-3-0-4j.zip_/saxon9he.jar"
tofile="${COMMON_TOOLS}/saxon.jar" failonerror="true" />
- <delete dir="${java.io.tmpdir}/saxonhe9-3-0-4j.zip_"
includeemptydirs="true" quiet="true" />
+ <mkdir dir="${tmpdir}/saxonhe9-3-0-4j.zip_" />
+ <unzip src="${COMMON_TOOLS}/saxonhe9-3-0-4j.zip"
dest="${tmpdir}/saxonhe9-3-0-4j.zip_" overwrite="true" />
+ <copy file="${tmpdir}/saxonhe9-3-0-4j.zip_/saxon9he.jar"
tofile="${COMMON_TOOLS}/saxon.jar" failonerror="true" />
+ <delete dir="${tmpdir}/saxonhe9-3-0-4j.zip_"
includeemptydirs="true" quiet="true" />
</target>
<!-- = = = = = = = = = = = = = = = = =
@@ -500,6 +508,62 @@
</if>
</target>
+ <target name="get.eclipse">
+ <ant antfile="../target-platforms/scripts/build.xml"
target="get.eclipse">
+ <property name="getArch"
value="${output.dir}/../../target-platforms/scripts/getArch.sh"/>
+ <property name="eclipse.version" value="4.2.1" />
+ <property name="eclipse.type" value="platform" />
+ <property name="eclipse.URL"
value="http://www.eclipse.org/downloads/download.php?r=1&fil...
+ <property name="downloadDir" value="${WORKINGDIR}"/>
+ <property name="unpackDir" value="${tmpdir}"/>
+ </ant>
+ <var name="eclipseDir" value="${tmpdir}/eclipse"/>
+ </target>
+
+ <target name="install.releng.tools" depends="get.eclipse">
+ <!-- install releng tools; want more verbose output? use -consolelog -debug -console
-->
+ <exec executable="${eclipseDir}/eclipse" failonerror="true"
dir="${eclipseDir}" timeout="300000" taskname="p2">
+ <arg line=" -application org.eclipse.equinox.p2.director -nosplash -installIUs
org.eclipse.wtp.releng.tools.feature.feature.group" />
+ <arg line=" -repository
http://download.eclipse.org/webtools/releng/repository/" />
+ </exec>
+ </target>
+
+ <!-- adds download.stats properties to specified features and
+ <property name='p2.statsURI'
value='https://devstudio.jboss.com/usage/juno/4.0.0.Beta1/'/>
+ -->
+ <target name="add.repo.properties" depends="install.releng.tools"
description="use org.eclipse.wtp.releng.tools.addRepoProperties to add p2.statsURI
and download.stats properties for a list of features">
+ <var name="SOURCE_REPO" value="${update.site.source.dir}"/>
+
+ <!-- TODO: externalize these to maven vars / Jenkins vars -->
+ <var name="TARGET_PLATFORM" value="juno"/>
+ <var name="TARGET_FOLDER" value="4.0.0.Beta1"/>
+
+ <var name="install" value=""/>
+ <for param="featureJar">
+ <path>
+ <fileset dir="${SOURCE_REPO}/features" includes="*.jar" />
+ </path>
+ <sequential>
+ <var name="feature.jarfile" unset="true" />
+ <var name="feature.id" unset="true" />
+ <propertyregex property="feature.jarfile"
defaultvalue="@{featureJar}" input="@{featureJar}"
regexp=".+/features/([^/]+\.jar)" replace="\1"
override="true" />
+ <propertyregex property="feature.id"
defaultvalue="${feature.jarfile}" input="${feature.jarfile}"
regexp="([^_]+)_(\d+\.\d+\.\d+\..+)\.jar" replace="\1"
override="true" />
+ <propertyregex property="feature.id"
defaultvalue="${feature.id}" input="${feature.id}"
regexp="([^_]+)_(\d+\.\d+\.\d+)\.jar" replace="\1"
override="true" />
+ <var name="install" value="${install},${feature.id}" />
+ <var name="feature.jarfile" unset="true" />
+ <var name="feature.id" unset="true" />
+ </sequential>
+ </for>
+ <!-- trim prefix "," -->
+ <propertyregex property="install" input="${install}"
defaultvalue="${install}" regexp=",(.+)" replace="\1"
override="true" />
+ <echo level="debug">Features to track: ${install}</echo>
+ <var name="vmargs" value=" -DartifactRepoDirectory=${SOURCE_REPO}
-DmetadataRepoDirectory=${SOURCE_REPO}
-Dp2StatsURI=https://devstudio.jboss.com/usage/${TARGET_PLATFORM}/${TARGET_FOLDER}/
-DstatsArtifactsSuffix= -DstatsTrackedArtifacts=${install}"/>
+ <!-- run releng tools; want more verbose output? use -consolelog -debug -console
-->
+ <exec executable="${eclipseDir}/eclipse" failonerror="true"
dir="${eclipseDir}" timeout="300000" taskname="add">
+ <arg line=" -application org.eclipse.wtp.releng.tools.addRepoProperties
-nosplash -data ${tmpdir}/workspace -consolelog --launcher.suppressErrors -vmargs
${vmargs}" />
+ </exec>
+ </target>
+
<target name="add.web.content">
<!--
Properties calculated here
@@ -878,4 +942,8 @@
</antcall>
</target>
+ <target name="cleanup">
+ <delete dir="${tmpdir}" quiet="true"
includeemptydirs="true" />
+ </target>
+
</project>