buildframework/helium/builder/delivery.ant.xml
author kelvzhu
Fri, 12 Nov 2010 17:02:24 +0800
changeset 681 240a07ea3a13
parent 628 7c4a911dc066
permissions -rw-r--r--
change featuredatabase.xml back
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
<!-- 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
============================================================================ 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
Name        : build.xml 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     5
Part of     : Helium AntLib
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     6
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     7
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     8
All rights reserved.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     9
This component and the accompanying materials are made available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    10
under the terms of the License "Eclipse Public License v1.0"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    11
which accompanies this distribution, and is available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    12
at the URL "http://www.eclipse.org/legal/epl-v10.html".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    13
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    14
Initial Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    15
Nokia Corporation - initial contribution.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    16
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
Description:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    21
============================================================================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    22
-->
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
<project name="delivery" default="build" xmlns:au="antlib:org.apache.ant.antunit" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:ac="antlib:net.sf.antcontrib">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
    <property name="delivery.type" value="nokia" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
    <target name="publish-releasable" if="publish.ci.dir" description="Publish the releasble package on a shared drived (must be built from a Mercurial clone)">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
        <ac:runtarget target="get-helium-revision" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
        <mkdir dir="${publish.ci.dir}/${delivery.type}/${helium.revision}/" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
        <copy file="${binary.delivery.zip}" todir="${publish.ci.dir}/${delivery.type}/${helium.revision}/" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
        <echo file="${publish.ci.dir}/${delivery.type}/${helium.revision}/tickler.txt" message="done" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
  
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
    <target name="cleanup-publish-dir" if="publish.ci.dir">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
        <tstamp>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    35
            <format property="before.date" pattern="MM/dd/yyyy hh:mm aa" offset="-5" unit="day"/>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
        </tstamp>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
        <echo>Deleting files before: ${before.date}</echo>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    38
        <ac:for param="file">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    39
            <fileset dir="${publish.ci.dir}" includes="**/*.zip">
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
                <date datetime="${before.date}" when="before" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
            </fileset>
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    42
            <sequential>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    43
                <delete dir="@{file}/../" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    44
            </sequential>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    45
        </ac:for>              
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    46
        <ac:for param="dir">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    47
            <dirset dir="${publish.ci.dir}" includes="*/*">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    48
                <date datetime="${before.date}" when="before" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    49
            </dirset>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    50
            <sequential>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    51
                <ac:if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    52
                    <resourcecount when="equal" count="0">
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    53
                        <fileset dir="@{dir}" includes="*" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    54
                    </resourcecount>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    55
                    <then>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    56
                        <delete dir="@{dir}" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    57
                    </then>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    58
                </ac:if>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    59
            </sequential>
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    60
        </ac:for>              
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
    <target name="create-sf-source-delivery" description="Create the SF source delivery">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
        <mkdir dir="${build.temp.dir}" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
        <delete file="${sf.delivery.zip}" failonerror="false" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    66
        <zip destfile="${sf.delivery.zip}">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    67
            <zipfileset dir="${source.root.dir}" prefix="helium">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
                <include name="**/*" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
                <exclude name="build/**" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
                <exclude name="**/distribution.policy.S60" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
                <exclude name="builder/antlibs/cachedir/**" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    72
                <exclude name="external/antlibs/**" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    73
                <exclude name="external/antlibs2/**" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
                <exclude name="external/python/configure_jython.*" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    75
                <exclude name="external/python/lib/auto/**" />
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    76
                <exclude name="external/cc-customizations/**" />
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    77
                <exclude name="external/CruiseControl/**" />
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    78
                <scriptselector language="jython">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    79
try:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
    if file.isDirectory():
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    81
        value = open(file.toString() + "/distribution.policy.S60").read().strip().strip('\n')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
    else:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
        value = open(file.getParent() + "/distribution.policy.S60").read().strip().strip('\n')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    84
    if value == '7':
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    85
        #self.log("Selecting %s" % file)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    86
        self.setSelected(True)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    87
    else:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    88
        self.setSelected(False)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    89
except:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    90
    print "distribution.policy.S60 is missing for %s" % file
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
    self.setSelected(False)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
                </scriptselector>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    93
            </zipfileset>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    94
        </zip>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    95
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    96
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    97
    <target name="create-sf-delivery" depends="create-sf-source-delivery">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    98
        <delete dir="${build.temp.dir}/sf_helium" failonerror="false" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    99
        <mkdir dir="${build.temp.dir}/sf_helium" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   100
        <unzip src="${sf.delivery.zip}" dest="${build.temp.dir}/sf_helium" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   101
        <exec osfamily="windows" executable="cmd" dir="${build.temp.dir}/sf_helium/helium/builder">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   102
            <arg value="/C" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   103
            <arg value="bld.bat" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   104
            <arg value="build" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   105
        </exec>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   106
        <exec osfamily="windows" executable="cmd" dir="${build.temp.dir}/sf_helium/helium/builder">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   107
            <arg value="/C" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   108
            <arg value="bld.bat" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   109
            <arg value="-Dconfig=sf" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   110
            <arg value="create-releasable" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   111
        </exec>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   112
    </target>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   113
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   114
    <target name="get-latest-delivery">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   115
        <mkdir dir="${build.temp.dir}/temp" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   116
        <basename file="${binary.delivery.zip}" property="binary.delivery.basename" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   117
        <copy todir="${build.temp.dir}/temp" verbose="true">
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   118
            <first>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   119
                <sort>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   120
                    <reverse xmlns="antlib:org.apache.tools.ant.types.resources.comparators">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   121
                        <date />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   122
                    </reverse>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   123
                    <fileset dir="${publish.ci.dir}/${delivery.type}">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   124
                        <include name="*/${binary.delivery.basename}" />
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   125
                        <scriptselector language="jython">
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   126
<![CDATA[
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   127
try:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   128
    open(file.getParent() + "/tickler.txt").close()
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   129
    self.setSelected(True)
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   130
except:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   131
    print "No ticker file for %s" % file
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   132
    self.setSelected(False)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   133
]]>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   134
                        </scriptselector>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   135
                    </fileset>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   136
                </sort>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   137
            </first>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   138
            <flattenmapper/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   139
        </copy>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   140
        <unzip src="${build.temp.dir}/temp/${binary.delivery.basename}" dest="${build.temp.dir}/temp" />
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   141
    </target>
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   142
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   143
    <target name="get-latest-sf-delivery">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   144
        <antcall target="get-latest-delivery">
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   145
            <param name="delivery.type" value="sf"/>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   146
        </antcall>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   147
    </target>
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   148
    
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   149
</project>