buildframework/helium/tools/release/release.ant.xml
changeset 1 be27ed110b50
child 217 0f5e3a7fb6af
equal deleted inserted replaced
0:044383f39525 1:be27ed110b50
       
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <!-- 
       
     3 ============================================================================ 
       
     4 Name        : release.ant.xml 
       
     5 Part of     : Helium 
       
     6 
       
     7 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     8 All rights reserved.
       
     9 This component and the accompanying materials are made available
       
    10 under the terms of the License "Eclipse Public License v1.0"
       
    11 which accompanies this distribution, and is available
       
    12 at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    13 
       
    14 Initial Contributors:
       
    15 Nokia Corporation - initial contribution.
       
    16 
       
    17 Contributors:
       
    18 
       
    19 Description:
       
    20 
       
    21 ============================================================================
       
    22 -->
       
    23 <project name="release" xmlns:hlm="http://www.nokia.com/helium">
       
    24     <description>
       
    25         Release publising.
       
    26     </description>
       
    27 
       
    28     <fileset id="release.files" dir="${publish.dir}">
       
    29         <include name="logs/**/*" />
       
    30         <include name="development_flash_images/**/*" />
       
    31         <include name="release_flash_images/**/*" />
       
    32         <include name="sisfiles/**/*" />
       
    33         <include name="build_area/**/*" />
       
    34         <include name="test_results/**/*" />
       
    35         <include name="utilities/**/*" />
       
    36     </fileset>
       
    37 
       
    38     <!-- Copies release.files fileset into publish.release.folder destination -->
       
    39     <target name="release">
       
    40         <mkdir dir="${publish.release.dir}" />
       
    41         <copy todir="${publish.release.dir}" preservelastmodified="true" failonerror="false">
       
    42             <fileset refid="release.files" />
       
    43         </copy>
       
    44     </target>
       
    45 
       
    46     <!--
       
    47         This target sets the '''do.robot.release''' property so it activates 
       
    48         the '''ido-sources-to-s60-build-robot''' target.
       
    49     -->
       
    50     <target name="check-robot-release" if="s60.build.robot.path">
       
    51         <script language="jython" setbeans="false">
       
    52             <![CDATA[
       
    53 self.setTaskName("check-robot-release")
       
    54 
       
    55 import ido
       
    56 projects = []
       
    57 mconfigstr = project.getProperty('s60.build.robot.date')
       
    58 if mconfigstr != None:
       
    59     for configstr in mconfigstr.split(';'):
       
    60         config = map(lambda x: x.strip(), configstr.split(','))
       
    61         try:
       
    62             if ido.is_in_interval(int(config[0]), config[1], int(config[2]), config[3]):
       
    63                 self.log("It is release time!")
       
    64                 projects.append(config[4])
       
    65                 project.setProperty('do.robot.release', ",".join(projects))
       
    66             else:
       
    67                 self.log("It is not release time!")
       
    68         except Exception, e:
       
    69             self.log("'%s' invalid configuration." % configstr)
       
    70 else:
       
    71     self.log("'s60.build.robot.date' is not defined.")
       
    72 ]]>
       
    73         </script>
       
    74     </target>
       
    75 
       
    76     <!-- Sources are sent to the S60 build robot by all the IDOs. 
       
    77     This target collects all the sources based on the System Definition file, 
       
    78     zip them all and send to the specified location. There is only one but mandatory 
       
    79     property to tell the location of the build server which is "s60.build.robot.path".
       
    80     -->
       
    81     <target name="ido-sources-to-s60-build-robot" if="do.robot.release" depends="ido-create-ado-mapping,check-robot-release,lookup-email">
       
    82         <property name="ido.template.robot.ready" location="${helium.dir}/tools/common/templates/ido/ready.txt.ftl" />
       
    83         <tempfile property="s60robot.dynamic.config" suffix=".xml" deleteonexit="false" destdir="${temp.build.dir}" />
       
    84         <fmpp sourceFile="${helium.dir}/tools/common/templates/ido/ido-robot-zip.ant.xml.ftl" outputFile="${s60robot.dynamic.config}">
       
    85             <data expandProperties="yes">
       
    86                     inputfile: antProperty(ado.mapping.file)
       
    87                     ant: antProperties()
       
    88                     data: eval('
       
    89                                             java.io.FileInputStream pin = new java.io.FileInputStream(filename);
       
    90                                             java.util.Properties props = new java.util.Properties();
       
    91                                             props.load(pin);
       
    92                         return props;
       
    93                             ', {filename: get(inputfile)})
       
    94             </data>
       
    95         </fmpp>
       
    96         <ant antfile="${s60robot.dynamic.config}" target="all" />
       
    97         <fmpp sourceFile="${ido.template.robot.ready}" outputFile="${s60.build.robot.path}/ready.txt">
       
    98             <data expandProperties="yes">
       
    99                 ant: antProperties()
       
   100             </data>
       
   101         </fmpp>
       
   102     </target>
       
   103 
       
   104 </project>