Base Image: add profile extension attribute to base image
authorjihye424.kim <jihye424.kim@samsung.com>
Fri, 7 Aug 2015 05:32:05 +0000 (14:32 +0900)
committerjihye424.kim <jihye424.kim@samsung.com>
Fri, 7 Aug 2015 06:33:16 +0000 (15:33 +0900)
Change-Id: Ibd1ea361e8c2cc5868e566ad555d2cd57df9b168
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/platform/BaseImage.java
src/org/tizen/emulator/manager/plugin/PluginStringResources.java
src/org/tizen/emulator/manager/resources/StringResources.java
src/org/tizen/emulator/manager/vms/option/CommonOption.java

index 28234b7..6db6c0b 100644 (file)
@@ -37,6 +37,7 @@ import java.util.Properties;
 import java.util.logging.Level;
 
 import org.tizen.emulator.manager.logging.EMLogger;
+import org.tizen.emulator.manager.plugin.PluginStringResources;
 import org.tizen.emulator.manager.resources.FilePathResources;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.template.ITemplate;
@@ -55,6 +56,7 @@ public class BaseImage {
        protected String imageName;
        protected String version;
        protected String profile;
+       protected String extension;
        protected String type;
        protected Architecture cpu;
        protected SKIN_SHAPE skinShape;
@@ -166,6 +168,10 @@ public class BaseImage {
                return binaryVersion;
        }
 
+       public String getProfileExtension() {
+               return extension;
+       }
+
        public List<IOption> getOptionList() {
                if (optionList == null) {
                        optionList = itemTemplate.makeOptionList(platform.getPlugin());
@@ -225,6 +231,7 @@ public class BaseImage {
                                imageName = prop.getProperty(StringResources.IMAGE_NAME, ""); //$NON-NLS-1$
                                version = prop.getProperty(StringResources.IMAGE_VERSION, "2.4"); //$NON-NLS-1$
                                profile = prop.getProperty(StringResources.PRODUCT_PROFILE, PlatformStringResources.MOBILE_PROFILE).toLowerCase();
+                               extension = prop.getProperty(StringResources.PROFILE_EXTENSION, "");
                                type = prop.getProperty(StringResources.IMAGE_TYPE, "default"); //$NON-NLS-1$
                                String cpuValue = prop.getProperty(StringResources.TARGET_CPU, "i386"); //$NON-NLS-1$
                                cpu = Architecture.getType(cpuValue);
@@ -257,6 +264,9 @@ public class BaseImage {
                cpu     = findCpuTypeFromPath(); //$NON-NLS-1$
                skinShape = SKIN_SHAPE.NONE; // TODO
                binaryVersion = ""; //$NON-NLS-1$
+               extension = platform.isChildPlatform()
+                               ? platform.getPlugin().getAttribute(PluginStringResources.Extension)
+                               : "";
        }
 
        private Architecture findCpuTypeFromPath() {
index 35b5cb0..6ee24c5 100644 (file)
@@ -51,6 +51,7 @@ public class PluginStringResources {
        // base platform name
        public final static String BasePlatform = "Base-Platform"; //$NON-NLS-1$
        public final static String EmulatorDir = "Emulator-Dir"; //$NON-NLS-1$
+       public final static String Extension = "Extension";
 
        private static ArrayList<String> pointList = new ArrayList<String>();
        static {
index 3e2d947..77adac4 100644 (file)
@@ -90,7 +90,7 @@ public class StringResources {
        public static final String PRODUCT_PROFILE = "profile"; //$NON-NLS-1$
        public static final String BINARY_VERSION="binary_version"; //$NON-NLS-1$
        public static final String TIZEN_SDK_VERSION="TIZEN_SDK_VERSION"; //$NON-NLS-1$
-
+       public static final String PROFILE_EXTENSION = "profile.ext";
 
        // SKIN Info
        public static final String SKIN_INFO_FILENAME = "info.ini"; //$NON-NLS-1$
index a619a0b..31547a2 100644 (file)
@@ -43,7 +43,10 @@ public class CommonOption extends Option {
 
                // Add variables
                config.addVariableWithSpace(OPTION_KEY.VAR_VMS_PATH, FilePathResources.getTizenVmsPath());
-               config.addVariable(OPTION_KEY.VAR_PROFILE, property.getPropertyValue().baseImage.getProfile());
+               config.addVariable(OPTION_KEY.VAR_PROFILE,
+                               property.getPropertyValue().baseImage.getProfile()
+                               + (property.getPropertyValue().baseImage.getProfileExtension().isEmpty()
+                                               ? "" : "-"+ property.getPropertyValue().baseImage.getProfileExtension()));
 
                // kernel log
                config.addKernelOption("console", "ttyS0"); //$NON-NLS-1$ //$NON-NLS-2$