Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: cf41c37bc8a192a573b73df3550ac7fd1c50894d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<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(/^([IMXYPNSRU])(\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}" />

    <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" />

    <echo message="= = Properties in genTestIndexes.xml, init = = " />
    <echo message="    job: ${job}" />
    <echo message="    postingDirectory: ${postingDirectory}" />
    <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}" />

    <!-- These variables used to be defined here, but now are defined in 
         publish.xml generateIndex target based on $job
      indexFileName
      dropTemplateFileName
      testManifestFileName
    -->
    
    <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">

    </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>

Back to the top