1 /* |
1 /* |
2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
8 * |
8 * |
9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 package com.nokia.tools.configuration; |
18 package com.nokia.tools.configuration; |
19 |
19 |
|
20 import org.apache.tools.ant.Project; |
|
21 |
20 import com.nokia.helium.core.ant.MappedVariable; |
22 import com.nokia.helium.core.ant.MappedVariable; |
21 import com.nokia.helium.core.ant.types.VariableSet; |
23 import com.nokia.helium.core.ant.types.VariableSet; |
22 import com.nokia.tools.*; |
24 import com.nokia.tools.Tool; |
23 import org.apache.tools.ant.Project; |
25 import com.nokia.tools.ToolsProcessException; |
24 |
26 |
25 /** |
27 /** |
26 * Command Line wrapper for configuration tools |
28 * Command Line wrapper for configuration tools |
27 */ |
29 */ |
28 public class CONFIGURATIONTool implements Tool { |
30 public class CONFIGURATIONTool implements Tool { |
29 |
31 |
30 /** |
32 /** |
31 * Sets the command line variables to be used to execute and validates for |
33 * Sets the command line variables to be used to execute and validates for the required |
32 * the required parameters |
34 * parameters |
33 * |
35 * |
34 * @param varSet |
36 * @param varSet variable(name / value list) |
35 * variable(name / value list) |
|
36 */ |
37 */ |
37 public void execute(VariableSet varSet, Project prj) |
38 public void execute(VariableSet varSet, Project prj) throws ToolsProcessException { |
38 throws ToolsProcessException { |
|
39 String path = null; |
39 String path = null; |
40 String masterConf = null; |
40 String masterConf = null; |
41 String confml = null; |
41 String confml = null; |
42 String impl = null; |
42 String impl = null; |
43 String iby = null; |
43 String iby = null; |
48 for (MappedVariable variable : varSet.getVariables()) { |
48 for (MappedVariable variable : varSet.getVariables()) { |
49 varName = variable.getName(); |
49 varName = variable.getName(); |
50 value = variable.getValue(); |
50 value = variable.getValue(); |
51 if (varName.equals("path")) { |
51 if (varName.equals("path")) { |
52 path = value; |
52 path = value; |
53 } else if (varName.equals("master_conf")) { |
53 } |
|
54 else if (varName.equals("master_conf")) { |
54 masterConf = value; |
55 masterConf = value; |
55 } else if (varName.equals("confml")) { |
56 } |
|
57 else if (varName.equals("confml")) { |
56 confml = value; |
58 confml = value; |
57 } else if (varName.equals("impl")) { |
59 } |
|
60 else if (varName.equals("impl")) { |
58 impl = value; |
61 impl = value; |
59 } else if (varName.equals("iby")) { |
62 } |
|
63 else if (varName.equals("iby")) { |
60 iby = value; |
64 iby = value; |
61 } else if (varName.equals("keepgoing")) { |
65 } |
|
66 else if (varName.equals("keepgoing")) { |
62 keepGoing = value; |
67 keepGoing = value; |
63 } else if (varName.equals("report")) { |
68 } |
|
69 else if (varName.equals("report")) { |
64 report = value; |
70 report = value; |
65 } |
71 } |
66 } |
72 } |
67 if (path == null || masterConf == null || confml == null || iby == null) { |
73 if (path == null || masterConf == null || confml == null || iby == null) { |
68 throw new ToolsProcessException("Config Tool Parameter missing"); |
74 throw new ToolsProcessException("Config Tool Parameter missing"); |
71 task.setTaskName("Configuration"); |
77 task.setTaskName("Configuration"); |
72 task.setDir(new java.io.File(path)); |
78 task.setDir(new java.io.File(path)); |
73 task.setExecutable(path + java.io.File.separator + "cli_build.cmd"); |
79 task.setExecutable(path + java.io.File.separator + "cli_build.cmd"); |
74 if (keepGoing.equals("false")) { |
80 if (keepGoing.equals("false")) { |
75 task.setFailonerror(true); |
81 task.setFailonerror(true); |
76 } else { |
82 } |
|
83 else { |
77 task.createArg().setValue("-ignore_errors"); |
84 task.createArg().setValue("-ignore_errors"); |
78 } |
85 } |
79 task.createArg().setValue("-master_conf"); |
86 task.createArg().setValue("-master_conf"); |
80 task.createArg().setValue(masterConf); |
87 task.createArg().setValue(masterConf); |
81 task.createArg().setValue("-impl"); |
88 task.createArg().setValue("-impl"); |