From e95acf2dd025165327c05648fd69066d8642ccdd Mon Sep 17 00:00:00 2001 From: "shingil.kang" Date: Fri, 29 Nov 2013 00:54:28 +0900 Subject: [PATCH] CLI: Added sub command annotation, changed the output directory of web project, not added web ui builder template. Added create command annotation. created web project under directory with project name. not supported web ui builder template. Change-Id: I1ee2c88de2f352d363d1b5523acdf9000bcf7ae6 Signed-off-by: shingil.kang --- .../src/org/tizen/ncli/ide/shell/CreateCLI.java | 11 +++-------- .../src/org/tizen/ncli/ide/shell/CreateWebProjectCLI.java | 4 +++- .../tizen/ncli/ide/subcommands/CreateProjectCommandData.java | 7 ++++--- .../tizen/ncli/ide/subcommands/CreateWebProjectCommand.java | 7 +++++-- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateCLI.java b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateCLI.java index 24ee12d..a51f97b 100644 --- a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateCLI.java +++ b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateCLI.java @@ -6,10 +6,10 @@ import org.kohsuke.args4j.spi.SubCommandHandler; import org.kohsuke.args4j.spi.SubCommands; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.tizen.ncli.core.TizenSubCommand; import org.tizen.ncli.core.TizenSubCommandHandler; - - +@TizenSubCommand(name="create" , usage="Create tizen resource") public class CreateCLI extends AbstractCLI { private Logger log = LoggerFactory.getLogger(CreateCLI.class); @@ -21,8 +21,8 @@ public class CreateCLI extends AbstractCLI { @SubCommand(name = "security-profile-item", impl = CreateSecProfileItemCLI.class), @SubCommand(name = "certificate", impl = CreateCertificateCLI.class) }) - private AbstractCLI tizenCLI; + private AbstractCLI tizenCLI; /* (non-Javadoc) * @see org.tizen.ncli.ide.shell.TizenCLI#execute() @@ -34,11 +34,6 @@ public class CreateCLI extends AbstractCLI { if( null != this.tizenCLI) { this.tizenCLI.execute(); } - - } - - - } diff --git a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateWebProjectCLI.java b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateWebProjectCLI.java index 3ca93f1..b0706ee 100644 --- a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateWebProjectCLI.java +++ b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/CreateWebProjectCLI.java @@ -75,12 +75,14 @@ public class CreateWebProjectCLI extends AbstractCLI try { File outputDirectory = (workingDir != null ? workingDir : currentWorkspacePath); - webCommand.setOutputName(outputDirectory.getCanonicalPath()); + webCommand.setOutputName(outputDirectory.getCanonicalPath() + File.separatorChar + webCommand.getProjectName()); } catch (IOException e) { logger.error(e.getMessage()); } webCommand.runCommand(); + + System.out.println("Creating web project succeeded!"); } } diff --git a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateProjectCommandData.java b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateProjectCommandData.java index a6e9a7c..6b1405b 100644 --- a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateProjectCommandData.java +++ b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateProjectCommandData.java @@ -32,12 +32,10 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.regex.Pattern; import org.tizen.common.AppIdGenerator; import org.tizen.common.core.application.InstallPathConfig; import org.tizen.common.util.FileUtil; -import org.tizen.ncli.ide.shell.TizenAppType; import org.tizen.web.model.TizenAppTemplate; import org.tizen.web.model.TizenModelFactory; @@ -52,7 +50,7 @@ public class CreateProjectCommandData private static final String TIZEN_WEB_APP_TEMPLATE_FILE = "tizen-app-template.xml"; private static final String TIZEN_PROJECT_DESCRIPTION_FILE = ".tproject"; private static final String TIZEN_PROJECT_FOLDER = "project"; - private static final String TIZEN_PROJECT_CONFIG_PATH = "config" + File.separator + "config.xml"; + private static final String IGNORE_PROJECT = "Tizen Web UI Builder"; public static final String DEFAULT_TEMPLATE_NAME = "TizenBasic"; public static final String DEFAULT_PROJECT_NAME = "basic"; @@ -80,6 +78,9 @@ public class CreateProjectCommandData for (File f : fileArray) { + if(f.getParentFile().getParentFile().getName().equalsIgnoreCase(IGNORE_PROJECT)) + continue; + tizenAppTemplate = TizenModelFactory.unmarshalAppTemplate(f); String templateName = tizenAppTemplate.getTemplateId(); fileNameArray.add(templateName); diff --git a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateWebProjectCommand.java b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateWebProjectCommand.java index d90810a..9e50ade 100644 --- a/org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateWebProjectCommand.java +++ b/org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/CreateWebProjectCommand.java @@ -170,6 +170,11 @@ public class CreateWebProjectCommand extends AbstractSubCommand