[Title] Decide what the project is for existing (org.tizen.*).xml file
authordonghyuk.yang <donghyuk.yang@samsung.com>
Mon, 3 Jun 2013 05:00:07 +0000 (14:00 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Tue, 4 Jun 2013 07:52:08 +0000 (16:52 +0900)
org.tizen.nativeplatform/src/org/tizen/nativeplatform/PlatformProject.java

index aed803e..b69e2de 100644 (file)
@@ -1,3 +1,30 @@
+/*
+ * Native Platform
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Donghyuk Yang <donghyuk.yang@samsung.com>  
+ * DongHee Yang <donghee.yang@samsung.com>
+ * Kangho Kim <kh5325.kim@samsung.com>
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
 package org.tizen.nativeplatform;
 
 import java.io.File;
@@ -14,26 +41,26 @@ import org.tizen.common.TizenProjectType;
 import org.tizen.nativecommon.ProjectUtil;
 import org.tizen.nativeplatform.build.PlatformConfigurationManager;
 import org.tizen.nativeplatform.filefilter.XmlFileFilter;
-import org.tizen.nativeplatform.util.PlatformProjectUtil;
 
 public class PlatformProject implements IPlatformProject, IAdaptable {
+    private final String PKG_PREFIX = "org.tizen.";
     private IProject project;
-    
+
     public PlatformProject(IProject project) {
         this.project = project;
     }
-    
+
     @Override
     @SuppressWarnings("rawtypes")
     public Object getAdapter(Class adapter) {
         return Platform.getAdapterManager().getAdapter(this, adapter);
     }
-    
+
     @Override
     public String getAppId() {
-       //return PlatformProjectUtil.getAppId(project);
-        //return ProjectUtil.getAppId(getProject());
-       return null;
+        // return PlatformProjectUtil.getAppId(project);
+        // return ProjectUtil.getAppId(getProject());
+        return null;
     }
 
     @Override
@@ -61,32 +88,34 @@ public class PlatformProject implements IPlatformProject, IAdaptable {
         IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
 
         IConfiguration[] configs = info.getManagedProject().getConfigurations();
-        for(IConfiguration config: configs) {
+        for (IConfiguration config : configs) {
             list.add(config.getName());
         }
         return list;
     }
-    
+
     @Override
     public String getDefaultBuildConfiguration() {
-        //return PlatformProjectUtil.getDefaultConfiguration(project).getName();
-       return null;
+        // return
+        // PlatformProjectUtil.getDefaultConfiguration(project).getName();
+        return null;
     }
 
     protected IProject getProject() {
         return project;
-    }    
+    }
 
     @Override
-    public boolean isEFLApplication() { 
-       File projectPath = project.getLocation().toFile();
-       // get ".xml" file list
-       String[] files = projectPath.list(new XmlFileFilter());
-               // return false if ".xml" file does not exist
-               if (files.length == 0) {
-                       return false;
-               } else {
-               return true;                    
-               }
+    public boolean isEFLApplication() {
+        File projectPath = project.getLocation().toFile();
+        // get ".xml" file list
+        String[] files = projectPath.list(new XmlFileFilter());
+        // return false if ".xml" file does not exist
+        for (String file : files) {
+            if (file.trim().startsWith(PKG_PREFIX)) {
+                return true;
+            }
+        }
+        return false;
     }
 }