+/*
+ * 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;
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
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;
}
}