BUILD: INDEX: Modified default include directories
authordonghyuk.yang <donghyuk.yang@samsung.com>
Sat, 29 Mar 2014 14:44:53 +0000 (23:44 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Sat, 29 Mar 2014 14:44:53 +0000 (23:44 +0900)
Removed architecture dependency in default include directories

Change-Id: I6adcc413a11a7bd163853f0880f7cef5baab5ce1
Signed-off-by: donghyuk.yang <donghyuk.yang@samsung.com>
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformConfigurationEnvVarSupplier.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/indexer/DefaultIncludePathImporter.java

index 2412563..d6e1422 100644 (file)
@@ -44,11 +44,11 @@ public class PlatformConfigurationEnvVarSupplier implements
     @Override
     public IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration,
             IEnvironmentVariableProvider provider) {
-
+        SmartBuildInterface sbi = SmartBuildInterface.getInstance();
         if (variableName.equals("SBI_SYSROOT")) {
             // set "SBI_SYSROOT" variable
             String basePath = PlatformConfigurationManager.getRootstrapPath(configuration);
-            String sysrootPath = SmartBuildInterface.getInstance().getPlatformRootstrapPath(
+            String sysrootPath = sbi.getPlatformRootstrapPath(
                     basePath);
             if (sysrootPath == null) {
                 sysrootPath = "";
@@ -69,6 +69,15 @@ public class PlatformConfigurationEnvVarSupplier implements
             }
             return new BuildEnvVar("BUILD_TYPE", buildtype,
                     IBuildEnvironmentVariable.ENVVAR_REPLACE, null);
+        } else if (variableName.equals("TOOLCHAIN_PREFIX")) {
+            String target = PlatformConfigurationManager.getBuildTargetName(configuration);
+            if (target == null) {
+                return null;
+            }
+            String toolchain = sbi.getToolchainIDFromTargetID(target);
+            String value = SmartBuildInterface.getInstance().getToolchainPropertyValue(toolchain, "TOOLCHAIN_PREFIX");
+            return new BuildEnvVar("TOOLCHAIN_PREFIX", value,
+                    IBuildEnvironmentVariable.ENVVAR_REPLACE, null);
         }
         return null;
     }
@@ -78,7 +87,7 @@ public class PlatformConfigurationEnvVarSupplier implements
             IEnvironmentVariableProvider provider) {
 
         List<IBuildEnvironmentVariable> list = new ArrayList<IBuildEnvironmentVariable>();
-        final String[] buildEnvs = { "SBI_SYSROOT", "BUILD_TYPE" };
+        final String[] buildEnvs = { "SBI_SYSROOT", "BUILD_TYPE", "TOOLCHAIN_PREFIX" };
         String[] envs = buildEnvs;
 
         for (String env : envs) {
index 7fec1a4..a494595 100644 (file)
@@ -45,9 +45,7 @@ import org.xml.sax.SAXParseException;
 @SuppressWarnings("restriction")
 public class DefaultIncludePathImporter {
     private IProject project = null;
-
-    private final String DEFAULT_INCLUDES_X86_XMLFILE = "platform_includes_x86.xml";
-    private final String DEFAULT_INCLUDES_ARM_XMLFILE = "platform_includes_arm.xml";
+    private final String DEFAULT_INCLUDES_XMLFILE = "platform_includes.xml";
 
     private final Logger logger = LoggerFactory.getLogger(DefaultIncludePathImporter.class);
 
@@ -57,22 +55,13 @@ public class DefaultIncludePathImporter {
 
     public boolean process() {
         IPath idePath = new Path(InstallPathConfig.getSDKPath()).append("ide");
-
-        IPath x86IncludeFilePath = idePath.append(DEFAULT_INCLUDES_X86_XMLFILE);
-        if (!x86IncludeFilePath.toFile().exists()) {
-            logger.warn(String.format("File could not be imported: %s",
-                    x86IncludeFilePath.toOSString()));
-            return false;
-        }
-        String x86IncludeFile = x86IncludeFilePath.toOSString();
-
-        IPath armIncludeFilePath = idePath.append(DEFAULT_INCLUDES_ARM_XMLFILE);
-        if (!armIncludeFilePath.toFile().exists()) {
+        IPath includeFilePath = idePath.append(DEFAULT_INCLUDES_XMLFILE);
+        if (!includeFilePath.toFile().exists()) {
             logger.warn(String.format("File could not be imported: %s",
-                    armIncludeFilePath.toOSString()));
+                    includeFilePath.toOSString()));
             return false;
         }
-        String armIncludeFile = armIncludeFilePath.toOSString();
+        String includeFile = includeFilePath.toOSString();
 
         List<ISettingsProcessor> processors = getSettingProcessor();
         Map<String, ISettingsProcessor> importers = new HashMap<String, ISettingsProcessor>();
@@ -80,21 +69,13 @@ public class DefaultIncludePathImporter {
             importers.put(processor.getSectionName(), processor);
         }
 
-        List<ISettingsProcessor> processors2 = getSettingProcessor();
-        Map<String, ISettingsProcessor> importers2 = new HashMap<String, ISettingsProcessor>();
-        for (ISettingsProcessor processor : processors2) {
-            importers2.put(processor.getSectionName(), processor);
-        }
-
         try {
-            // make x86 pair list (importer, section)
-            List<ImporterSectionPair> x86Pairs = setImporterSectionPair(x86IncludeFile, importers);
-
-            // make arm pair list (importer, section)
-            List<ImporterSectionPair> armPairs = setImporterSectionPair(armIncludeFile, importers2);
+            // make pair list (importer, section)
+            List<ImporterSectionPair> pairs = setImporterSectionPair(includeFile, importers);
 
             // read xml and set it to project description
-            ICProjectDescription writableDescription = readSectionXML(project, x86Pairs, armPairs);
+            ICProjectDescription writableDescription = readSectionXML(project, pairs);
+
             // set changed project description by xml
             CoreModel.getDefault().setProjectDescription(project, writableDescription);
         } catch (FileNotFoundException e) {
@@ -147,8 +128,7 @@ public class DefaultIncludePathImporter {
         return pairs;
     }
 
-    private ICProjectDescription readSectionXML(IProject project,
-            List<ImporterSectionPair> x86Pairs, List<ImporterSectionPair> armPairs)
+    private ICProjectDescription readSectionXML(IProject project, List<ImporterSectionPair> pairs)
             throws SettingsImportExportException {
         IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
         IConfiguration defaultConfig = info.getDefaultConfiguration();
@@ -158,14 +138,8 @@ public class DefaultIncludePathImporter {
             ICConfigurationDescription writableConfig = writableDescription
                     .getConfigurationById(config.getId());
             ICFolderDescription writableProjectRoot = writableConfig.getRootFolderDescription();
-            if (config.getName().endsWith("Emulator")) {
-                for (ImporterSectionPair pair : x86Pairs) {
-                    pair.importer.readSectionXML(writableProjectRoot, pair.section);
-                }
-            } else if (config.getName().endsWith("Device")) {
-                for (ImporterSectionPair pair : armPairs) {
-                    pair.importer.readSectionXML(writableProjectRoot, pair.section);
-                }
+            for (ImporterSectionPair pair : pairs) {
+                pair.importer.readSectionXML(writableProjectRoot, pair.section);
             }
         }
         return writableDescription;