587
|
1 |
/*
|
628
|
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 |
*/
|
587
|
17 |
|
|
18 |
package com.nokia.tools.configuration;
|
|
19 |
|
628
|
20 |
import org.apache.tools.ant.Project;
|
|
21 |
|
588
|
22 |
import com.nokia.helium.core.ant.MappedVariable;
|
587
|
23 |
import com.nokia.helium.core.ant.types.VariableSet;
|
628
|
24 |
import com.nokia.tools.Tool;
|
|
25 |
import com.nokia.tools.ToolsProcessException;
|
587
|
26 |
|
|
27 |
/**
|
|
28 |
* Command Line wrapper for configuration tools
|
|
29 |
*/
|
|
30 |
public class CONFIGURATIONTool implements Tool {
|
|
31 |
|
|
32 |
/**
|
628
|
33 |
* Sets the command line variables to be used to execute and validates for the required
|
|
34 |
* parameters
|
587
|
35 |
*
|
628
|
36 |
* @param varSet variable(name / value list)
|
587
|
37 |
*/
|
628
|
38 |
public void execute(VariableSet varSet, Project prj) throws ToolsProcessException {
|
587
|
39 |
String path = null;
|
|
40 |
String masterConf = null;
|
|
41 |
String confml = null;
|
|
42 |
String impl = null;
|
|
43 |
String iby = null;
|
|
44 |
String keepGoing = "false";
|
|
45 |
String report = null;
|
|
46 |
String varName;
|
|
47 |
String value;
|
588
|
48 |
for (MappedVariable variable : varSet.getVariables()) {
|
587
|
49 |
varName = variable.getName();
|
|
50 |
value = variable.getValue();
|
|
51 |
if (varName.equals("path")) {
|
|
52 |
path = value;
|
628
|
53 |
}
|
|
54 |
else if (varName.equals("master_conf")) {
|
587
|
55 |
masterConf = value;
|
628
|
56 |
}
|
|
57 |
else if (varName.equals("confml")) {
|
587
|
58 |
confml = value;
|
628
|
59 |
}
|
|
60 |
else if (varName.equals("impl")) {
|
587
|
61 |
impl = value;
|
628
|
62 |
}
|
|
63 |
else if (varName.equals("iby")) {
|
587
|
64 |
iby = value;
|
628
|
65 |
}
|
|
66 |
else if (varName.equals("keepgoing")) {
|
587
|
67 |
keepGoing = value;
|
628
|
68 |
}
|
|
69 |
else if (varName.equals("report")) {
|
587
|
70 |
report = value;
|
|
71 |
}
|
|
72 |
}
|
|
73 |
if (path == null || masterConf == null || confml == null || iby == null) {
|
|
74 |
throw new ToolsProcessException("Config Tool Parameter missing");
|
|
75 |
}
|
|
76 |
org.apache.tools.ant.taskdefs.ExecTask task = new org.apache.tools.ant.taskdefs.ExecTask();
|
|
77 |
task.setTaskName("Configuration");
|
|
78 |
task.setDir(new java.io.File(path));
|
|
79 |
task.setExecutable(path + java.io.File.separator + "cli_build.cmd");
|
|
80 |
if (keepGoing.equals("false")) {
|
|
81 |
task.setFailonerror(true);
|
628
|
82 |
}
|
|
83 |
else {
|
587
|
84 |
task.createArg().setValue("-ignore_errors");
|
|
85 |
}
|
|
86 |
task.createArg().setValue("-master_conf");
|
|
87 |
task.createArg().setValue(masterConf);
|
|
88 |
task.createArg().setValue("-impl");
|
|
89 |
task.createArg().setValue(impl);
|
|
90 |
task.createArg().setValue("-confml");
|
|
91 |
task.createArg().setValue(confml);
|
|
92 |
task.createArg().setValue("-iby");
|
|
93 |
task.createArg().setValue(iby);
|
|
94 |
if (report != null) {
|
|
95 |
task.createArg().setValue("-report");
|
|
96 |
task.createArg().setValue(report);
|
|
97 |
}
|
|
98 |
task.execute();
|
|
99 |
}
|
|
100 |
} |