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 deconfigure.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 DeconfigureTask extends AbstractScmBaseTask { |
27 |
// The attributes of this task |
|
28 |
private Boolean considerBranchReleases; |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
29 |
|
179 | 30 |
/** |
31 |
* Return the considerBranchReleases. |
|
32 |
* |
|
33 |
* @return the considerBranchReleases. |
|
34 |
*/ |
|
35 |
public Boolean getConsiderBranchReleases() { |
|
36 |
return considerBranchReleases; |
|
37 |
} |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
38 |
|
179 | 39 |
/** |
40 |
* Set if we want deconfigure.pl script to check for branch differences |
|
41 |
* based on the 'included_releases' attribute of project. |
|
42 |
* |
|
43 |
* @param considerBranchReleases |
|
44 |
* @ant.not-required Default is no. |
|
45 |
*/ |
|
46 |
public void setconsiderBranchReleases(Boolean considerBranchReleases) { |
|
47 |
this.considerBranchReleases = considerBranchReleases; |
|
48 |
log("Set considerBranchReleases to " + considerBranchReleases); |
|
49 |
} |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
50 |
|
179 | 51 |
/** |
52 |
* Build a command list consisting of all the required and optional command |
|
53 |
* arguments of the current task. |
|
54 |
*/ |
|
55 |
protected void buildCommandList() { |
|
56 |
addCommandArg("database", "-d", true, getDatabase()); |
|
57 |
addCommandArg("password", "-P", true, getPassword()); |
|
58 |
addCommandArg("ccmProject", "-p", true, getCcmProject()); |
|
59 |
addCommandArg("considerBranchReleases", "-b", getConsiderBranchReleases()); |
|
60 |
} |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
61 |
|
179 | 62 |
/** |
63 |
* Method validates the given arguments. |
|
64 |
*/ |
|
65 |
protected void validateArguments() { |
|
66 |
// Do nothing |
|
67 |
} |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
68 |
|
179 | 69 |
/** |
70 |
* Set the execution script. |
|
71 |
* |
|
72 |
*/ |
|
73 |
protected void setExecutionScript() { |
|
74 |
append2CommandString("deconfigure.pl"); |
|
75 |
} |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
76 |
|
179 | 77 |
/** |
78 |
* Method returns the correct verbosity level for the input choice. |
|
79 |
* |
|
80 |
* @param choice |
|
81 |
* is the verbosity choice set by user. |
|
82 |
* @return the verbosity level to set. |
|
83 |
*/ |
|
84 |
protected String getVerbosity(int choice) { |
|
85 |
String cmd = ""; |
|
86 |
switch (choice) { |
|
87 |
case 0: |
|
88 |
cmd = "-q "; |
|
89 |
break; |
|
90 |
case 1: |
|
91 |
cmd = "-V "; |
|
92 |
break; |
|
93 |
case 2: |
|
94 |
cmd = "-W "; |
|
95 |
break; |
|
96 |
default: |
|
97 |
raiseError("Verbosity level is not recognised. " |
|
98 |
+ "Legal values are: 0 - quiet, 1 - verbose or 2 - very verbose"); |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
99 |
} |
179 | 100 |
return cmd; |
101 |
} |
|
102 |
||
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
103 |
} |