--- a/buildframework/helium/sf/java/legacy/src/com/nokia/tools/cone/CONETool.java Wed Jun 16 16:51:40 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/tools/cone/CONETool.java Fri Aug 13 14:59:05 2010 +0300
@@ -1,19 +1,19 @@
/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
package com.nokia.tools.cone;
@@ -27,50 +27,55 @@
import com.nokia.tools.Tool;
import com.nokia.tools.ToolsProcessException;
-
/**
* To generate the cenrep files using ConE tool.
- *
- *
*/
public class CONETool implements Tool {
-
+
private Map<String, String> varMapping = new HashMap<String, String>();
- public void execute(VariableSet varSet, Project prj)
- throws ToolsProcessException {
- // TODO Auto-generated method stub
+ public void execute(VariableSet varSet, Project prj) throws ToolsProcessException {
+ }
- }
-
-
/**
* Run the cone command with arguments from hashmap.
+ *
* @param prj
* @throws ToolsProcessException
*/
public void execute(Project prj) throws ToolsProcessException {
-
+ String command = null;
+ String osType = System.getProperty("os.name");
org.apache.tools.ant.taskdefs.ExecTask task = new org.apache.tools.ant.taskdefs.ExecTask();
task.setTaskName("ConE");
task.setDir(new java.io.File(varMapping.get("path")));
task.setExecutable("cmd.exe");
+ command = "cmd.exe";
task.setOutput(new File(varMapping.get("output")));
task.createArg().setValue("/c");
task.setAppend(true);
task.createArg().setValue("cone.cmd");
- task.createArg().setValue("generate");
- for (Map.Entry<String, String> varEntry : varMapping.entrySet() ) {
- if ( !varEntry.getKey().equals("path") && !varEntry.getKey().equals("output")) {
+ task.createArg().setValue(varMapping.get("command"));
+ command += " /c cone.cmd " + varMapping.get("command");
+ for (Map.Entry<String, String> varEntry : varMapping.entrySet()) {
+ if (!varEntry.getKey().equals("path") && !varEntry.getKey().equals("output")) {
task.createArg().setValue(varEntry.getKey());
+ command += " " + varEntry.getKey();
task.createArg().setValue(varEntry.getValue());
+ command += " " + varEntry.getValue();
}
}
+ if (!osType.toLowerCase().startsWith("win")) {
+ task.log("ConE tool runs only on windows platforms.");
+ return;
+ }
+ task.log("Running ConE command \"" + command + "\"");
task.execute();
}
-
+
/**
* To Store the variable and it value into hashmap to read them later.
+ *
* @param name
* @param value
*/