From: shingil.kang Date: Fri, 7 Feb 2014 08:20:19 +0000 (+0900) Subject: CLI: Improved the logic to create the web configuraton file X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F24%2F16124%2F1;p=sdk%2Ftools%2Fcli.git CLI: Improved the logic to create the web configuraton file Added config template file Change-Id: Ic29b4579fc64291f9f585f0fcfd5e451f2ccbcb3 Signed-off-by: shingil.kang --- diff --git a/build.xml b/build.xml index e132dab..68888e4 100644 --- a/build.xml +++ b/build.xml @@ -58,7 +58,11 @@ - + + + + @@ -68,6 +72,4 @@ - - diff --git a/org.tizen.ncli.ide/resources/config.xml b/org.tizen.ncli.ide/resources/config.xml new file mode 100644 index 0000000..d81de2d --- /dev/null +++ b/org.tizen.ncli.ide/resources/config.xml @@ -0,0 +1,8 @@ + + + + + + + ${WIDGET_ID} + \ No newline at end of file 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 4ac6c16..bde4e88 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 @@ -771,9 +771,7 @@ class ProjectGenUtil { protected final Logger logger = LoggerFactory.getLogger( getClass() ); - private final String CONFIG_FILE = "/config/Tizen/config.xml"; - private final String CONFIG_EXTRA_TIZEN_INFO = " "; - private final String CONFIG_EXTRA_NAME_INFO = " ${WIDGET_ID}"; + private final String CONFIG_FILE = "/resources/config.xml"; public void copyConfigFile(String destConfigPath) { @@ -787,61 +785,12 @@ class ProjectGenUtil FileUtil.redirectStream(ips, fos); } catch (IOException e) { - // logger.error(e.getMessage()); + logger.error("Error occurs while creating config.xml file", e.getMessage()); } finally { IOUtil.tryClose(ips, fos); } - - addExtraInfo2Config(destConfigPath); - } - - public void addExtraInfo2Config(String destConfigPath) - { - OutputStreamWriter out = null; - Scanner scanner = null; - - String newLine = System.getProperty("line.separator"); - File destConfigFile = null; - File outputConfigFile = null; - - try - { - scanner = new Scanner(new FileInputStream(destConfigPath)); - out = new OutputStreamWriter(new FileOutputStream(destConfigPath + ".output")); - - String line; - while (scanner.hasNextLine()) - { - line = scanner.nextLine(); - - out.write(line); - out.write(newLine); - - if (line.startsWith("