Skip to main content
aboutsummaryrefslogblamecommitdiffstats
blob: cf41c37bc8a192a573b73df3550ac7fd1c50894d (plain) (tree)
1
2
3
4
5
6
7
8
9








                                       


                                   
 


                          
 
                                  
               
                                                     
                                                                   



                                                    
         
             






                                    

                                                                      



                                           
 


                                                               
 



                                                                          


                                                                                                                              
 







                                                                                                                                                                  


                                                                      

                                                          
                                                            


                                                                              
 


                                               
 
 


                                      


           


                               
 


                                                                   
 
                                                                  



                                   
 






                                                                         
                                            


           


                              

 


                                                            

                                                                




                                                               





                                     


                                                           
                                   


                                    
                


                                                                                                                   
                                  
               








                                                                     
             
             
 
           

          
<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