author | wbernard |
Wed, 23 Dec 2009 19:29:07 +0200 | |
changeset 179 | d8ac696cc51f |
parent 1 | be27ed110b50 |
permissions | -rw-r--r-- |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
1 |
/* |
179 | 2 |
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
17 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
18 |
package com.nokia.ant.taskdefs; |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
19 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
20 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
21 |
/** |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
22 |
* ANT wrapper task for the GSCM rebaseline.pl script. |
179 | 23 |
* |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
24 |
* @ant.task category="SCM" |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
25 |
*/ |
179 | 26 |
public class RebaselineTask extends RBTTask { |
27 |
// The attributes of this task |
|
28 |
private Boolean disableTaskRebadging; |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
29 |
|
179 | 30 |
/** |
31 |
* Return disableTaskRebadging |
|
32 |
* |
|
33 |
* @return the disableTaskRebadging. |
|
34 |
*/ |
|
35 |
public Boolean getDisableTaskRebadging() { |
|
36 |
return disableTaskRebadging; |
|
37 |
} |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
38 |
|
179 | 39 |
/** |
40 |
* Set whether to disable task rebadging (incompatible with |
|
41 |
* 'rebadgeObjectVersions' attribute) in the rebaseline.pl script. |
|
42 |
* |
|
43 |
* @param disableTaskRebadging |
|
44 |
* @ant.not-required Default is no. |
|
45 |
*/ |
|
46 |
public void setdisableTaskRebadging(Boolean disableTaskRebadging) { |
|
47 |
this.disableTaskRebadging = disableTaskRebadging; |
|
48 |
log("Set disableTaskRebadging to " + disableTaskRebadging); |
|
49 |
} |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
50 |
|
179 | 51 |
/** |
52 |
* Set the execution script. |
|
53 |
* |
|
54 |
*/ |
|
55 |
protected void setExecutionScript() { |
|
56 |
append2CommandString("rebaseline.pl"); |
|
57 |
} |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
58 |
|
179 | 59 |
/** |
60 |
* Build a command list consisting of all the required and optional command |
|
61 |
* arguments of the current task. |
|
62 |
*/ |
|
63 |
protected void buildCommandList() { |
|
64 |
addCommandArg("database", "-d", true, getDatabase()); |
|
65 |
addCommandArg("password", "-P", true, getPassword()); |
|
66 |
addCommandArg("ccmProject", "-p", true, getCcmProject()); |
|
67 |
addCommandArg("release", "-r", getRelease()); |
|
68 |
addCommandArg("baseline", "-B", getBaseline()); |
|
69 |
addCommandArg("version", "-v", getVersion()); |
|
70 |
addCommandArg("newBaselineName", "-n", getNewBaselineName()); |
|
71 |
addCommandArg("releaseBaseline", "-R", getReleaseBaseline()); |
|
72 |
addCommandArg("leaveFolderswritable", "-w", getLeaveFoldersWritable()); |
|
73 |
addCommandArg("disableTaskRebadging", "-x", getDisableTaskRebadging()); |
|
74 |
addCommandArg("rebadgeObjectVersions", "-a", getRebadgeObjectVersions()); |
|
75 |
addCommandArg("useBranchReleaseMethodology", "-b", getUseBranchReleaseMethodology()); |
|
76 |
addCommandArg("createBaselineForRollingReleaseTag", "-i", getCreateBaselineForRollingReleaseTag()); |
|
77 |
} |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
78 |
|
179 | 79 |
/** |
80 |
* Method returns the correct verbosity level for the input choice. |
|
81 |
* |
|
82 |
* @param choice |
|
83 |
* is the verbosity choice set by user. |
|
84 |
* @return the verbosity level to set. |
|
85 |
*/ |
|
86 |
protected String getVerbosity(int choice) { |
|
87 |
String cmd = ""; |
|
88 |
switch (choice) { |
|
89 |
case 0: |
|
90 |
cmd = "-q "; |
|
91 |
break; |
|
92 |
case 1: |
|
93 |
cmd = "-V "; |
|
94 |
break; |
|
95 |
default: |
|
96 |
raiseError("Verbosity level is not recognised. " |
|
97 |
+ "Legal values are: 0 - quiet, 1 - verbose."); |
|
98 |
} |
|
99 |
return cmd; |
|
100 |
} |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
101 |
|
179 | 102 |
/** |
103 |
* Method validates the given arguments. |
|
104 |
*/ |
|
105 |
protected void validateArguments() { |
|
106 |
// Do nothing |
|
107 |
} |
|
108 |
||
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
109 |
} |