buildframework/helium/tools/release/release.ant.xml
changeset 2 39c28ec933dd
equal deleted inserted replaced
1:820b22e13ff1 2:39c28ec933dd
       
     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 <!--* @package releases -->
       
    24 <project name="release" xmlns:hlm="http://www.nokia.com/helium">
       
    25     <description>
       
    26         Release publising.
       
    27     </description>
       
    28     
       
    29     <!--* @property release.grace.service
       
    30     The Grace service used
       
    31     @type string
       
    32     @editable required
       
    33     @scope public
       
    34     -->
       
    35 
       
    36     <!--* @property release.grace.product
       
    37     The Grace product used
       
    38     @type string
       
    39     @editable required
       
    40     @scope public
       
    41     -->
       
    42 
       
    43     <!--* @property release.grace.mail.to
       
    44     To whom the completion mail is sent to
       
    45     @type string
       
    46     @editable required
       
    47     @scope public
       
    48     -->
       
    49 
       
    50     <!--* @property release.grace.mail.subject
       
    51     The subject of the Grace upload completion mail
       
    52     @type string
       
    53     @editable required
       
    54     @scope public
       
    55     -->
       
    56 
       
    57     <!--* @property release.grace.mail.message
       
    58     The message contents of the Grace upload completion mail
       
    59     @type string
       
    60     @editable required
       
    61     @scope public
       
    62     -->
       
    63 
       
    64     <fileset id="release.files" dir="${publish.dir}">
       
    65         <include name="logs/**/*" />
       
    66         <include name="development_flash_images/**/*" />
       
    67         <include name="release_flash_images/**/*" />
       
    68         <include name="sisfiles/**/*" />
       
    69         <include name="build_area/**/*" />
       
    70         <include name="test_results/**/*" />
       
    71         <include name="utilities/**/*" />
       
    72     </fileset>
       
    73 
       
    74     <!-- Copies release.files fileset into publish.release.folder destination -->
       
    75     <target name="release">
       
    76         <mkdir dir="${publish.release.dir}" />
       
    77         <copy todir="${publish.release.dir}" preservelastmodified="true" failonerror="false">
       
    78             <fileset refid="release.files" />
       
    79         </copy>
       
    80     </target>
       
    81 
       
    82     <!--* @property s60.build.robot.path
       
    83     Location where to publish the build robot delivery.
       
    84     @type string
       
    85     @editable required
       
    86     @scope public
       
    87     -->
       
    88 
       
    89     <!--* @property s60.build.robot.date
       
    90     This property represent the releasing interval. The syntax is as follow: day1,time1,day2,time2,projectname;day1,time1,day2,time2,projectname2 With day and time matching the following properties: day [1, 14] time [00, 23]:[00, 59] Example: 2,10:00,3,20:00,ABS_domain
       
    91     @type string
       
    92     @editable required
       
    93     @scope public
       
    94     -->
       
    95 
       
    96     <!--
       
    97         This target sets the '''do.robot.release''' property so it activates 
       
    98         the '''ido-sources-to-s60-build-robot''' target.
       
    99     -->
       
   100     <target name="check-robot-release" if="s60.build.robot.path">
       
   101         <script language="jython" setbeans="false">
       
   102             <![CDATA[
       
   103 self.setTaskName("check-robot-release")
       
   104 
       
   105 import ido
       
   106 projects = []
       
   107 mconfigstr = project.getProperty('s60.build.robot.date')
       
   108 if mconfigstr != None:
       
   109     for configstr in mconfigstr.split(';'):
       
   110         config = map(lambda x: x.strip(), configstr.split(','))
       
   111         try:
       
   112             if ido.is_in_interval(int(config[0]), config[1], int(config[2]), config[3]):
       
   113                 self.log("It is release time!")
       
   114                 projects.append(config[4])
       
   115                 project.setProperty('do.robot.release', ",".join(projects))
       
   116             else:
       
   117                 self.log("It is not release time!")
       
   118         except Exception, e:
       
   119             self.log("'%s' invalid configuration." % configstr)
       
   120 else:
       
   121     self.log("'s60.build.robot.date' is not defined.")
       
   122 ]]>
       
   123         </script>
       
   124     </target>
       
   125 
       
   126     <!-- Sources are sent to the S60 build robot by all the IDOs. 
       
   127     This target collects all the sources based on the System Definition file, 
       
   128     zip them all and send to the specified location. There is only one but mandatory 
       
   129     property to tell the location of the build server which is "s60.build.robot.path".
       
   130     -->
       
   131     <target name="ido-sources-to-s60-build-robot" if="do.robot.release" depends="ido-create-ado-mapping,check-robot-release,lookup-email">
       
   132         <!-- Location of the ready.txt FMPP template (override that property if you want to customize the content).
       
   133         @type string
       
   134         @scope private
       
   135         -->
       
   136         <property name="ido.template.robot.ready" location="${helium.dir}/tools/common/templates/ido/ready.txt.ftl" />
       
   137         <tempfile property="s60robot.dynamic.config" suffix=".xml" deleteonexit="false" destdir="${temp.build.dir}" />
       
   138         <fmpp sourceFile="${helium.dir}/tools/common/templates/ido/ido-robot-zip.ant.xml.ftl" outputFile="${s60robot.dynamic.config}">
       
   139             <data expandProperties="yes">
       
   140                     inputfile: antProperty(ado.mapping.file)
       
   141                     ant: antProperties()
       
   142                     data: eval('
       
   143                                             java.io.FileInputStream pin = new java.io.FileInputStream(filename);
       
   144                                             java.util.Properties props = new java.util.Properties();
       
   145                                             props.load(pin);
       
   146                         return props;
       
   147                             ', {filename: get(inputfile)})
       
   148             </data>
       
   149         </fmpp>
       
   150         <ant antfile="${s60robot.dynamic.config}" target="all" />
       
   151         <fmpp sourceFile="${ido.template.robot.ready}" outputFile="${s60.build.robot.path}/ready.txt">
       
   152             <data expandProperties="yes">
       
   153                 ant: antProperties()
       
   154             </data>
       
   155         </fmpp>
       
   156     </target>
       
   157 
       
   158 </project>