public enum optionSuggestion {
architecture(options[1][0], "--arch", "x86 arm"),
compiler(options[1][0], "--compiler", "llvm gcc"),
- configuration(options[1][0], "--configuration", "Debug Release Dynamic Analyzer"),
+ configuration(options[1][0], "--configuration", "Debug Release DA"),
template("-t");
private String mainCmd;
public File workingDir;
@Option(hidden=true,name = "--current-workspace-path", metaVar = "current workspace path", usage = "Specify where is the root path for the command as a default")
- public String currentWorkspacePath;
+ public File currentWorkspacePath;
protected PrintWriter output = new PrintWriter(System.out);;
public class BuildNativeCLI extends AbstractCLI {\r
private Logger log = LoggerFactory.getLogger(getClass());\r
\r
- @Option(name = "--arch", depends="--compiler", metaVar = "x86 | arm", usage = "architecture type")\r
+ @Option(name = "--arch", depends="--compiler", metaVar = "x86 | arm", usage = "Architecture for build result")\r
private String architecture;\r
\r
- @Option(name = "--compiler", depends="--arch", metaVar = "gcc | llvm", usage = "compiler type")\r
+ @Option(name = "--compiler", depends="--arch", metaVar = "gcc | llvm", usage = "Compiler for build result")\r
private String compiler;\r
\r
- @Option(name = "--configuration", metaVar = "Debug | Release | Dynamic Analyzer", usage = "")\r
+ @Option(name = "--configuration", metaVar = "Debug | Release | DA", usage = "Configuration for build result")\r
private String configuration;\r
\r
@Option(name = "--predefine-option", usage = "")\r
private String predefineOption;\r
+ \r
+ private static final String DA = "DA";\r
+ private static final String DA_ORIGIN = "Dynamic Analyzer";\r
\r
/*\r
* (non-Javadoc)\r
\r
BuildNativeCLICommand command = new BuildNativeCLICommand();\r
\r
- command.setWorkingDir(workingDir);\r
- command.setCurrentWorkspacePath(currentWorkspacePath);\r
+ command.setWorkingDir(workingDir == null ? currentWorkspacePath : workingDir);\r
command.setArchitecture(architecture);\r
command.setCompiler(compiler);\r
- command.setConfiguration(configuration);\r
+ command.setConfiguration(DA.equals(configuration) ? DA_ORIGIN : configuration);\r
command.setPredefineOption(predefineOption);\r
\r
BuildNative runCommand = command.runCommand();\r
BuildWebCLICommand command = new BuildWebCLICommand();\r
\r
if( null == workingDir && null != currentWorkspacePath) {\r
- workingDir = new File(currentWorkspacePath);\r
+ workingDir = currentWorkspacePath;\r
}else {\r
workingDir = cwd;\r
}\r
webCommand.setProjectName(projectName);
// set output directory
- if (workingDir != null)
+ try
{
- try
- {
- webCommand.setOutputName(workingDir.getCanonicalPath());
- } catch (IOException e)
- {
- logger.error(e.getMessage());
- }
- }
- else
+ File outputDirectory = (workingDir != null ? workingDir : currentWorkspacePath);
+ webCommand.setOutputName(outputDirectory.getCanonicalPath());
+ } catch (IOException e)
{
- webCommand.setOutputName(currentWorkspacePath);
+ logger.error(e.getMessage());
}
webCommand.runCommand();
import org.tizen.ncli.ide.CLIConstant;\r
import org.tizen.ncli.ide.core.config.NCLIConfigLoader;\r
import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;\r
-import org.tizen.ncli.ide.exec.NewCommandLineExecutor;\r
\r
/**\r
* This class provides common environment to other SubCommand.\r
this.workingDir = targetPath;\r
}\r
\r
- protected String currentWorkspacePath;\r
-\r
- public void setCurrentWorkspacePath(String currentWorkspacePath) {\r
- this.currentWorkspacePath = currentWorkspacePath;\r
- }\r
-\r
/**\r
* This method is called by CLI entry class.\r
* <p>\r
private String buildPath = null;
private String dataPath = null;
- private String toolchainId = null;
- private String platformId = null;
- private String targetId = null;
+ public String toolchainId = null;
+ public String platformId = null;
+ public String targetId = null;
private String HEADLESS_CMD = "%s/eclipse -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild "
+ "-import %s "
sbi = SmartBuildInterface.getInstance();
idePath = InstallPathConfig.getSDKPath() + File.separatorChar + "ide";
-
- if (workingDir == null) {
- importPath = currentWorkspacePath;
- } else {
- importPath = workingDir.getAbsolutePath();
+ try {
+ importPath = workingDir.getCanonicalPath();
+ } catch (IOException e) {
+ e.printStackTrace();
}
if(!isVaildImportPathAndConfiguration(importPath, configuration)) {