blob: aa281376c14a1b2edbfe6051201cbadae2230590 [file] [log] [blame]
<project default="nightly">
<target name="hi">
<echo message="${eclipse.home}"/>
</target>
<target name="build" depends="zips,test"/>
<target name="nightly" depends="tag,zips,sign,generate.p2.metadata,test,update.index.html,copy"/>
<target name="testbuild" depends="zips,generate.p2.metadata,test,copy"/>
<target name="buildcopy" depends="zips,generate.p2.metadata,copy"/>
<target name="cdtbuild" depends="tag,zips,test,upload"/>
<target name="testpack" depends="zips,sign,pack,generate.p2.metadata,copy"/>
<target name="update-site" depends="zips,generate.p2.metadata">
<unzip src="${zipsdir}/${masterFile}" dest="${updateSiteLocation}.tmp"/>
<delete quiet="true" dir="${updateSiteLocation}"/>
<move file="${updateSiteLocation}.tmp" tofile="${updateSiteLocation}"/>
</target>
<target name="init">
<touch file="${user.home}/.cvspass" />
<tstamp/>
<property name="eclipseDist" value="/home/data/httpd/download.eclipse.org/eclipse/downloads/drops/S-3.7RC3-201105261708/eclipse-SDK-3.7RC3-linux-gtk.tar.gz"/>
<property name="rseDist" value="/home/data/httpd/download.eclipse.org/tm/downloads/drops/S-3.3RC3-201106011145/RSE-SDK-3.3RC3.zip"/>
<property name="branchVersion" value="8.1.0"/>
<property name="timestamp" value="${DSTAMP}${TSTAMP}" />
<property name="forceContextQualifier" value="${timestamp}"/>
<property name="buildingOSGi" value="true"/>
<property name="buildDirectory" value="${basedir}/results"/>
<property name="testDirectory" value="${buildDirectory}/test"/>
<property name="baseLocation" value="${buildDirectory}/eclipse"/>
<property name="pde.build.scripts" value="${eclipse.pdebuild.scripts}"/>
<property name="collectingFolder" value="eclipse"/>
<property name="archivePrefix" value="eclipse"/>
<property name="buildType" value="I" />
<property name="buildId" value="${buildType}${timestamp}"/>
<property name="zipsdir" value="${buildDirectory}/${buildType}.${buildId}"/>
<property name="masterFile" value="cdt-master-${branchVersion}-${buildId}.zip"/>
<property name="masterFeature" value="org.eclipse.cdt.master_${branchVersion}.jar"/>
<property name="cdtTest" value="org.eclipse.cdt.testing_8.1.0.${timestamp}"/>
<property name="eclipseTest" value="org.eclipse.test_3.3.100"/>
<property name="messagefile" value="message.in"/>
<property name="mailto" value="vivkong@ca.ibm.com"/>
<property name="eclipseRoot" value=":pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse"/>
<property name="baseos" value="${osgi.os}"/>
<property name="basews" value="${osgi.ws}"/>
<property name="basearch" value="${osgi.arch}"/>
<property name="tagbranch" value=""/>
<property name="tagname" value="v${timestamp}"/>
<property name="testReports" value="${zipsdir}/testReports"/>
<property name="junit-report-output" value="${testReports}"/>
<property name="updateSiteLocation" value="${buildDirectory}/update-site"/>
<condition property="onWindows">
<os family="windows"/>
</condition>
<mkdir dir="${buildDirectory}"/>
<mkdir dir="${testReports}"/>
</target>
<target name="fetch" depends="init">
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/platform"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/sdk"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/gdbjtag"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/lrparser"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/lrparser.sdk"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/upc"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/upc.sdk"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/xlc"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/xlc.sdk"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/util"/>
</ant>
<!--
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/dsfgdb"/>
</ant>
-->
<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
<property name="builder" value="${basedir}/memory"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/platform"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/sdk"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/gdbjtag"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/lrparser"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/lrparser.sdk"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/upc"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/upc.sdk"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/xlc"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/xlc.sdk"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/util"/>
</ant>
<!--
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/dsfgdb"/>
</ant>
-->
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/memory"/>
</ant>
<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
<property name="builder" value="${basedir}/codan"/>
</ant>
</target>
<target name="unzip" depends="init" unless="dontUnzip">
<untar src="${eclipseDist}" dest="${buildDirectory}" compression="gzip"/>
<unzip src="${rseDist}" dest="${buildDirectory}"/>
</target>
<target name="zips" depends="init,unzip">
<ant antfile="build.xml" dir="${pde.build.scripts}">
<property name="builder" value="${basedir}/master" />
</ant>
<concat destfile="${zipsdir}/compilelog.txt">
<fileset dir="${buildDirectory}/plugins" includes="**/*@dot.log"/>
</concat>
<loadfile property="compileLog" srcFile="${zipsdir}/compilelog.txt"/>
<condition property="hasErrors">
<contains string="${compileLog}" substring=" ERROR "/>
</condition>
<copy file="buildindex.html" tofile="${zipsdir}/index.html"/>
<replace file="${zipsdir}/index.html">
<replacefilter token="@branchVersion@" value="${branchVersion}"/>
<replacefilter token="@buildId@" value="${buildId}"/>
</replace>
<move file="${zipsdir}/${masterFile}" todir="${buildDirectory}"/>
<unzip src="${buildDirectory}/${masterFile}" dest="${buildDirectory}/site"/>
<!--
<move file="${buildDirectory}/site/linux.gtk.x86/eclipse/epl-v10.html" todir="${buildDirectory}/site/eclipse"/>
<move file="${buildDirectory}/site/linux.gtk.x86/eclipse/notice.html" todir="${buildDirectory}/site/eclipse"/>
-->
<copy file="epl-v10.html" tofile="${buildDirectory}/site/eclipse/epl-v10.html"/>
<copy file="notice.html" tofile="${buildDirectory}/site/eclipse/notice.html"/>
<copy file="buildsite.xml" tofile="${buildDirectory}/site/eclipse/site.xml"/>
<replace file="${buildDirectory}/site/eclipse/site.xml">
<replacefilter token="@buildVersion@" value="${branchVersion}"/>
<replacefilter token="@timeStamp@" value="${timestamp}"/>
</replace>
<copy file="pack.properties" todir="${buildDirectory}/site/eclipse"/>
<!-- for some reason LPG isn't getting picked up-->
<copy file="${buildDirectory}/plugins/net.sourceforge.lpg.lpgjavaruntime_1.1.0.v200803061910.jar"
todir="${buildDirectory}/site/eclipse/plugins"/>
<!-- remove the master feature from the update site -->
<delete verbose="true" file="${buildDirectory}/site/eclipse/features/${masterFeature}"/>
<zip destfile="${zipsdir}/${masterFile}"
basedir="${buildDirectory}/site/eclipse"/>
</target>
<!--pack200-->
<!-- this will pack the master zip using pack200 and generate p2 metadata based on the packed master zip-->
<target name="pack" depends="init" unless="hasErrors">
<echo message="Pack200" />
<property name="launcher" value="${basedir}/tools/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher.jar"/>
<java jar="${launcher}" fork="true" timeout="10800000" failonerror="true" maxmemory="768m" dir="${buildDirectory}/eclipse">
<arg line="-application org.eclipse.update.core.siteOptimizer" />
<arg line="-jarProcessor"/>
<arg line="-verbose"/>
<arg line="-processAll"/>
<arg line="-pack"/>
<arg line="-outputDir ${zipsdir}/pack ${zipsdir}/${masterFile}"/>
</java>
<antcall target="generate.p2.metadata">
<param name="p2dir" value="${zipsdir}/pack/p2"/>
<param name="destination" value="${zipsdir}/pack/${masterFile}"/>
</antcall>
</target>
<target name="generate.p2.metadata" depends="init" unless="hasErrors">
<!-- unzip the signed master site -->
<property name="p2dir" value="${zipsdir}/p2"/>
<property name="destination" value="${zipsdir}/${masterFile}"/>
<unzip src="${destination}" dest="${p2dir}"/>
<!-- generate p2 metadata -->
<antcall target="p2.metadata.generator">
<param name="p2site" value="${p2dir}"/>
</antcall>
<!-- zip everything back up -->
<zip destfile="${destination}"
basedir="${p2dir}"/>
<delete dir="${p2dir}"/>
</target>
<target name="p2.metadata.generator_old">
<echo message="Generate p2 Metadata" />
<property name="p2site" value="${zipsdir}/p2"/>
<property name="launcher" value="${basedir}/tools/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher.jar"/>
<java jar="${launcher}" fork="true" timeout="10800000" failonerror="true" maxmemory="768m" dir="${buildDirectory}/eclipse">
<arg line="-application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator" />
<arg line="-updateSite ${p2site}"/>
<arg line="-site file:${p2site}/site.xml"/>
<arg line="-metadataRepository file:${p2site}"/>
<arg line="-metadataRepositoryName CDT Update Site"/>
<arg line="-artifactRepository file:${p2site}"/>
<arg line="-artifactRepositoryName CDT Artifacts"/>
<arg line="-compress"/>
<arg line="-reusePack200Files"/>
<arg line="-noDefaultIUs"/>
<arg line="-vmargs -Xmx256M"/>
</java>
</target>
<target name="p2.metadata.generator">
<echo message="Generate p2 Metadata" />
<property name="p2site" value="${zipsdir}/p2"/>
<property name="launcher" value="${basedir}/tools/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher.jar"/>
<java jar="${launcher}" fork="true" timeout="10800000" failonerror="true" maxmemory="768m">
<arg line="-application org.eclipse.equinox.p2.publisher.UpdateSitePublisher" />
<arg line="-source ${p2site}"/>
<arg line="-metadataRepository file:${p2site}"/>
<arg line="-artifactRepository file:${p2site}"/>
<arg line="-compress -publishArtifacts -reusePack200Files"/>
</java>
</target>
<target name="test" depends="init" unless="hasErrors">
<record name="${testReports}/testsLog.txt" action="start" loglevel="verbose"/>
<untar src="${eclipseDist}" dest="${testDirectory}" compression="gzip"/>
<!--unzip src="${mylynDist}" dest="${testDirectory}/eclipse"/-->
<unzip src="${zipsdir}/cdt-master-${branchVersion}-${buildId}.zip"
dest="${testDirectory}/eclipse"/>
<unzip src="${testDirectory}/eclipse/plugins/${cdtTest}.jar"
dest="${testDirectory}/test/cdt"/>
<unzip src="${testDirectory}/eclipse/plugins/${eclipseTest}.jar"
dest="${testDirectory}/test/eclipse"/>
<delete file="${testDirectory}/eclipse/site.xml"/>
<delete file="${testDirectory}/eclipse/pack.properties"/>
<delete file="${testDirectory}/eclipse/artifacts.jar"/>
<delete file="${testDirectory}/eclipse/content.jar"/>
<ant antfile="test.xml" dir="${testDirectory}/test/cdt">
<property name="eclipse-home" value="${testDirectory}/eclipse"/>
<property name="library-file" value="${testDirectory}/test/eclipse/library.xml"/>
<property name="os" value="${baseos}"/>
<property name="ws" value="${basews}"/>
<property name="arch" value="${basearch}"/>
</ant>
<xslt style="${basedir}/JUNIT.XSL"
in="${testDirectory}/eclipse/org.eclipse.cdt.testing.xml"
out="${zipsdir}/junits.html"/>
<copy file="${testDirectory}/eclipse/org.eclipse.cdt.testing.xml"
tofile="${testReports}/org.eclipse.cdt.testing.xml"
failonerror="false"/>
<record name="${testReports}/testsLog.txt" action="stop"/>
</target>
<target name="sign" depends="init" unless="hasErrors">
<exec executable="sign">
<arg value="${buildDirectory}/${buildType}.${buildId}/${masterFile}"/>
<arg value="nomail"/>
<arg value="${buildDirectory}/signed"/>
</exec>
<waitfor maxwait="30" maxwaitunit="minute">
<available file="${buildDirectory}/signed/${masterFile}"/>
</waitfor>
<move file="${buildDirectory}/signed/${masterFile}" todir="${zipsdir}"/>
</target>
<target name="upload" depends="init" unless="hasErrors">
<property name="remotedir" value="dschaefer@dev.eclipse.org:cdt/builds/${branchVersion}"/>
<exec dir="${buildDirectory}" executable="scp">
<arg line="${remotedir}/index.html index.html"/>
</exec>
<replace file="${buildDirectory}/index.html">
<replacetoken><![CDATA[ <!-- add here -->]]></replacetoken>
<replacevalue><![CDATA[ <li><a href="@buildType@.@buildId@/index.html">@buildId@</a></li>
<!-- add here -->]]></replacevalue>
</replace>
<replace file="${buildDirectory}/index.html">
<replacefilter token="@buildType@" value="${buildType}"/>
<replacefilter token="@buildId@" value="${buildId}"/>
</replace>
<exec dir="${buildDirectory}" executable="scp">
<arg line="index.html ${remotedir}/index.html"/>
</exec>
<exec dir="${buildDirectory}" executable="scp">
<arg line="-r ${buildType}.${buildId} ${remotedir}"/>
</exec>
</target>
<target name="update.index.html" depends="init" unless="hasErrors">
<property name="copyToDir" value="/home/data/httpd/download.eclipse.org/tools/cdt/builds/${branchVersion}"/>
<replace file="${copyToDir}/index.html">
<replacetoken><![CDATA[ <!-- add here -->]]></replacetoken>
<replacevalue><![CDATA[ <!-- add here -->
<li><a href="@buildType@.@buildId@/index.html">@buildId@</a></li>]]>
</replacevalue>
</replace>
<replace file="${copyToDir}/index.html">
<replacefilter token="@buildType@" value="${buildType}"/>
<replacefilter token="@buildId@" value="${buildId}"/>
</replace>
<chmod file="${copyToDir}/index.html" perm="664"/>
</target>
<target name="copy" depends="init" unless="hasErrors">
<property name="copyToDir" value="/home/data/httpd/download.eclipse.org/tools/cdt/builds/${branchVersion}"/>
<mkdir dir="${copyToDir}/${buildType}.${buildId}"/>
<copy todir="${copyToDir}/${buildType}.${buildId}">
<fileset dir="${buildDirectory}/${buildType}.${buildId}"/>
</copy>
<chmod perm="g+w" dir="${copyToDir}">
<dirset dir="${copyToDir}"/>
</chmod>
<chmod perm="g+w" dir="${copyToDir}/${buildType}.${buildId}">
<dirset dir="${copyToDir}/${buildType}.${buildId}"/>
</chmod>
<!-- Create symlink to latest build -->
<symlink action="delete" link="${copyToDir}/latest" failonerror="false"/>
<symlink link="${copyToDir}/latest" resource="${copyToDir}/${buildType}.${buildId}" overwrite="true"/>
</target>
<target name="mail" depends="init">
<antcall target="mailPass"/>
<antcall target="mailFail"/>
</target>
<target name="mailPass" unless="hasErrors">
<copy file="${messagefile}" tofile="message.txt" overwrite="true"/>
<replace file="message.txt">
<replacefilter token="@branchVersion@" value="${branchVersion}"/>
<replacefilter token="@buildId@" value="${buildId}"/>
</replace>
<mail subject="CDT ${branchVersion} Build ${buildId} completed"
tolist="${mailto}" from="dschaefer@qnx.com">
<message src="message.txt"/>
</mail>
</target>
<target name="mailFail" if="hasErrors">
<mail subject="CDT ${branchVersion} Build ${buildId} failed"
tolist="${mailto}" from="dschaefer@qnx.com">
<message src="compilelog.txt"/>
</mail>
</target>
<target name="tag" depends="init">
<property name="cdtTag" value="${tagname}"/>
<cvs cvsroot="/cvsroot/tools" command="rtag ${tagbranch} ${tagname} org.eclipse.cdt"/>
</target>
</project>