From bd6b8acab36b8ddf9be782791df972455543cbf2 Mon Sep 17 00:00:00 2001 From: "donghyuk.yang" Date: Mon, 3 Jun 2013 14:00:07 +0900 Subject: [PATCH] [Title] Decide what the project is for existing (org.tizen.*).xml file --- .../org/tizen/nativeplatform/PlatformProject.java | 73 +++++++++++++++------- 1 file changed, 51 insertions(+), 22 deletions(-) diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/PlatformProject.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/PlatformProject.java index aed803e..b69e2de 100644 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/PlatformProject.java +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/PlatformProject.java @@ -1,3 +1,30 @@ +/* + * Native Platform + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Donghyuk Yang + * DongHee Yang + * Kangho Kim + * + * 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; } } -- 2.7.4