Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 6c56db07fc17fc1997f7c4dcfe5415d9677484d6 (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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<project
    name="Helper targets"
    default="generateEclipseIndex"
    basedir=".">

    <target name="init" depends="initStreamVariables" unless="genTestIndexesInitialized">
        <fail unless="buildId" />
        <fail unless="eclipseStream" />
        <fail unless="BUILD_TECH" />

        
    <script language="javascript">
        var buildId = project.getProperty("buildId");
        var pattern = new RegExp(/^([IMNSR])(\d{8})-(\d{4})$/);

        var sArray = pattern.exec(buildId);
        // sArray 0 is "whole match"
        project.setProperty("buildType", sArray[1]);
    </script>

     <!--
        TODO: make less exactly hard coded in future
         also, check for validity using "matches" digit*\.digit*\.digit*
      -->
        <condition
            property="dropsDirSegment"
            value="drops4"
            else="drops">
            <equals
                arg1="${eclipseStreamMajor}"
                arg2="4" />
        </condition>

        <condition
            property="dropsDirXSegment"
            value="${dropsDirSegment}"
            else="${dropsDirSegment}pdebased">
            <equals
                arg1="${BUILD_TECH}"
                arg2="CBI" />
        </condition>

        <condition
            property="buildRoot"
            value="/shared/eclipse/builds/${eclipseStreamMajor}${buildType}"
            else="/shared/eclipse/eclipse${eclipseStreamMajor}${buildType}">
            <equals
                arg1="${BUILD_TECH}"
                arg2="CBI" />
        </condition>

        <property
            name="postingDirectory"
            value="${buildRoot}/siteDir/eclipse/downloads/${dropsDirXSegment}" />
        
        <!--
        <property
            name="builderDir"
            value="${buildRoot}/build/supportDir/org.eclipse.releng.eclipsebuilder" />
        -->
        
        <!-- 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="${postingDirectory}/${buildId}/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles" />
        
        <!-- This is our new, "safe for every test" location -->
        <property
            name="base.builder"
            value="${postingDirectory}/${buildId}/org.eclipse.releng.basebuilder" />

        <!-- publish.xml expects buildLabel in places, instead of buildId, 
             though we use them interchangebly -->
        <property
            name="buildLabel"
            value="${buildId}" />
       <!--
        <property
            name="eclipse.build.configs"
            value="${builderDir}/eclipse/buildConfigs" />
            -->
        <!--
        <property
            name="buildDirectory"
            value="${basedir}/../src" />
-->
        <!-- Not sure this is the "working directory" expected. May impact ability 
        to get/find "buildNotes"? Need to copy such "source" things at build time. -->
        <property
            name="buildDirectory"
            value="${postingDirectory}/${buildId}" />
        
        
        <property name="genTestIndexesInitialized" value="true"/>


    </target>

    <target name="generateEclipseIndex" depends="init" >
        <condition
            property="generatorClass"
            value="org.eclipse.releng.generators.EclipseTestResultsGeneratorNoMail">
            <equals
                arg1="${hudson}"
                arg2="true" />
        </condition>
        <property
            name="generatorClass"
            value="org.eclipse.releng.generators.EclipseTestResultsGenerator" />

        <echo message="DEBUG: generatorClass: ${generatorClass}" />
        <available
            classname="${generatorClass}"
            property="class"
            value="${generatorClass}" />

        <property name="genTestIndexesdropTokenList" 
            value="%sdk%,%tests%,%example%,%rcpruntime%,%rcpsdk%,%deltapack%,%icubase%,%runtime%,%jdt%,%jdtsdk%,%jdtc%,%pde%,%pdesdk%,%cvs%,%cvssdk%,%swt%,%relengtools%" />
           
        <!--regenerate the index page with links to test results -->
        <!-- function moved from "helpernew.xml" to here, to consolidate yet modularize all it did was set properties and call publish.xml
        <ant
            antfile="${builderDir}/eclipse/helpernew.xml"
            dir="${publishingContent}"
            target="generateEclipseIndex">
        -->    

            <property
                name="isBuildTested"
                value="true" />
            <!--<property
                name="buildType"
                value="${buildType}" /> -->
            <property name="dropTokenList" 
                value="${genTestIndexesdroptTokenList}" />
            <property
                name="platformIdentifierToken"
                value="%platform%" />
            <property
                name="platformSpecificTemplateList"
                value="Windows,${publishingContent}/templateFiles/platform.php.template,winPlatform.php;Linux,${publishingContent}/templateFiles/platform.php.template,linPlatform.php;Solaris,${publishingContent}/templateFiles/platform.php.template,solPlatform.php;AIX,${publishingContent}/templateFiles/platform.php.template,aixPlatform.php;Macintosh,${publishingContent}/templateFiles/platform.php.template,macPlatform.php;HP-UX,${publishingContent}/templateFiles/platform.php.template,hpuxPlatform.php" />
            <property
                name="indexFileName"
                value="index.php" />
            <property
                name="result"
                value="${postingDirectory}/${buildId}" />
            <property
                name="testResultsTemplateFileName"
                value="${publishingContent}/templateFiles/testResults.php.template" />
            <property
                name="dropTemplateFileName"
                value="${publishingContent}/templateFiles/index.php.template" />
            <property
                name="testManifestFileName"
                value="${publishingContent}/testManifest.xml" />
        
        <antcall target="publishEclipseIndex">
        </antcall>

    </target>
    
    <target name="publishEclipseIndex">


        <!--regenerate the index page with links to test results -->
        <ant
            antfile="${base.builder}/plugins/org.eclipse.build.tools/scripts/publish.xml"
            dir="${publishingContent}"
            target="generateIndex">
            <property
                name="isBuildTested"
                value="true" />
            <property
                name="buildType"
                value="${buildType}" />
            <property
                name="dropTokenList" 
                value="%sdk%,%tests%,%example%,%rcpruntime%,%rcpsdk%,%deltapack%,%icubase%,%runtime%,%jdt%,%jdtsdk%,%jdtc%,%pde%,%pdesdk%,%cvs%,%cvssdk%,%swt%,%relengtools%" />
            <property
                name="platformIdentifierToken"
                value="%platform%" />
            <property
                name="platformSpecificTemplateList"
                value="Windows,${publishingContent}/templateFiles/platform.php.template,winPlatform.php;Linux,${publishingContent}/templateFiles/platform.php.template,linPlatform.php;Solaris,${publishingContent}/templateFiles/platform.php.template,solPlatform.php;AIX,${publishingContent}/templateFiles/platform.php.template,aixPlatform.php;Macintosh,${publishingContent}/templateFiles/platform.php.template,macPlatform.php;HP-UX,${publishingContent}/templateFiles/platform.php.template,hpuxPlatform.php" />
            <property
                name="indexFileName"
                value="index.php" />
            <property
                name="result"
                value="${postingDirectory}/${buildLabel}" />
            <property
                name="testResultsTemplateFileName"
                value="${publishingContent}/templateFiles/testResults.php.template" />
            <property
                name="dropTemplateFileName"
                value="${publishingContent}/templateFiles/index.php.template" />
            <property
                name="testManifestFileName"
                value="${publishingContent}/testManifest.xml" />
        </ant>

        <!-- Replace build label in generated html files 
             TODO: Make these "php variables" that are read by index.php, from dl directory so we don't need to do this
        -->
         <replace
            dir="${postingDirectory}/${buildLabel}"
             token="@buildlabel@"
             value="${buildLabel}"
             includes="**/*.php" />
         <replace
             dir="${postingDirectory}/${buildId}"
             token="@eclipseStream@"
             value="${eclipseStream}"
             includes="**/*.php" />



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