blob: 9219d18ed4fbe926665dbfba0de42814869b5fe5 [file] [log] [blame]
<project
name="Helper targets"
default="generateEclipseIndex"
basedir=".">
<target
name="init"
depends="initStreamVariables"
unless="genTestIndexesInitialized">
<fail unless="buildId" />
<fail unless="eclipseStream" />
<fail unless="job" />
<property
name="isBuildTested"
value="true" />
<script language="javascript">
<![CDATA[
var buildId = project.getProperty("buildId");
var pattern = new RegExp(/^([IMXYPNSR])(\d{8})-(\d{4})$/);
var sArray = pattern.exec(buildId);
// sArray 0 is "whole match"
project.setProperty("buildType", sArray[1]);
]]>
</script>
<condition
property="dropsDirSegment"
value="drops4"
else="drops">
<equals
arg1="${eclipseStreamMajor}"
arg2="4" />
</condition>
<!-- publish.xml expects buildLabel in places, instead of buildId,
though we use them interchangebly -->
<property
name="buildLabel"
value="${buildId}" />
<property
name="buildRoot"
value="${buildHome}/${eclipseStreamMajor}${buildType}" />
<property
name="postingDirectory"
value="${buildRoot}/siteDir/eclipse/downloads/${dropsDirSegment}" />
<condition
property="hrefTestResultsTargetPath"
value="baselineAlt">
<contains
string="${job}"
substring="-baselineAlt" />
</condition>
<condition
property="hrefTestResultsTargetPath"
value="baseline">
<contains
string="${job}"
substring="-baseline" />
</condition>
<condition
property="hrefTestResultsTargetPath"
value="."
else="testresults">
<contains
string="${job}"
substring="-perf-" />
</condition>
<condition
property="testResultsHtmlFileName"
value="baselineAltTables.html">
<contains
string="${job}"
substring="-baselineAlt" />
</condition>
<condition
property="testResultsHtmlFileName"
value="baselineTables.html">
<contains
string="${job}"
substring="-baseline" />
</condition>
<condition
property="testResultsHtmlFileName"
value="performance/performanceTables.html"
else="testResultsTables.html">
<contains
string="${job}"
substring="-perf-" />
</condition>
<property
name="EBuilderDir"
value="${postingDirectory}/${buildId}/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder" />
<!-- This is purely a subset of tychoeclipsebuilder files, copyied at build time, so part of
the results output we are working on, so they will be the same once the tests are done, even if gitCache updated by anohter build,
or a run from previous test results -->
<!-- /data/shared/eclipse/builds/4N/master/gitCache/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles -->
<property
name="publishingContent"
value="${EBuilderDir}/eclipse/publishingFiles" />
<condition
property="testManifestFileName"
value="${publishingContent}/performanceTestManifest.xml"
else="${publishingContent}/testManifest.xml">
<contains
string="${job}"
substring="-perf-" />
</condition>
<echo message="= = Properties in genTestIndexes.xml, init = = " />
<echo message=" job: ${job}" />
<echo message=" postingDirectory: ${postingDirectory}" />
<echo message=" testManifestFileName: ${testManifestFileName}" />
<echo message=" hrefTestResultsTargetPath: ${hrefTestResultsTargetPath}" />
<echo message=" testResultsHtmlFileName: ${testResultsHtmlFileName}" />
<echo message=" isBuildTested: ${isBuildTested}" />
<!-- This is our new, "safe for every test" location -->
<property
name="base.builder"
value="${postingDirectory}/${buildId}/org.eclipse.releng.basebuilder" />
<property
name="buildDirectory"
value="${postingDirectory}/${buildId}" />
<property
name="genTestIndexesInitialized"
value="true" />
</target>
<target
name="generateEclipseIndex"
depends="init">
<property
name="generatorClass"
value="org.eclipse.releng.generators.TestResultsGenerator" />
<echo message=" DEBUG: generatorClass: ${generatorClass}" />
<available
classname="${generatorClass}"
property="class"
value="${generatorClass}" />
<property
name="genTestIndexesdropTokenList"
value="%sdk%,%tests%,%example%,%rcpruntime%,%rcpsdk%,%deltapack%,%runtime%,%jdt%,%jdtsdk%,%jdtc%,%pde%,%pdesdk%,%cvs%,%cvssdk%,%swt%,%relengtools%" />
<property
name="dropTokenList"
value="${genTestIndexesdroptTokenList}" />
<property
name="indexFileName"
value="index.php" />
<property
name="dropTemplateFileName"
value="${publishingContent}/templateFiles/index.template.php" />
<fail
unless="testManifestFileName"
message="testManifestFileName should have been defined, by now?" />
<antcall target="publishEclipseIndex" />
</target>
<target
name="publishEclipseIndex"
depends="init">
<fail
unless="buildType"
message="buildType should have been defined by now" />
<!--regenerate the index page with links to test results -->
<ant
antfile="${EBuilderDir}/eclipse/buildScripts/publish.xml"
dir="${publishingContent}"
target="generateIndex">
<property
name="dropTokenList"
value="%sdk%,%tests%,%example%,%rcpruntime%,%rcpsdk%,%deltapack%,%runtime%,%jdt%,%jdtsdk%,%jdtc%,%pde%,%pdesdk%,%cvs%,%cvssdk%,%swt%,%relengtools%" />
<property
name="indexFileName"
value="index.php" />
<property
name="dropTemplateFileName"
value="${publishingContent}/templateFiles/index.template.php" />
</ant>
</target>
<target name="initStreamVariables">
<fail
unless="eclipseStream"
message="eclipseStream must be provided by caller" />
<condition property="streamOK">
<matches
pattern="\d\.\d\.\d"
string="${eclipseStream}" />
</condition>
<fail
message="eclipseStream variable had unexpected format. Should be digit.digit.digit, but was ${eclipseStream}"
unless="streamOK" />
<script language="javascript">
<![CDATA[
var eclipseStream = project.getProperty("eclipseStream");
var pattern = new
RegExp(/(\d+)\.(\d+)\.(\d+)/);
var sArray = pattern.exec(eclipseStream);
// sArray[0] is "whole match"
project.setProperty("eclipseStreamMajor", sArray[1]);
project.setProperty("eclipseStreamMinor", sArray[2]);
project.setProperty("eclipseStreamService", sArray[3]);
]]>
</script>
</target>
</project>