WIZARD: Use project wizard to create tizen platform project from normal
authordonghyuk.yang <donghyuk.yang@samsung.com>
Sat, 22 Feb 2014 07:58:32 +0000 (16:58 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Sat, 22 Feb 2014 07:58:32 +0000 (16:58 +0900)
git project.

Use project wizard to create tizen platform project from normal git
project. If the specified project location has ".git" directory, do not
create ".git" directory. It occurs exception.

Change-Id: I7f5d1ea65c2eb3bf3de7c7b53c1c19bac76af753
Signed-off-by: donghyuk.yang <donghyuk.yang@samsung.com>
org.tizen.nativeplatform/src/org/tizen/nativeplatform/wizards/TizenPlatformProjectWizard.java

index 754d7b0..c6a2d5b 100644 (file)
@@ -65,8 +65,7 @@ public class TizenPlatformProjectWizard extends TizenProjectWizard {
     private final static String Title = resources.getString("WizardPage.Title");
     private final static String Description = resources.getString("WizardPage.Description");
 
-    private static final Logger logger = LoggerFactory
-            .getLogger(TizenPlatformProjectWizard.class);
+    private static final Logger logger = LoggerFactory.getLogger(TizenPlatformProjectWizard.class);
 
     public TizenPlatformProjectWizard() {
         super(Title, Description);
@@ -82,8 +81,8 @@ public class TizenPlatformProjectWizard extends TizenProjectWizard {
 
     @Override
     public String[] getNatures() {
-        return new String[] { PlatformProjectNature.NATURE_ID,
-                CProjectNature.C_NATURE_ID, CCProjectNature.CC_NATURE_ID };
+        return new String[] { PlatformProjectNature.NATURE_ID, CProjectNature.C_NATURE_ID,
+                CCProjectNature.CC_NATURE_ID };
     }
 
     @Override
@@ -157,14 +156,15 @@ public class TizenPlatformProjectWizard extends TizenProjectWizard {
 
             // apply shared project
             commander.ApplySharedProject(newProject, getContainer());
-        }
-        else {
+        } else {
             result = super.performFinish();
 
             try {
                 FileRepository gitRepos = new FileRepository(newProject.getLocation().toString()
                         + "/.git");
-                gitRepos.create();
+                if (!gitRepos.getDirectory().exists()) {
+                    gitRepos.create();
+                }
             } catch (IOException e) {
                 DialogUtil.openMessageDialog("Warning: Converting the project to Git failed!");
             }