[Title] make default binary name as a project name
authorho.namkoong <ho.namkoong@samsung.com>
Tue, 23 Apr 2013 06:01:43 +0000 (15:01 +0900)
committerho.namkoong <ho.namkoong@samsung.com>
Tue, 23 Apr 2013 06:21:51 +0000 (15:21 +0900)
[Type]
[Module]
[Priority]
[Jira#]
[Redmine#] 9130
[Problem]
[Cause]
[Solution]
[TestCase]

Change-Id: Ia7f2704c786a9eef68ce677cca648d89f89d089a

Conflicts:

org.tizen.cli/src/org/tizen/cli/exec/gen/NativeMain.java

org.tizen.cli/src/org/tizen/cli/exec/gen/CLIProjectGenerator.java
org.tizen.cli/src/org/tizen/cli/exec/gen/NativeMain.java

index e31ed3a..7760d0a 100644 (file)
@@ -115,7 +115,8 @@ public class CLIProjectGenerator extends AbstractProjectGenerator {
     @Override
     public void pressDefaultPostValueStore(Map<String, String> valueStore, TizenTemplate template) throws TizenProcessFailureException {
         
-        pressValueStoreForSrcObjDep(valueStore, template);
+        //MACRO_SRCS, MACRO_OBJ, MACRO_DEP is not used in makefile anymore.
+//        pressValueStoreForSrcObjDep(valueStore, template);
         pressValueStoreForBuildData(valueStore, template);
         
         String projectName = template.getProjectName();
index dc6ac6c..29f4ba7 100644 (file)
@@ -53,6 +53,7 @@ import org.tizen.nativecommon.templateengine.build.model.RootstrapModel;
 import org.tizen.nativecommon.templateengine.build.model.TargetModel;
 import org.tizen.nativecommon.templateengine.build.util.BuildPluginUtil;
 import org.tizen.nativecommon.templateengine.model.TizenTemplate;
+import org.tizen.nativecpp.misc.core.NewAppXmlStore;
 
 public class NativeMain extends AbstractLauncher {
     
@@ -189,12 +190,6 @@ public class NativeMain extends AbstractLauncher {
     private void executeMakefile(CommandLine cmdLine) throws Exception {
         
         Prompter prompter = getPrompter();
-        File manifestFile = new File("manifest.xml");
-        
-        if(!manifestFile.exists()) {
-            prompter.error("manifext.xml does not exist.");
-            return;
-        }
         
         String projectType = cmdLine.getOptionValue(OPTION_MAKE_PROJECTTYPE);
         String projectId = PROJECTTYPE_MAP.get(projectType);
@@ -205,13 +200,26 @@ public class NativeMain extends AbstractLauncher {
         }
         
         String binaryName = cmdLine.getOptionValue(OPTION_MAKE_BINARY);
+        String projectPath = new File(StringUtil.EMPTY_STRING).getAbsolutePath();
         
         if(StringUtil.isEmpty(binaryName)) {
-            binaryName = new File(StringUtil.EMPTY_STRING).getName();
+            
+            //Only application has a manifest.xml
+            if(projectType.equals(PROJECTTYPE_APP)) {
+                File manifestFile = new File("manifest.xml");
+                if(!manifestFile.exists()) {
+                    prompter.error("manifext.xml does not exist.");
+                    return;
+                }
+                NewAppXmlStore store = new NewAppXmlStore();
+                store.loadXML(manifestFile.getAbsolutePath());
+                binaryName = store.getModel().getAppList().get(0).getName();
+            }
+            else {
+                binaryName = FileUtil.getFileNameFromPath(projectPath);
+            }
         }
         
-        String projectPath = new File(StringUtil.EMPTY_STRING).getAbsolutePath();
-        
         TargetModel target = BuildPluginManagerForCLI.getDefaultTarget(projectId, BuildPluginUtil.ARCH_I386);
         RootstrapModel rootstrap = target.getRootstrap();
         HashMap<String, DevPackageModel> devPkgMap = BuildPluginManagerForCLI.DEVPKG_MAP.get(rootstrap.getId());