# HG changeset patch # User stechong # Date 1275961855 18000 # Node ID 79471fd1fd69bf24fce44fb44a08d11ae49d5311 # Parent 1a693b01d10752055c7f54c2dce2afa52d8dc1e8 First pass refactoring ISymbianSDK. diff -r 1a693b01d107 -r 79471fd1fd69 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/BuildArgumentsInfo.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/BuildArgumentsInfo.java Fri Jun 04 16:34:02 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/BuildArgumentsInfo.java Mon Jun 07 20:50:55 2010 -0500 @@ -18,6 +18,7 @@ import com.nokia.carbide.cdt.builder.project.IBuildArgumentsInfo; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures; /* * Wrapper for the build arguments settings in Carbide Build Configuration preferences @@ -64,7 +65,7 @@ this.abldCleanArgs = ""; //$NON-NLS-1$ this.abldFreezeArgs = ""; //$NON-NLS-1$ - if (sdk.isEKA2()) { + if (sdk.getSupportedFeatures().contains(ISymbianSDKFeatures.IS_EKA2)) { this.abldFreezeArgs = "-r"; //$NON-NLS-1$ } diff -r 1a693b01d107 -r 79471fd1fd69 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/DefaultViewConfiguration.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/DefaultViewConfiguration.java Fri Jun 04 16:34:02 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/DefaultViewConfiguration.java Mon Jun 07 20:50:55 2010 -0500 @@ -20,8 +20,12 @@ import com.nokia.carbide.cpp.epoc.engine.model.IViewConfiguration; import com.nokia.carbide.cpp.epoc.engine.model.IViewParserConfiguration; import com.nokia.carbide.cpp.epoc.engine.preprocessor.*; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; import com.nokia.carbide.cpp.sdk.core.ISBSv2BuildContext; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.cpp.internal.api.utils.core.Check; import org.eclipse.core.resources.IProject; @@ -199,23 +203,32 @@ public Collection getMacros() { List macros = new ArrayList(); if (context != null) { - + ISymbianSDK sdk = context.getSDK(); + if (context instanceof ISBSv2BuildContext){ macros.add(DefineFactory.createDefine("SBSV2", null)); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + if (sbsv2BuildInfo != null) { + for (String platMacro : sbsv2BuildInfo.getPlatformMacros(sdk, context.getPlatformString())) { + macros.add(DefineFactory.createDefine(platMacro.trim(), platMacro.trim())); + } + } + } else { + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + for (String platMacro : sbsv1BuildInfo.getPlatformMacros(sdk, context.getPlatformString())) { + macros.add(DefineFactory.createDefine(platMacro.trim(), platMacro.trim())); + } + + for (String vendorMacro : sbsv1BuildInfo.getVendorSDKMacros(sdk)){ + macros.add(DefineFactory.createDefine(vendorMacro.trim(), vendorMacro.trim())); + } + } } for (IDefine macro : context.getVariantHRHDefines()) { macros.add(macro); } - - for (String platMacro : context.getSDK().getPlatformMacros(context.getPlatformString())) { - macros.add(DefineFactory.createDefine(platMacro.trim(), platMacro.trim())); - } - - for (String vendorMacro : context.getSDK().getVendorSDKMacros()){ - macros.add(DefineFactory.createDefine(vendorMacro.trim(), vendorMacro.trim())); - } - } macros.addAll(extraMacros); diff -r 1a693b01d107 -r 79471fd1fd69 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Fri Jun 04 16:34:02 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Mon Jun 07 20:50:55 2010 -0500 @@ -75,9 +75,12 @@ import com.nokia.carbide.cpp.epoc.engine.preprocessor.AcceptedNodesViewFilter; import com.nokia.carbide.cpp.epoc.engine.preprocessor.AllNodesViewFilter; import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; import com.nokia.carbide.cpp.internal.api.sdk.SymbianBuildContextDataCache; import com.nokia.carbide.cpp.sdk.core.ISBSv1BuildContext; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.internal.api.cpp.epoc.engine.model.pkg.EPKGLanguage; import com.nokia.carbide.internal.api.cpp.epoc.engine.model.pkg.IPKGEmbeddedSISFile; @@ -398,8 +401,17 @@ && context.getSDK().getEPOCROOT() != null && new File(context.getSDK().getEPOCROOT()).exists()) { defaultContext = context; - if (defaultContext.getSDK().getPrefixFile() != null) - break; + ISymbianSDK sdk = defaultContext.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + if (sbsv1BuildInfo != null) { + if (sbsv1BuildInfo.getPrefixFile(sdk) != null) + break; + } else if (sbsv2BuildInfo != null) { + if (sbsv2BuildInfo.getPrefixFile(sdk) != null) + break; + } + } } final ISymbianBuildContext defaultContextToUse = defaultContext; @@ -742,30 +754,36 @@ return null; } - String releasePlatform = buildConfig.getSDK().getBSFCatalog().getReleasePlatform(buildConfig.getPlatformString()); - IPath path = buildConfig.getSDK().getReleaseRoot().append(releasePlatform.toLowerCase()).append(buildConfig.getTargetString().toLowerCase()); + ISymbianSDK sdk = buildConfig.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + String releasePlatform = sbsv1BuildInfo.getBSFCatalog(sdk).getReleasePlatform(buildConfig.getPlatformString()); + IPath path = sbsv1BuildInfo.getReleaseRoot(sdk).append(releasePlatform.toLowerCase()).append(buildConfig.getTargetString().toLowerCase()); - // if targetpath is non-null and this is an EKA1 emulator config then add it - if (buildConfig.getPlatformString().equals(ISymbianBuildContext.EMULATOR_PLATFORM)) { - if (buildConfig.getSDK().getOSVersion().getMajor() < 9) { - String targetPath = mmpData.getSingleArgumentSettings().get(EMMPStatement.TARGETPATH); - if (targetPath != null) { - path = path.append("z").append(targetPath); //$NON-NLS-1$ + // if targetpath is non-null and this is an EKA1 emulator config then add it + if (buildConfig.getPlatformString().equals(ISymbianBuildContext.EMULATOR_PLATFORM)) { + if (buildConfig.getSDK().getOSVersion().getMajor() < 9) { + String targetPath = mmpData.getSingleArgumentSettings().get(EMMPStatement.TARGETPATH); + if (targetPath != null) { + path = path.append("z").append(targetPath); //$NON-NLS-1$ + } } } + + // adapt to variant, if needed + IPath targetPath = path.append(exePath); + if (isVariantBldInf(buildConfig.getCarbideProject().getAbsoluteBldInfPath()) || isFeatureVariantMMP(mmpData, info.getProject())) { + targetPath = getBinaryVariantTargetName(mmpData, targetPath, info.getProject()); + if (targetPath == null){ + return null; + } + } + + exePath = targetPath.toOSString(); } - // adapt to variant, if needed - IPath targetPath = path.append(exePath); - if (isVariantBldInf(buildConfig.getCarbideProject().getAbsoluteBldInfPath()) || isFeatureVariantMMP(mmpData, info.getProject())) { - targetPath = getBinaryVariantTargetName(mmpData, targetPath, info.getProject()); - if (targetPath == null){ - return null; - } - } - - exePath = targetPath.toOSString(); return exePath; + } }); } @@ -1082,7 +1100,15 @@ } } - IPath dataZDir = buildConfig.getSDK().getReleaseRoot().removeLastSegments(1).append("/data/z/"); //$NON-NLS-1$ + ISymbianSDK sdk = buildConfig.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + IPath releaseRoot; + if (sbsv1BuildInfo != null) { + releaseRoot = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + releaseRoot = new Path(sdk.getEPOCROOT()).append("epoc32/release"); + } + IPath dataZDir = releaseRoot.removeLastSegments(1).append("/data/z/"); //$NON-NLS-1$ // get the aifs List aifs = mmpData.getAifs(); @@ -1185,8 +1211,15 @@ public Object run(IBldInfView view) { EpocEnginePathHelper helper = new EpocEnginePathHelper(buildConfig); - - final String dataZDir = buildConfig.getSDK().getReleaseRoot().removeLastSegments(1).toOSString() + "\\data\\z\\"; //$NON-NLS-1$ + ISymbianSDK sdk = buildConfig.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + IPath releaseRoot; + if (sbsv1BuildInfo != null) { + releaseRoot = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + releaseRoot = new Path(sdk.getEPOCROOT()).append("epoc32/release"); + } + final String dataZDir = releaseRoot.removeLastSegments(1).toOSString() + "\\data\\z\\"; //$NON-NLS-1$ for (IMakefileReference ref : view.getAllMakefileReferences()) { final IPath workspaceRelativeMakefilePath = helper.convertToWorkspace(ref.getPath()); @@ -1772,7 +1805,13 @@ public static IPath[] getLibDirectoriesForBuildContext(ISymbianBuildContext buildContext) { ArrayList dirList = new ArrayList(); ISymbianSDK sdk = buildContext.getSDK(); - IPath releaseRoot = sdk.getReleaseRoot(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + IPath releaseRoot; + if (sbsv1BuildInfo != null) { + releaseRoot = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + releaseRoot = new Path(sdk.getEPOCROOT()).append("epoc32/release"); + } String platformString = buildContext.getPlatformString(); boolean isDebug = ISymbianBuildContext.DEBUG_TARGET.equals(buildContext.getTargetString()); // TODO is this correct, what about ARMv6? diff -r 1a693b01d107 -r 79471fd1fd69 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/builder/CarbideCPPBuilder.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/builder/CarbideCPPBuilder.java Fri Jun 04 16:34:02 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/builder/CarbideCPPBuilder.java Mon Jun 07 20:50:55 2010 -0500 @@ -76,12 +76,14 @@ import com.nokia.carbide.cpp.epoc.engine.model.mmp.IMMPData; import com.nokia.carbide.cpp.epoc.engine.model.mmp.IMMPResource; import com.nokia.carbide.cpp.epoc.engine.preprocessor.AcceptedNodesViewFilter; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils; import com.nokia.carbide.cpp.internal.qt.core.QtCorePlugin; -import com.nokia.carbide.cpp.internal.sdk.core.model.SDKManager; import com.nokia.carbide.cpp.internal.x86build.X86BuildPlugin; import com.nokia.carbide.cpp.sdk.core.ISBSv1BuildContext; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; import com.nokia.carbide.internal.api.cpp.epoc.engine.model.pkg.EPKGLanguage; import com.nokia.carbide.internal.api.cpp.epoc.engine.model.pkg.IPKGEmbeddedSISFile; @@ -638,7 +640,15 @@ targetPath = "sys\\bin\\"; //$NON-NLS-1$ } - String dataZDir = buildConfig.getSDK().getReleaseRoot().removeLastSegments(1).toOSString() + "\\Data\\z\\"; //$NON-NLS-1$ + ISymbianSDK sdk = buildConfig.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + IPath releaseRoot; + if (sbsv1BuildInfo != null) { + releaseRoot = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + releaseRoot = new Path(sdk.getEPOCROOT()).append("epoc32/release"); + } + String dataZDir = releaseRoot.removeLastSegments(1).toOSString() + "\\Data\\z\\"; //$NON-NLS-1$ IPath rezPath = null; List languages = null; @@ -1368,7 +1378,15 @@ args.add(resolvedPKGPath.toOSString()); args.add(sisName); - IPath makeSisPath = config.getSDK().getToolsPath().append(MAKESIS_EXE); + ISymbianSDK sdk = config.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + IPath toolsPath; + if (sbsv1BuildInfo != null) { + toolsPath = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + toolsPath = new Path(sdk.getEPOCROOT()).append("epoc32/tools"); + } + IPath makeSisPath = toolsPath.append(MAKESIS_EXE); cmdLauncher.writeToConsole("\n***Invoking " + MAKESIS_EXE + " ....\n"); cmdLauncher.setErrorParserManager(pkgPath.removeLastSegments(1), getParserIdArray(ICarbideBuildConfiguration.ERROR_PARSERS_SIS_BUILDER)); @@ -1476,6 +1494,14 @@ } IPath buildDirPath = getBuilder(config.getCarbideProject().getProject()).getMakefileDirectory(config); + ISymbianSDK sdk = config.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + IPath toolsPath; + if (sbsv1BuildInfo != null) { + toolsPath = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + toolsPath = new Path(sdk.getEPOCROOT()).append("epoc32/tools"); + } int signingMethod = sisInfo.getSigningType(); if (signingMethod != ISISBuilderInfo.DONT_SIGN) { @@ -1493,7 +1519,7 @@ cmdLauncher.writeToConsole("\n***Invoking makekeys....\n"); - IPath makekeys = config.getSDK().getToolsPath().append(MAKEKEYS_EXE); + IPath makekeys = toolsPath.append(MAKEKEYS_EXE); List makekeysArgList = new ArrayList(); makekeysArgList.add("-cert"); makekeysArgList.add("-password"); @@ -1527,7 +1553,7 @@ // call signsis... cmdLauncher.writeToConsole("\n***Invoking " + SIGNSIS_EXE + "....\n"); - IPath signsis = config.getSDK().getToolsPath().append(SIGNSIS_EXE); + IPath signsis = toolsPath.append(SIGNSIS_EXE); List signSISArgList = new ArrayList(); @@ -1745,7 +1771,15 @@ cmdLauncher.writeToConsole("\n***Invoking " + MAKESIS_EXE + " for partial upgrade....\n"); cmdLauncher.setErrorParserManager(pkgPath.removeLastSegments(1), getParserIdArray(ICarbideBuildConfiguration.ERROR_PARSERS_SIS_BUILDER)); - IPath makeSisPath = config.getSDK().getToolsPath().append(MAKESIS_EXE); + ISymbianSDK sdk = config.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + IPath toolsPath; + if (sbsv1BuildInfo != null) { + toolsPath = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + toolsPath = new Path(sdk.getEPOCROOT()).append("epoc32/tools"); + } + IPath makeSisPath = toolsPath.append(MAKESIS_EXE); int retVal = cmdLauncher.executeCommand(makeSisPath, args.toArray(new String[args.size()]), getResolvedEnvVars(config), pkgPath.removeLastSegments(1)); SubMonitor subMonitor = SubMonitor.convert(monitor, 1); @@ -1796,7 +1830,15 @@ // call signsis... cmdLauncher.writeToConsole("\n***Invoking " + SIGNSIS_EXE + " for partial upgrade....\n"); - IPath signsis = config.getSDK().getToolsPath().append(SIGNSIS_EXE); + ISymbianSDK sdk = config.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + IPath toolsPath; + if (sbsv1BuildInfo != null) { + toolsPath = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + toolsPath = new Path(sdk.getEPOCROOT()).append("epoc32/tools"); + } + IPath signsis = toolsPath.append(SIGNSIS_EXE); List signSISArgList = new ArrayList(); diff -r 1a693b01d107 -r 79471fd1fd69 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Fri Jun 04 16:34:02 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Mon Jun 07 20:50:55 2010 -0500 @@ -32,6 +32,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import com.nokia.carbide.cdt.builder.BuildArgumentsInfo; @@ -47,11 +48,13 @@ import com.nokia.carbide.cdt.internal.api.builder.SISBuilderInfo2; import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine; import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils; import com.nokia.carbide.cpp.internal.api.sdk.SDKManagerInternalAPI; import com.nokia.carbide.cpp.sdk.core.ISBSv1BuildContext; import com.nokia.carbide.cpp.sdk.core.ISBSv2BuildContext; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.cpp.internal.api.utils.core.TrackedResource; @@ -448,9 +451,13 @@ public IPath getTargetOutputDirectory() { String releasePlatform = ""; + ISymbianSDK sdk = getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); if (context instanceof ISBSv1BuildContext){ ISBSv1BuildContext v1Context = (ISBSv1BuildContext)context; - releasePlatform = getSDK().getBSFCatalog().getReleasePlatform(v1Context.getBasePlatformForVariation()); + if (sbsv1BuildInfo != null) { + releasePlatform = sbsv1BuildInfo.getBSFCatalog(sdk).getReleasePlatform(v1Context.getBasePlatformForVariation()); + } } if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(getCarbideProject().getProject())){ // Test is this is an SBSv2 build binary variant (changes the output directory) @@ -459,7 +466,13 @@ releasePlatform = releasePlatform + SBSv2Utils.getVariantOutputDirModifier(sbsv2Info.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT)); } } - return getSDK().getReleaseRoot().append(releasePlatform.toLowerCase()).append(getTargetString().toLowerCase()); + IPath releaseRoot; + if (sbsv1BuildInfo != null) { + releaseRoot = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + releaseRoot = new Path(sdk.getEPOCROOT()).append("epoc32/release"); + } + return releaseRoot.append(releasePlatform.toLowerCase()).append(getTargetString().toLowerCase()); } public boolean getRebuildNeeded() { diff -r 1a693b01d107 -r 79471fd1fd69 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Fri Jun 04 16:34:02 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Mon Jun 07 20:50:55 2010 -0500 @@ -17,25 +17,46 @@ package com.nokia.carbide.cdt.internal.builder; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.settings.model.*; +import org.eclipse.cdt.core.settings.model.CIncludePathEntry; +import org.eclipse.cdt.core.settings.model.CMacroEntry; +import org.eclipse.cdt.core.settings.model.CMacroFileEntry; +import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; +import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; +import org.eclipse.cdt.core.settings.model.ICProjectDescription; +import org.eclipse.cdt.core.settings.model.ICSettingEntry; +import org.eclipse.cdt.core.settings.model.ICStorageElement; import org.eclipse.cdt.core.settings.model.extension.CLanguageData; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ProjectScope; -import org.eclipse.core.runtime.*; -import org.eclipse.core.runtime.content.*; -import org.eclipse.swt.widgets.Display; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.content.IContentType; +import org.eclipse.core.runtime.content.IContentTypeManager; +import org.eclipse.core.runtime.content.IContentTypeSettings; import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; import com.nokia.carbide.cdt.builder.EpocEngineHelper; import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration; import com.nokia.carbide.cpp.epoc.engine.model.sbv.ISBVView; import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; import com.nokia.carbide.cpp.sdk.core.IBSFPlatform; import com.nokia.carbide.cpp.sdk.core.ISBVPlatform; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.cpp.internal.api.utils.core.FileUtils; import com.nokia.cpp.internal.api.utils.core.TextUtils; /** @@ -174,10 +195,20 @@ CarbideProjectInfo cpi = (CarbideProjectInfo)carbideBuildConfig.getCarbideProject(); IProject project = cpi.getProject(); + ISymbianSDK sdk = carbideBuildConfig.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); // add platform includes first - IBSFPlatform platform = carbideBuildConfig.getSDK().getBSFCatalog().findPlatform(carbideBuildConfig.getPlatformString()); - ISBVPlatform sbvPlat = carbideBuildConfig.getSDK().getSBVCatalog().findPlatform(carbideBuildConfig.getPlatformString()); + IBSFPlatform platform = null; + ISBVPlatform sbvPlat = null; + if (sbsv1BuildInfo != null) { + platform = sbsv1BuildInfo.getBSFCatalog(sdk).findPlatform(carbideBuildConfig.getPlatformString()); + sbvPlat = sbsv1BuildInfo.getSBVCatalog(sdk).findPlatform(carbideBuildConfig.getPlatformString()); + } else if (sbsv2BuildInfo != null) { + platform = sbsv2BuildInfo.getBSFCatalog(sdk).findPlatform(carbideBuildConfig.getPlatformString()); + sbvPlat = sbsv2BuildInfo.getSBVCatalog(sdk).findPlatform(carbideBuildConfig.getPlatformString()); + } if (platform != null) { IPath[] systemIncludePaths = platform.getSystemIncludePaths(); for (IPath path : systemIncludePaths) { @@ -224,7 +255,15 @@ } // add OEM dir - File oemDir = carbideBuildConfig.getSDK().getIncludePath().append("oem").toFile(); + IPath includePath; + if (sbsv1BuildInfo != null) { + includePath = sbsv1BuildInfo.getIncludePath(sdk); + } else if (sbsv2BuildInfo != null) { + includePath = sbsv2BuildInfo.getIncludePath(sdk); + } else { + includePath = new Path(sdk.getEPOCROOT()).append("epoc32/include"); + } + File oemDir = includePath.append("oem").toFile(); if (oemDir.exists()) { includeEntries.add(new CIncludePathEntry(new Path(oemDir.getAbsolutePath()), 0)); } @@ -237,8 +276,22 @@ Map macros = new HashMap(); // platform macros - for (String platMacro : carbideBuildConfig.getSDK().getPlatformMacros(carbideBuildConfig.getPlatformString())) { - macros.put("__" + platMacro + "__", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + if (sbsv1BuildInfo != null) { + // platform macros + for (String platMacro : sbsv1BuildInfo.getPlatformMacros(sdk, carbideBuildConfig.getPlatformString())) { + macros.put("__" + platMacro + "__", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } + + // vendor macros (e.g. __SERIES60_3x__) + for (String builtinMacro : sbsv1BuildInfo.getVendorSDKMacros(sdk)) { + macros.put(builtinMacro, ""); //$NON-NLS-1$ + } + } else if (sbsv2BuildInfo != null) { + // platform macros + for (String platMacro : sbsv2BuildInfo.getPlatformMacros(sdk, carbideBuildConfig.getPlatformString())) { + macros.put("__" + platMacro + "__", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } + } // built in macros @@ -246,19 +299,20 @@ macros.put(builtinMacro, ""); //$NON-NLS-1$ } - // vendor macros (e.g. __SERIES60_3x__) - for (String builtinMacro : carbideBuildConfig.getSDK().getVendorSDKMacros()) { - macros.put(builtinMacro, ""); //$NON-NLS-1$ - } - // target type macros (e.g. __DLL__) List targetTypes = EpocEngineHelper.getTargetTypesForBuildConfiguration(carbideBuildConfig); // only add these if there is one target type. this is the case when there is only one mmp file, or // more than one but all have the same target type macro. it wouldn't make sense to add different // target type macros like __EXE__ and __DLL__. if (targetTypes.size() == 1) { - for (String targetTypeMacro : carbideBuildConfig.getSDK().getTargetTypeMacros(targetTypes.get(0))) { - macros.put(targetTypeMacro, ""); //$NON-NLS-1$ + if (sbsv1BuildInfo != null) { + for (String targetTypeMacro : sbsv1BuildInfo.getTargetTypeMacros(sdk, targetTypes.get(0))) { + macros.put(targetTypeMacro, ""); //$NON-NLS-1$ + } + } else if (sbsv2BuildInfo != null) { + for (String targetTypeMacro : sbsv2BuildInfo.getTargetTypeMacros(sdk, targetTypes.get(0))) { + macros.put(targetTypeMacro, ""); //$NON-NLS-1$ + } } } diff -r 1a693b01d107 -r 79471fd1fd69 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java Fri Jun 04 16:34:02 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java Mon Jun 07 20:50:55 2010 -0500 @@ -78,11 +78,13 @@ import com.nokia.carbide.cpp.epoc.engine.model.mmp.IMMPData; import com.nokia.carbide.cpp.epoc.engine.model.mmp.IMMPResource; import com.nokia.carbide.cpp.epoc.engine.preprocessor.AcceptedNodesViewFilter; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.qt.core.QtCorePlugin; import com.nokia.carbide.cpp.sdk.core.IBSFPlatform; import com.nokia.carbide.cpp.sdk.core.ISBSv1BuildContext; import com.nokia.carbide.cpp.sdk.core.ISBVPlatform; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.cpp.internal.api.utils.core.FileUtils; import com.nokia.cpp.internal.api.utils.core.HostOS; @@ -137,14 +139,18 @@ areWeManagingTheMakeFiles = shouldManageMakeFiles(buildConfig); // if variant BSF, let them know the other platforms that will be built as a result - IBSFPlatform[] bsfPlatforms = buildConfig.getSDK().getBSFCatalog().getAdditionalBuiltPlatforms(buildConfig.getPlatformString()); - if (bsfPlatforms.length > 0) { - String plats = ""; - for (IBSFPlatform plat : bsfPlatforms) { - plats = ", " + plat.getName(); + ISymbianSDK sdk = buildConfig.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + IBSFPlatform[] bsfPlatforms = sbsv1BuildInfo.getBSFCatalog(sdk).getAdditionalBuiltPlatforms(buildConfig.getPlatformString()); + if (bsfPlatforms.length > 0) { + String plats = ""; + for (IBSFPlatform plat : bsfPlatforms) { + plats = ", " + plat.getName(); + } + plats = plats.replaceFirst(", ", ""); + launcher.writeToConsole("\n***Additionally built platforms: " + plats + "\n"); } - plats = plats.replaceFirst(", ", ""); - launcher.writeToConsole("\n***Additionally built platforms: " + plats + "\n"); } } @@ -655,7 +661,15 @@ } } - String dataZDir = buildConfig.getSDK().getReleaseRoot().removeLastSegments(1).toOSString() + "\\Data\\z\\"; //$NON-NLS-1$ + ISymbianSDK sdk = buildConfig.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + IPath releaseRoot; + if (sbsv1BuildInfo != null) { + releaseRoot = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + releaseRoot = new Path(sdk.getEPOCROOT()).append("epoc32/release"); + } + String dataZDir = releaseRoot.removeLastSegments(1).toOSString() + "\\Data\\z\\"; //$NON-NLS-1$ IPath rezPath = null; List languages = null; @@ -749,13 +763,20 @@ // add the following to the top of the the Deps_GenDependsL subroutine in makdeps.pm String change = "\r\n\t# Carbide.c++ change. See CARBIDE_CHANGES.TXT for more details.\r\n\tif ($ENV{CARBIDE_NO_DEPENDENCIES}) {\r\n\t\treturn;\r\n\t}\r\n"; + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + IPath toolsPath; + if (sbsv1BuildInfo != null) { + toolsPath = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + toolsPath = new Path(sdk.getEPOCROOT()).append("epoc32/tools"); + } boolean updated = false; try { - File mdFile = sdk.getToolsPath().append("makdeps.pm").toFile(); + File mdFile = toolsPath.append("makdeps.pm").toFile(); RandomAccessFile makDepsFile = new RandomAccessFile(mdFile, "rw"); // back up the file first - File backupFile = sdk.getToolsPath().append("makdeps.pmbak").toFile(); + File backupFile = toolsPath.append("makdeps.pmbak").toFile(); if (backupFile.createNewFile()) { FileUtils.copyFile(mdFile, backupFile); } @@ -792,7 +813,7 @@ } // now create the CARBIDE_CHANGES.TXT file - File ourFile = sdk.getToolsPath().append(CARBIDE_CHANGES_FILE).toFile(); + File ourFile = toolsPath.append(CARBIDE_CHANGES_FILE).toFile(); try { if (!ourFile.createNewFile()) { return false; @@ -2300,7 +2321,12 @@ } // we need to check the variant hrh files as well - File prefixFile = config.getSDK().getPrefixFile(); + ISymbianSDK sdk = config.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + File prefixFile = null; + if (sbsv1BuildInfo != null) { + prefixFile = sbsv1BuildInfo.getPrefixFile(sdk); + } if (prefixFile != null && prefixFile.lastModified() > oldestMakefileTimestamp) { return true; } @@ -2421,7 +2447,12 @@ final long makefileTimestamp = makefile.lastModified(); // we need to check the variant hrh files as well - File prefixFile = config.getSDK().getPrefixFile(); + ISymbianSDK sdk = config.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + File prefixFile = null; + if (sbsv1BuildInfo != null) { + prefixFile = sbsv1BuildInfo.getPrefixFile(sdk); + } if (prefixFile != null && prefixFile.lastModified() > makefileTimestamp) { return true; } @@ -2504,7 +2535,12 @@ final long makefileTimestamp = makefile.lastModified(); // we need to check the variant hrh files as well - File prefixFile = config.getSDK().getPrefixFile(); + ISymbianSDK sdk = config.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + File prefixFile = null; + if (sbsv1BuildInfo != null) { + prefixFile = sbsv1BuildInfo.getPrefixFile(sdk); + } if (prefixFile != null && prefixFile.lastModified() > makefileTimestamp) { return true; } @@ -2874,8 +2910,15 @@ } // add the compiler prefix file if any - ISBVPlatform sbvPlatform = config.getSDK().getSBVCatalog().findPlatform(config.getPlatformString()); - File sdkPrefix = config.getSDK().getPrefixFile(); + ISymbianSDK sdk = config.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBVPlatform sbvPlatform = null; + File sdkPrefix = null; + if (sbsv1BuildInfo != null) { + sbvPlatform = sbsv1BuildInfo.getSBVCatalog(sdk).findPlatform(config.getPlatformString()); + sdkPrefix = sbsv1BuildInfo.getPrefixFile(sdk); + } + if (sbvPlatform != null){ // might be an alternate HRH file to use IPath varVarHRH = sbvPlatform.getBuildVariantHRHFile(); @@ -2940,7 +2983,15 @@ // running gcc to get the version (which could be tricky), we can just check for the folder // \epoc32\gcc\lib\gcc-lib\arm-epoc-pe\3.0-psion-98r2. If it exists, we'll assume GCC 3.0 and treat it like GCCE. boolean isGCC30 = false; - if (config.getSDK().getToolsPath().removeLastSegments(1).append("gcc\\lib\\gcc-lib\\arm-epoc-pe\\3.0-psion-98r2").toFile().exists()) { + ISymbianSDK sdk = config.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + IPath toolsPath; + if (sbsv1BuildInfo != null) { + toolsPath = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + toolsPath = new Path(sdk.getEPOCROOT()).append("epoc32/tools"); + } + if (toolsPath.removeLastSegments(1).append("gcc\\lib\\gcc-lib\\arm-epoc-pe\\3.0-psion-98r2").toFile().exists()) { isGCC30 = true; } diff -r 1a693b01d107 -r 79471fd1fd69 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/SISBuilderInfo.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/SISBuilderInfo.java Fri Jun 04 16:34:02 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/SISBuilderInfo.java Mon Jun 07 20:50:55 2010 -0500 @@ -27,6 +27,7 @@ import com.nokia.carbide.cdt.internal.builder.gen.CarbideBuildConfig.CarbideBuildConfigFactory; import com.nokia.carbide.cdt.internal.builder.gen.CarbideBuildConfig.SisBuilderType; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures; /** * @deprecated use {@link SISBuilderInfo2} instead @@ -250,7 +251,7 @@ if (getCertificate().length() > 0) { return KEY_CERT_SIGN; } - if (sdk.isEKA2()) { + if (sdk.getSupportedFeatures().contains(ISymbianSDKFeatures.IS_EKA2)) { return SELF_SIGN; } return DONT_SIGN; diff -r 1a693b01d107 -r 79471fd1fd69 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/ArgumentsTabComposite.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/ArgumentsTabComposite.java Fri Jun 04 16:34:02 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/ArgumentsTabComposite.java Mon Jun 07 20:50:55 2010 -0500 @@ -30,6 +30,7 @@ import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration; import com.nokia.carbide.cdt.internal.builder.CarbideBuildConfiguration; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures; /** * Arguments tab for the Carbide Build Configurations page @@ -211,7 +212,7 @@ abldCleanEdit.setText(""); //$NON-NLS-1$ abldFreezeEdit.setText(""); //$NON-NLS-1$ - if (sdk.isEKA2()) { + if (sdk.getSupportedFeatures().contains(ISymbianSDKFeatures.IS_EKA2)) { abldFreezeEdit.setText("-r"); //$NON-NLS-1$ } } diff -r 1a693b01d107 -r 79471fd1fd69 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/SisFilesBlock.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/SisFilesBlock.java Fri Jun 04 16:34:02 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/ui/SisFilesBlock.java Mon Jun 07 20:50:55 2010 -0500 @@ -61,6 +61,7 @@ import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration; import com.nokia.carbide.cdt.builder.project.ISISBuilderInfo; import com.nokia.carbide.cdt.internal.api.builder.SISBuilderInfo2; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures; /** * A composite that displays files in a table. Files can be @@ -297,7 +298,7 @@ listCopy.add(new SISBuilderInfo2(info)); } - isEKA2 = buildConfig.getSDK().isEKA2(); + isEKA2 = buildConfig.getSDK().getSupportedFeatures().contains(ISymbianSDKFeatures.IS_EKA2); setFiles(listCopy); diff -r 1a693b01d107 -r 79471fd1fd69 builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/PreprocessHandler.java --- a/builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/PreprocessHandler.java Fri Jun 04 16:34:02 2010 -0500 +++ b/builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/PreprocessHandler.java Mon Jun 07 20:50:55 2010 -0500 @@ -80,9 +80,13 @@ import com.nokia.carbide.cpp.epoc.engine.model.mmp.IMMPData; import com.nokia.carbide.cpp.epoc.engine.model.mmp.IMMPResource; import com.nokia.carbide.cpp.epoc.engine.preprocessor.AcceptedNodesViewFilter; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; import com.nokia.carbide.cpp.internal.builder.utils.Activator; import com.nokia.carbide.cpp.internal.builder.utils.ui.LanguageSelectionDialog; import com.nokia.carbide.cpp.internal.builder.utils.ui.PreprocessPreferencePage; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.cpp.internal.api.utils.core.FileUtils; import com.nokia.cpp.internal.api.utils.core.HostOS; import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; @@ -196,7 +200,15 @@ } // add the sdk prefix file if any - File sdkPrefix = buildConfig.getSDK().getPrefixFile(); + ISymbianSDK sdk = buildConfig.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + File sdkPrefix = null; + if (sbsv1BuildInfo != null) { + sdkPrefix = sbsv1BuildInfo.getPrefixFile(sdk); + } else if (sbsv2BuildInfo != null) { + sdkPrefix = sbsv2BuildInfo.getPrefixFile(sdk); + } if (sdkPrefix != null && sdkPrefix.exists()) { args.add("-include"); //$NON-NLS-1$ args.add("\"" + sdkPrefix.getAbsolutePath() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ @@ -403,10 +415,18 @@ private List getMacros(ICarbideBuildConfiguration buildConfig, final IPath filePath, final IProgressMonitor monitor) { final List macros = new ArrayList(); - - // platform macros - for (String platMacro : buildConfig.getSDK().getPlatformMacros(buildConfig.getPlatformString())) { - macros.add("__" + platMacro + "__"); //$NON-NLS-1$ //$NON-NLS-2$ + ISymbianSDK sdk = buildConfig.getSDK(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + + if (sbsv1BuildInfo != null) { + // platform macros + for (String platMacro : sbsv1BuildInfo.getPlatformMacros(sdk, buildConfig.getPlatformString())) { + macros.add("__" + platMacro + "__"); //$NON-NLS-1$ //$NON-NLS-2$ + } + // vendor macros (e.g. __SERIES60_3x__) + for (String builtinMacro : sbsv1BuildInfo.getVendorSDKMacros(sdk)) { + macros.add(builtinMacro); + } } // built in macros @@ -414,11 +434,6 @@ macros.add(builtinMacro); } - // vendor macros (e.g. __SERIES60_3x__) - for (String builtinMacro : buildConfig.getSDK().getVendorSDKMacros()) { - macros.add(builtinMacro); - } - IProject project = buildConfig.getCarbideProject().getProject(); List mmps = EpocEngineHelper.getMMPsForSource(project, filePath); diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.codescanner/src/com/nokia/carbide/cpp/internal/codescanner/kb/CSKbManager.java --- a/core/com.nokia.carbide.cpp.codescanner/src/com/nokia/carbide/cpp/internal/codescanner/kb/CSKbManager.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.codescanner/src/com/nokia/carbide/cpp/internal/codescanner/kb/CSKbManager.java Mon Jun 07 20:50:55 2010 -0500 @@ -40,6 +40,7 @@ import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration; import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.codescanner.CSPlugin; import com.nokia.carbide.cpp.internal.codescanner.Messages; import com.nokia.carbide.cpp.internal.codescanner.config.CSConfigSettings; @@ -68,6 +69,7 @@ import com.nokia.carbide.cpp.internal.codescanner.gen.Kbdata.SolutionType; import com.nokia.carbide.cpp.internal.codescanner.gen.Kbdata.SymptomType; import com.nokia.carbide.cpp.internal.codescanner.xml.CSKbdataXMLLoader; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; /** @@ -393,8 +395,11 @@ for (Iterator iterator = buildConfigList.iterator(); iterator.hasNext();) { ICarbideBuildConfiguration buildConfig = iterator.next(); ISymbianSDK sdk = buildConfig.getSDK(); - Version version = sdk.getSDKVersion(); - sdkVersions.add(version); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + Version version = sbsv1BuildInfo.getSDKVersion(sdk); + sdkVersions.add(version); + } } } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/DevicesLoaderTest.java --- a/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/DevicesLoaderTest.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/DevicesLoaderTest.java Mon Jun 07 20:50:55 2010 -0500 @@ -16,6 +16,7 @@ */ package com.nokia.carbide.cpp.sdk.core.test; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DeviceType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DevicesType; import com.nokia.carbide.cpp.internal.sdk.core.xml.DevicesLoader; @@ -59,13 +60,13 @@ Version osVersion = new Version("9.1"); Version sdkVersion = new Version("3.0"); - ISymbianSDK sdk = SymbianSDKFactory.createInstance(S60_SDKID, M_DRIVE, ISymbianSDK.SERIES60_SDK_NAME, osVersion, "", sdkVersion, true); + ISymbianSDK sdk = SymbianSDKFactory.createInstance(S60_SDKID, M_DRIVE, ISBSv1BuildInfo.SERIES60_SDK_NAME, osVersion, "", sdkVersion, true); DevicesLoader.updateDevice(sdk, devicesFile.toURI().toURL()); - sdk = SymbianSDKFactory.createInstance(TV_SDKID, P_DRIVE, ISymbianSDK.TECHVIEW_SDK_NAME, osVersion, "", sdkVersion, false); + sdk = SymbianSDKFactory.createInstance(TV_SDKID, P_DRIVE, ISBSv1BuildInfo.TECHVIEW_SDK_NAME, osVersion, "", sdkVersion, false); DevicesLoader.updateDevice(sdk, devicesFile.toURI().toURL()); - sdk = SymbianSDKFactory.createInstance(UIQ3_SDKID, UIQ3_EPOCROOT, ISymbianSDK.UIQ_SDK_NAME, osVersion, "", sdkVersion, false); + sdk = SymbianSDKFactory.createInstance(UIQ3_SDKID, UIQ3_EPOCROOT, ISBSv1BuildInfo.UIQ_SDK_NAME, osVersion, "", sdkVersion, false); DevicesLoader.updateDevice(sdk, devicesFile.toURI().toURL()); } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SDKCreationTest.java --- a/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SDKCreationTest.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SDKCreationTest.java Mon Jun 07 20:50:55 2010 -0500 @@ -16,18 +16,20 @@ */ package com.nokia.carbide.cpp.sdk.core.test; +import java.io.File; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.emf.common.util.EList; + +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DeviceType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DevicesType; import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianSDK; import com.nokia.carbide.cpp.internal.sdk.core.xml.DevicesLoader; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.cpp.internal.api.utils.core.FileUtils; -import org.eclipse.emf.common.util.EList; - -import java.io.File; -import java.util.Iterator; -import java.util.List; - public class SDKCreationTest extends BaseDeviceModifierTest { protected void setUp() throws Exception { @@ -48,21 +50,25 @@ for (Iterator iter = devices.iterator(); iter.hasNext();) { SymbianSDK sdk = new SymbianSDK((DeviceType) iter.next()); assertNotNull(sdk); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); // Test an SDK that exists and we know OS version if (sdk.getUniqueId().equals("UIQ3")){ List platMacros = sdk.getPlatformMacros("WINSCW"); assertTrue(platMacros != null); assertEquals(3, platMacros.size()); - assertTrue(sdk.getFilteredBuildConfigurations().size() > 0); + if (sbsv1BuildInfo != null) { + assertTrue(sbsv1BuildInfo.getFilteredBuildConfigurations(sdk).size() > 0); + } } // Test an SDK that does not exist. Check for proper null values else if (sdk.getUniqueId().equals("SDK_No_Exist")){ + if (sbsv1BuildInfo != null) { + assertTrue(sbsv1BuildInfo.getSDKVersion(sdk).getMajor() == 0); + assertTrue(sbsv1BuildInfo.getAvailablePlatforms(sdk).size() == 0); + assertTrue(sbsv1BuildInfo.getFilteredBuildConfigurations(sdk).size() == 0); + } assertTrue(sdk.getOSVersion().getMajor() == 0); - assertTrue(sdk.getSDKVersion().getMajor() == 0); assertTrue(sdk.getPlatformMacros("WINSCW").size() == 0); - assertTrue(sdk.getProjectVariantHRHMacros().size() == 0); - assertTrue(sdk.getAvailablePlatforms().size() == 0); - assertTrue(sdk.getFilteredBuildConfigurations().size() == 0); assertTrue(sdk.getSupportedTargetTypes().size() == 0); File epocRoot = new File(sdk.getEPOCROOT()); assertTrue(epocRoot.exists() == false); diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SymbianContextTest.java --- a/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SymbianContextTest.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SymbianContextTest.java Mon Jun 07 20:50:55 2010 -0500 @@ -23,6 +23,8 @@ import org.osgi.framework.Version; import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; @@ -58,9 +60,10 @@ * @param sdk */ private void doTestSDK(ISymbianSDK sdk) { - if (sdk.getName().equals("S60_5th_Edition_SDK_v1.0")) { + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null && sbsv1BuildInfo.getName(sdk).equals("S60_5th_Edition_SDK_v1.0")) { // test that we get the SDK version - Version sdkVer = sdk.getSDKVersion(); + Version sdkVer = sbsv1BuildInfo.getSDKVersion(sdk); assertEquals(5,sdkVer.getMajor()); assertEquals(0,sdkVer.getMinor()); @@ -72,13 +75,14 @@ BuildContextSBSv1 context = new BuildContextSBSv1(sdk, "WINSCW", "UDEB"); ISymbianSDK contextSDK = context.getSDK(); + sbsv1BuildInfo = (ISBSv1BuildInfo)contextSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); assertEquals(sdk, contextSDK); // test that we can get the macros for valid SDKs // (if the default of 0.0, then we never fetch macros) - if (sdk.getOSVersion().compareTo(new Version(0, 0, 0)) > 0) { - List platMacros = contextSDK.getPlatformMacros("WINSCW"); + if (sbsv1BuildInfo != null && sdk.getOSVersion().compareTo(new Version(0, 0, 0)) > 0) { + List platMacros = sbsv1BuildInfo.getPlatformMacros(contextSDK, "WINSCW"); if (platMacros.size() == 0) fail("WINSCW platform macros should be > 0"); } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java Mon Jun 07 20:50:55 2010 -0500 @@ -13,14 +13,24 @@ package com.nokia.carbide.cpp.internal.api.sdk; import java.io.File; -import java.util.*; +import java.util.Collections; +import java.util.List; import org.eclipse.core.runtime.IPath; import org.osgi.framework.Version; -import com.nokia.carbide.cpp.epoc.engine.preprocessor.*; +import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine; +import com.nokia.carbide.cpp.internal.sdk.core.model.SBSv1BuildInfo; import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianMissingSDKFactory; -import com.nokia.carbide.cpp.sdk.core.*; +import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianSDK; +import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; +import com.nokia.carbide.cpp.sdk.core.IBSFPlatform; +import com.nokia.carbide.cpp.sdk.core.IRVCTToolChainInfo; +import com.nokia.carbide.cpp.sdk.core.ISBSv1BuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; +import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; public class BuildContextSBSv1 implements ISBSv1BuildContext { @@ -200,14 +210,23 @@ return getDisplayString(); } + private ISBSv1BuildInfo getBuildInfo() { + ISBSv1BuildInfo buildInfo = (ISBSv1BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (buildInfo == null) { + buildInfo = new SBSv1BuildInfo(); + ((SymbianSDK)getSDK()).setBuildInfo(buildInfo, ISymbianBuilderID.SBSV1_BUILDER); + } + return buildInfo; + } + public String getDefaultDefFileDirectoryName(boolean isASSP) { // TODO: How the ASSP option affects the path? String dirName = getDefFileDirectoryNameForPlatform(platform); if (dirName == null) { // check BSF's - IBSFCatalog catalog = getSDK().getBSFCatalog(); - if (catalog != null) { + IBSFCatalog catalog = getBuildInfo().getBSFCatalog(getSDK()); + if (catalog != null) { for (IBSFPlatform plat : catalog.getPlatforms()) { if (plat.getName().compareToIgnoreCase(platform) == 0) { String mainPlatform = catalog.getReleasePlatform(platform); @@ -254,7 +273,7 @@ return getRVCTPrefixFilePath(); } else { // check BSF's - IBSFCatalog catalog = getSDK().getBSFCatalog(); + IBSFCatalog catalog = getBuildInfo().getBSFCatalog(getSDK()); if (catalog != null) { for (IBSFPlatform plat : catalog.getPlatforms()) { if (plat.getName().compareToIgnoreCase(platform) == 0) { @@ -281,8 +300,12 @@ return null; } + private IPath getIncludePath() { + return getBuildInfo().getIncludePath(getSDK()); + } + private IPath getGCCEPrefixFilePath() { - return getSDK().getIncludePath().append("gcce/gcce.h"); //$NON-NLS-1$ + return getIncludePath().append("gcce/gcce.h"); //$NON-NLS-1$ } private IPath getRVCTPrefixFilePath() { @@ -292,13 +315,13 @@ if (installedRVCTTools.length > 0) { rvctFragment = getRVCTFragment(installedRVCTTools[0]); } - IPath prefixFilePath = getSDK().getIncludePath().append(rvctFragment).append(rvctFragment + ".h"); //$NON-NLS-1$ + IPath prefixFilePath = getIncludePath().append(rvctFragment).append(rvctFragment + ".h"); //$NON-NLS-1$ if (prefixFilePath.toFile().exists()){ return prefixFilePath; } else { // SF kits around SF^3 started to only use a single rvct.h header instead of specific versioned ones // based on the default installation - return getSDK().getIncludePath().append("rvct").append("rvct" + ".h"); + return getIncludePath().append("rvct").append("rvct" + ".h"); } } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Mon Jun 07 20:50:55 2010 -0500 @@ -8,11 +8,14 @@ import org.osgi.framework.Version; import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine; +import com.nokia.carbide.cpp.internal.sdk.core.model.SBSv2BuildInfo; +import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianSDK; import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; import com.nokia.carbide.cpp.sdk.core.IBSFPlatform; import com.nokia.carbide.cpp.sdk.core.IRVCTToolChainInfo; import com.nokia.carbide.cpp.sdk.core.ISBSv2BuildContext; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; @@ -93,6 +96,15 @@ return displayString; } + private ISBSv2BuildInfo getBuildInfo() { + ISBSv2BuildInfo buildInfo = (ISBSv2BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + if (buildInfo == null) { + buildInfo = new SBSv2BuildInfo(); + ((SymbianSDK)getSDK()).setBuildInfo(buildInfo, ISymbianBuilderID.SBSV2_BUILDER); + } + return buildInfo; + } + @Override public String toString() { return getConfigID(); @@ -106,7 +118,7 @@ String dirName = getDefFileDirectoryNameForPlatform(platform); if (dirName == null) { // check BSF's - IBSFCatalog catalog = getSDK().getBSFCatalog(); + IBSFCatalog catalog = getBuildInfo().getBSFCatalog(getSDK()); if (catalog != null) { for (IBSFPlatform plat : catalog.getPlatforms()) { if (plat.getName().compareToIgnoreCase(platform) == 0) { @@ -157,7 +169,7 @@ return getRVCTPrefixFilePath(); } else { // check BSF's - IBSFCatalog catalog = getSDK().getBSFCatalog(); + IBSFCatalog catalog = getBuildInfo().getBSFCatalog(getSDK()); if (catalog != null) { for (IBSFPlatform plat : catalog.getPlatforms()) { if (plat.getName().compareToIgnoreCase(platform) == 0) { @@ -184,9 +196,13 @@ return null; } + private IPath getIncludePath() { + return getBuildInfo().getIncludePath(getSDK()); + } + private IPath getGCCEPrefixFilePath() { // TOOD: Should get from Raptor query when available - return getSDK().getIncludePath().append("gcce/gcce.h"); //$NON-NLS-1$ + return getIncludePath().append("gcce/gcce.h"); //$NON-NLS-1$ } private IPath getRVCTPrefixFilePath() { @@ -197,13 +213,13 @@ if (installedRVCTTools.length > 0) { rvctFragment = getRVCTFragment(installedRVCTTools[0]); } - IPath prefixFilePath = getSDK().getIncludePath().append(rvctFragment).append(rvctFragment + ".h"); //$NON-NLS-1$ + IPath prefixFilePath = getIncludePath().append(rvctFragment).append(rvctFragment + ".h"); //$NON-NLS-1$ if (prefixFilePath.toFile().exists()){ return prefixFilePath; } else { // SF kits around SF^3 started to only use a single rvct.h header instead of specific versioned ones // based on the default installation - return getSDK().getIncludePath().append("rvct").append("rvct" + ".h"); + return getIncludePath().append("rvct").append("rvct" + ".h"); } } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildInfo.java Mon Jun 07 20:50:55 2010 -0500 @@ -0,0 +1,246 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +*/ + +package com.nokia.carbide.cpp.internal.api.sdk; + +import java.io.File; +import java.net.URL; +import java.util.Date; +import java.util.List; + +import org.eclipse.core.runtime.IPath; +import org.osgi.framework.Version; + +import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; +import com.nokia.carbide.cpp.sdk.core.ISBVCatalog; +import com.nokia.carbide.cpp.sdk.core.ISDKBuildInfo; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; + +/** + * Interface for SBSv1 specific build information. + * + */ +public interface ISBSv1BuildInfo extends ISDKBuildInfo { + + /** Branch identifier to note Beech branch, OS 8.1a and prior */ + public static final String EKA1_A_BRANCH_IDENTIFIER = "a"; + /** Branch identifier to note S branch, OS 7.0x */ + public static final String EKA1_S_BRANCH_IDENTIFIER = "s"; + /** Branch identifier to note Cedar branch, OS 8.0b and later (not used for OS 9.x and greater) */ + public static final String EKA2_B_BRANCH_IDENTIFIER = "b"; + + // Family Ids don't include the vendor + public static final String SERIES60_FAMILY_ID = "series60"; //deprecated + public static final String S60_FAMILY_ID = "s60"; + public static final String S80_FAMILY_ID = "Series80"; + public static final String UIQ_FAMILY_ID = "UIQ"; + public static final String TECHVIEW_FAMILY_ID = "TechView"; + public static final String SYMBIAN_FOUNDATION_FAMILY_ID = "symbian"; // Symbian Foundation, starting with Symbian^3 + + // Unique Ids include the vendor + public static final String SERIES60_SDK_NAME = "com.nokia." + SERIES60_FAMILY_ID; + public static final String S60_SDK_NAME = "com.nokia." + S60_FAMILY_ID; + public static final String NOKIA_SF_SDK_NAME = "com.nokia." + SYMBIAN_FOUNDATION_FAMILY_ID; // Nokia+Symbian Foundation SDK + public static final String S80_SDK_NAME = "com.nokia." + S80_FAMILY_ID; + public static final String UIQ_SDK_NAME = "com.symbian." + UIQ_FAMILY_ID; + public static final String TECHVIEW_SDK_NAME = "com.symbian." + TECHVIEW_FAMILY_ID; + + public static final String PUBLISHER_NOKIA = "Nokia, Inc."; + public static final String PUBLISHER_UIQ = "UIQ Technology"; + public static final String PUBLISHER_SYMBIAN = "Symbian, Ltd."; + + /** + * Returns the list of all platform macros for a SDK. + *

+ * This is somewhat equivalent to calling "bldmake plat" on the command line + * These are the macros that can be used in MMP and INF files. They are only given by name (no value) + *

+ * @param sdk Symbian SDK + * @param platform the platform name + * @return a list of macros, which may be empty. + */ + List getPlatformMacros(ISymbianSDK sdk, String platform); + + /** + * Get a list of macros that are used to distinguish a SDK. Typically only + * S603rd edition SDKs contain this information and it's used to differentiate between + * varios S60 SDK releases. Other vendors, such as UIQ may put their macros in the variant HRH file. + * @param sdk Symbian SDK + * @return A list of macros just returned by name. + */ + public List getVendorSDKMacros(ISymbianSDK sdk); + + /** + * Returns the list of all available platforms for a SDK. + * @param sdk Symbian SDK + * @return a list of platform names which may be empty. + */ + List getAvailablePlatforms(ISymbianSDK sdk); + + /** + * Returns the display name of a SDK. This is the com.vendor.family identifier. + * @param sdk Symbian SDK + * @return the name of a sdk. + */ + String getName(ISymbianSDK sdk); + + /** + * Returns the vendor name of this SDK. This is parsed from the 'name' attribute from devices.xml. + * @param sdk Symbian SDK + * @return the vendor name of a sdk. + */ + String getVendor(ISymbianSDK sdk); + + /** + * Returns the family name of a SDK. This is parsed from the 'vendor' attribute from devices.xml. + * @param sdk Symbian SDK + * @return the family name of a sdk. + */ + String getFamily(ISymbianSDK sdk); + + /** + * Returns the SDK version string of a SDK. + * @param sdk Symbian SDK + * @return the SDK Version object. If the version cannot be determined it will be "0.0". + */ + Version getSDKVersion(ISymbianSDK sdk); + + /** + * Returns the File object for the prefix file for a SDK. + * @param sdk Symbian SDK + * @return the File object for the prefix file, or + * null if there isn't one for the SDK. + */ + File getPrefixFile(ISymbianSDK sdk); + + /** + * Returns an IPath for the epoc32\tools directory of a SDK. + * @param sdk Symbian SDK + * @return an IPath for the epoc32\tools directory, or null. + */ + IPath getToolsPath(ISymbianSDK sdk); + + /** + * Returns an IPath for the epoc32\release directory of a SDK. + * @param sdk Symbian SDK + * @return an IPath for the epoc32\release directory, or null. + */ + IPath getReleaseRoot(ISymbianSDK sdk); + + /** + * Returns an IPath for the epoc32\include directory of a SDK. + * @param sdk Symbian SDK + * @return an IPath for the epoc32\include directory, or null. + */ + IPath getIncludePath(ISymbianSDK sdk); + + /** + * Get the human readable description of a SDK. + * @param sdk Symbian SDK + * @return The description string, empty string for none. + */ + String getSDKDescription(ISymbianSDK sdk); + + /** + * Get the creation date of the manifest.xml + * @param sdk Symbian SDK + * @return a Date object + */ + Date getCreationDate(ISymbianSDK sdk); + + /** + * Get the licese file location in a SDK. Comes from manifest.xml. + * @param sdk Symbian SDK + * @return File, full path to the license file. + */ + File getLicenseFile(ISymbianSDK sdk); + + /** + * Get the branch qualifier for the OS. Typically "a" or "b" to denote the Beech and Cedar code branchs respectively. + * This is typically used to denote EKA1 from EKA2. + * @param sdk Symbian SDK + * @return the branch, or empty string if none. + */ + String getSDKOSBranch(ISymbianSDK sdk); + + /** + * Get the HTTP location for the SDK publisher. Comes from manifest.xml. + * @param sdk Symbian SDK + * @return A (hopefully) valid URL. + */ + URL getPublisherURL(ISymbianSDK sdk); + + /** + * Get the publisher name present in manifest.xml + * @param sdk Symbian SDK + * @return The name entry or empty string if not present. + */ + String getPublisherName(ISymbianSDK sdk); + + /** + * Get a list of macros specific to the given target type, e.g. "__EXE__" or "__DLL__" + * @param sdk Symbian SDK + * @param targettype + * @return list of macro strings, may be empty + */ + List getTargetTypeMacros(ISymbianSDK sdk, String targettype); + + /** + * Get the BSF catalog for a SDK. + * @param sdk Symbian SDK + */ + IBSFCatalog getBSFCatalog(ISymbianSDK sdk); + + /** + * Get the Symbian Binary Variation (SBV) catalog for a SDK. + * @param sdk Symbian SDK + * @since 2.0 + */ + ISBVCatalog getSBVCatalog(ISymbianSDK sdk); + + /** + * Returns whether or not this is the default SDK in the devices.xml file. + * @param sdk Symbian SDK + * @return true if the SDK is the default, and + * false otherwise + */ + boolean isDefaultSDK(ISymbianSDK sdk); + + /** + * Tell if the SDK is Series60. + * @param sdk Symbian SDK + * @return true if the SDK is Series60 + */ + boolean isS60(ISymbianSDK sdk); + + /** + * Tells whether or not the plug-in installer has sniffed this SDK for eclipse plug-ins to install. + * @param sdk Symbian SDK + * @return true if the SDK was scanned + * @since 2.0 + */ + boolean isPreviouslyScanned(ISymbianSDK sdk); + + void setLicenseFile(ISymbianSDK sdk, File licenseFile); + void setPrefixFile(ISymbianSDK sdk, IPath prefixFile); + void setSDKVersion(ISymbianSDK sdk, Version sdkVers); + void setPublisherURL(ISymbianSDK sdk, URL pubURL); + void setCreateDate(ISymbianSDK sdk, Date createDate); + void setOSSDKBranch(ISymbianSDK sdk, String branch); + void setSDKDescription(ISymbianSDK sdk, String descr); + void setPublisherName(ISymbianSDK sdk, String pubName); + void setName(ISymbianSDK sdk, String name); + void setIsDefaultSDK(ISymbianSDK sdk, boolean isDefault); + void setPreviouslyScanned(ISymbianSDK sdk, boolean wasScanned); + +} diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv2BuildInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv2BuildInfo.java Mon Jun 07 20:50:55 2010 -0500 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +*/ + +package com.nokia.carbide.cpp.internal.api.sdk; + +import java.io.File; +import java.util.List; + +import org.eclipse.core.runtime.IPath; + +import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; +import com.nokia.carbide.cpp.sdk.core.ISBVCatalog; +import com.nokia.carbide.cpp.sdk.core.ISDKBuildInfo; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; + +/** + * Interface for SBSv2 specific build information. + * + */ +public interface ISBSv2BuildInfo extends ISDKBuildInfo { + + /** + * Returns the list of all platform macros for a SDK. + *

+ * This is somewhat equivalent to calling "bldmake plat" on the command line + * These are the macros that can be used in MMP and INF files. They are only given by name (no value) + *

+ * @param sdk Symbian SDK + * @param platform the platform name + * @return a list of macros, which may be empty. + */ + List getPlatformMacros(ISymbianSDK sdk, String platform); + + /** + * Get a list of macros specific to the given target type, e.g. "__EXE__" or "__DLL__" + * @param sdk Symbian SDK + * @param targettype + * @return list of macro strings, may be empty + */ + List getTargetTypeMacros(ISymbianSDK sdk, String targettype); + + /** + * Returns the list of all available platforms for a SDK. + * @param sdk Symbian SDK + * @return a list of platform names which may be empty. + */ + List getAvailablePlatforms(ISymbianSDK sdk); + + /** + * Returns an IPath for the epoc32\include directory of a SDK. + * @param sdk Symbian SDK + * @return an IPath for the epoc32\include directory, or null. + */ + IPath getIncludePath(ISymbianSDK sdk); + + /** + * Returns the File object for the prefix file for a SDK. + * @param sdk Symbian SDK + * @return the File object for the prefix file, or + * null if there isn't one for the SDK. + */ + File getPrefixFile(ISymbianSDK sdk); + + /** + * Get the BSF catalog for a SDK. + * @param sdk Symbian SDK + */ + IBSFCatalog getBSFCatalog(ISymbianSDK sdk); + + /** + * Get the Symbian Binary Variation (SBV) catalog for a SDK. + * @param sdk Symbian SDK + * @since 2.0 + */ + ISBVCatalog getSBVCatalog(ISymbianSDK sdk); + + /** + * Tells whether or not the plug-in installer has sniffed this SDK for eclipse plug-ins to install. + * @param sdk Symbian SDK + * @return true if the SDK was scanned. + * @since 2.0 + */ + boolean isPreviouslyScanned(ISymbianSDK sdk); + + void setPreviouslyScanned(ISymbianSDK sdk, boolean wasScanned); + void setPrefixFile(ISymbianSDK sdk, IPath prefixFile); + +} diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISymbianSDKModifier.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISymbianSDKModifier.java Mon Jun 07 20:50:55 2010 -0500 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +*/ + +package com.nokia.carbide.cpp.internal.api.sdk; + +import org.osgi.framework.Version; + +import com.nokia.carbide.cpp.sdk.core.ISDKBuildInfo; + +/** + * Interface for modifying various attributes of Symbian OS SDK. + * + */ +public interface ISymbianSDKModifier { + + /** + * Sets the build info for a particular builder. + * @param buildInfo build info + * @param builderId id string of a builder + */ + void setBuildInfo(ISDKBuildInfo buildInfo, String builderId); + + /** + * Add a feature supported by the SDK. + * @param feature supported feature + */ + void addSupportedFeature(Object feature); + + /** + * Marks the SDK as enabled or disabled. + * @param enable whether to enable or disable the SDK + */ + void setEnabled(boolean enable); + + /** + * Sets the unique id of a SDK. + * @param id id string of a SDK + */ + void setUniqueId(String id); + + /** + * Sets the OS version string of a SDK. + * @param osVer OS version object + */ + public void setOSVersion(Version osVer); + +} diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Mon Jun 07 20:50:55 2010 -0500 @@ -102,6 +102,8 @@ private ExternalFileInfoCollection compilerPrefixFileInfo = null; private List systemIncludes; private ISymbianSDK sdk; + ISBSv1BuildInfo sbsv1BuildInfo; + ISBSv2BuildInfo sbsv2BuildInfo; private IPath compilerPrefixFile; private String platformString; @@ -119,6 +121,8 @@ this.platformString = context.getPlatformString(); this.displayString = context.getDisplayString(); this.sdk = context.getSDK(); + sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); this.contextKey = getBuildContextKey(context); } @@ -166,7 +170,12 @@ List macros = new ArrayList(); Map namedMacros = new HashMap(); - File prefixFile = sdk.getPrefixFile(); + File prefixFile = null; + if (sbsv1BuildInfo != null) { + prefixFile = sbsv1BuildInfo.getPrefixFile(sdk); + } else if (sbsv2BuildInfo != null) { + prefixFile = sbsv2BuildInfo.getPrefixFile(sdk); + } if (prefixFile == null){ // Check that the prefix file may have become available since the SDK was scanned last. @@ -174,7 +183,11 @@ IPath prefixCheck = ((SymbianSDK)sdk).getPrefixFromVariantCfg(); if (prefixCheck != null){ prefixFile = prefixCheck.toFile(); - sdk.setPrefixFile(prefixCheck); + if (sbsv1BuildInfo != null) { + sbsv1BuildInfo.setPrefixFile(sdk, prefixCheck); + } else if (sbsv2BuildInfo != null) { + sbsv2BuildInfo.setPrefixFile(sdk, prefixCheck); + } } } @@ -187,8 +200,15 @@ systemPaths.add(new File(sdk.getEPOCROOT() + "epoc32/include")); // add any BSF/SBV includes so the headers are picked up from the correct location - IBSFPlatform bsfPlat = sdk.getBSFCatalog().findPlatform(platformString); - ISBVPlatform sbvPlat = sdk.getSBVCatalog().findPlatform(platformString); + IBSFPlatform bsfPlat = null; + ISBVPlatform sbvPlat = null; + if (sbsv1BuildInfo != null) { + bsfPlat = sbsv1BuildInfo.getBSFCatalog(sdk).findPlatform(platformString); + sbvPlat = sbsv1BuildInfo.getSBVCatalog(sdk).findPlatform(platformString); + } else if (sbsv2BuildInfo != null) { + bsfPlat = sbsv2BuildInfo.getBSFCatalog(sdk).findPlatform(platformString); + sbvPlat = sbsv2BuildInfo.getSBVCatalog(sdk).findPlatform(platformString); + } if (bsfPlat != null) { for (IPath path : bsfPlat.getSystemIncludePaths()) { systemPaths.add(path.toFile()); @@ -293,7 +313,12 @@ userPaths.add(prefixFile.removeLastSegments(1).toFile()); systemPaths.add(prefixFile.removeLastSegments(1).toFile()); - IPath includePath = sdk.getIncludePath(); + IPath includePath = null; + if (sbsv1BuildInfo != null) { + includePath = sbsv1BuildInfo.getIncludePath(sdk); + } else if (sbsv2BuildInfo != null) { + includePath = sbsv2BuildInfo.getIncludePath(sdk); + } if (includePath != null) { File includeDir = includePath.toFile().getAbsoluteFile(); userPaths.add(includeDir); @@ -354,11 +379,23 @@ if (DEBUG) System.out.println("Scanning include paths for " + displayString); - IBSFPlatform bsfplatform = sdk.getBSFCatalog().findPlatform(platformString); - ISBVPlatform sbvPlatform = sdk.getSBVCatalog().findPlatform(platformString); + IBSFPlatform bsfplatform = null; + ISBVPlatform sbvPlatform = null; + if (sbsv1BuildInfo != null) { + bsfplatform = sbsv1BuildInfo.getBSFCatalog(sdk).findPlatform(platformString); + sbvPlatform = sbsv1BuildInfo.getSBVCatalog(sdk).findPlatform(platformString); + } else if (sbsv2BuildInfo != null) { + bsfplatform = sbsv2BuildInfo.getBSFCatalog(sdk).findPlatform(platformString); + sbvPlatform = sbsv2BuildInfo.getSBVCatalog(sdk).findPlatform(platformString); + } // look in the epoc32 directory of the SDK - IPath includePath = sdk.getIncludePath(); + IPath includePath = null; + if (sbsv1BuildInfo != null) { + includePath = sbsv1BuildInfo.getIncludePath(sdk); + } else if (sbsv2BuildInfo != null) { + includePath = sbsv2BuildInfo.getIncludePath(sdk); + } if (includePath != null) { File includeDir = includePath.toFile().getAbsoluteFile(); File dir; @@ -419,7 +456,12 @@ } // also search files in same folder as variant.hrh - File prefix = sdk.getPrefixFile(); + File prefix = null; + if (sbsv1BuildInfo != null) { + prefix = sbsv1BuildInfo.getPrefixFile(sdk); + } else if (sbsv2BuildInfo != null) { + prefix = sbsv2BuildInfo.getPrefixFile(sdk); + } if (sbvPlatform != null){ // might be an alternate HRH file to use IPath varVarHRH = sbvPlatform.getBuildVariantHRHFile(); diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Mon Jun 07 20:50:55 2010 -0500 @@ -54,6 +54,8 @@ import com.nokia.carbide.cpp.internal.api.sdk.BuildPlat; import com.nokia.carbide.cpp.internal.api.sdk.ICarbideDevicesXMLChangeListener; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; import com.nokia.carbide.cpp.internal.api.sdk.ISDKManagerInternal; import com.nokia.carbide.cpp.internal.api.sdk.ISDKManagerLoadedHook; import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils; @@ -64,6 +66,7 @@ import com.nokia.carbide.cpp.sdk.core.ICarbideInstalledSDKChangeListener.SDKChangeEventType; import com.nokia.carbide.cpp.sdk.core.IRVCTToolChainInfo; import com.nokia.carbide.cpp.sdk.core.ISDKManager; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; import com.nokia.cpp.internal.api.utils.core.FileUtils; @@ -371,32 +374,16 @@ ISymbianSDK sdk = getSDK(id, false); if (sdk != null){ - - if (wasScanned.equalsIgnoreCase("true")){ - sdk.setPreviouslyScanned(true); + + if (sdkEnabled.equalsIgnoreCase("true")){ + ((SymbianSDK)sdk).setEnabled(true); } else { - sdk.setPreviouslyScanned(false); - } - - if (sdkEnabled.equalsIgnoreCase("true")){ - sdk.setEnabled(true); - } else { - sdk.setEnabled(false); + ((SymbianSDK)sdk).setEnabled(false); } if (!osVersion.equals("")){ if (Version.parseVersion(osVersion).getMajor() != 0){ - sdk.setOSVersion(Version.parseVersion(osVersion)); - } - } - - if (!osBranch.equals("")){ - sdk.setOSSDKBranch(osBranch); - } - - if (!sdkVersion.equals("")){ - if (Version.parseVersion(sdkVersion).getMajor() != 0){ - sdk.setSDKVersion(Version.parseVersion(sdkVersion)); + ((SymbianSDK)sdk).setOSVersion(Version.parseVersion(osVersion)); } } @@ -404,6 +391,33 @@ sdk.setEPOCROOT(customEpocroot); } + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + if (wasScanned.equalsIgnoreCase("true")){ + sbsv1BuildInfo.setPreviouslyScanned(sdk, true); + } else { + sbsv1BuildInfo.setPreviouslyScanned(sdk, false); + } + + if (!osBranch.equals("")){ + sbsv1BuildInfo.setOSSDKBranch(sdk, osBranch); + } + + if (!sdkVersion.equals("")){ + if (Version.parseVersion(sdkVersion).getMajor() != 0){ + sbsv1BuildInfo.setSDKVersion(sdk, Version.parseVersion(sdkVersion)); + } + } + } + + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + if (sbsv2BuildInfo != null) { + if (wasScanned.equalsIgnoreCase("true")){ + sbsv2BuildInfo.setPreviouslyScanned(sdk, true); + } else { + sbsv2BuildInfo.setPreviouslyScanned(sdk, false); + } + } } } // for @@ -446,7 +460,7 @@ Node idNode = d.createAttribute(SDK_CACHE_ID_ATTRIB); idNode.setNodeValue(currSDK.getUniqueId()); attribs.setNamedItem(idNode); - + // Hide the build config from view in the build config list? Node enabledNode = d.createAttribute(SDK_CACHE_ENABLED_ATTRIB); if (true == currSDK.isEnabled()) { @@ -456,31 +470,34 @@ } attribs.setNamedItem(enabledNode); - Node wasScannedNode = d.createAttribute(SDK_SCANNED_FOR_PLUGINS); - if (true == currSDK.isPreviouslyScanned()) { - wasScannedNode.setNodeValue("true"); - } else { - wasScannedNode.setNodeValue("false"); - } - attribs.setNamedItem(wasScannedNode); - Node osVerNode = d.createAttribute(SDK_CACHE_OS_VERSION_ATTRIB); osVerNode.setNodeValue(currSDK.getOSVersion().toString()); attribs.setNamedItem(osVerNode); - Node osBranchNode = d.createAttribute(SDK_CACHE_OS_BRANCH_ATTRIB); - osBranchNode.setNodeValue(currSDK.getSDKOSBranch()); - attribs.setNamedItem(osBranchNode); - - Node sdkVerNode = d.createAttribute(SDK_CACHE_SDK_VERSION_ATTRIB); - sdkVerNode.setNodeValue(currSDK.getSDKVersion().toString()); - attribs.setNamedItem(sdkVerNode); - if (!isEPOCRootFixed()) { Node sdkEpocRootNode = d.createAttribute(SDK_CACHE_EPOCROOT_ATTRIB); sdkEpocRootNode.setNodeValue(currSDK.getEPOCROOT()); attribs.setNamedItem(sdkEpocRootNode); } + + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + Node wasScannedNode = d.createAttribute(SDK_SCANNED_FOR_PLUGINS); + if (true == sbsv1BuildInfo.isPreviouslyScanned(currSDK)) { + wasScannedNode.setNodeValue("true"); + } else { + wasScannedNode.setNodeValue("false"); + } + attribs.setNamedItem(wasScannedNode); + + Node osBranchNode = d.createAttribute(SDK_CACHE_OS_BRANCH_ATTRIB); + osBranchNode.setNodeValue(sbsv1BuildInfo.getSDKOSBranch(currSDK)); + attribs.setNamedItem(osBranchNode); + + Node sdkVerNode = d.createAttribute(SDK_CACHE_SDK_VERSION_ATTRIB); + sdkVerNode.setNodeValue(sbsv1BuildInfo.getSDKVersion(currSDK).toString()); + attribs.setNamedItem(sdkVerNode); + } } } DOMSource domSource = new DOMSource(d); diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/BSFCatalogFactory.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/BSFCatalogFactory.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/BSFCatalogFactory.java Mon Jun 07 20:50:55 2010 -0500 @@ -12,7 +12,12 @@ */ package com.nokia.carbide.cpp.internal.sdk.core.model; +import java.io.File; + +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import org.eclipse.core.runtime.IPath; @@ -31,7 +36,17 @@ * @return a catalog, never null */ public static IBSFCatalog createCatalog(ISymbianSDK sdk) { - BSFCatalog catalog = new BSFCatalog(new Path(sdk.getEPOCROOT()), sdk.getIncludePath()); + IPath sdkIncludePath; + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + if (sbsv1BuildInfo != null) { + sdkIncludePath = sbsv1BuildInfo.getIncludePath(sdk); + } else if (sbsv2BuildInfo != null) { + sdkIncludePath = sbsv2BuildInfo.getIncludePath(sdk); + } else { + sdkIncludePath = new Path(sdk.getEPOCROOT()).append("include"); + } + BSFCatalog catalog = new BSFCatalog(new Path(sdk.getEPOCROOT()), sdkIncludePath); return catalog; } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv1BuildInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv1BuildInfo.java Mon Jun 07 20:50:55 2010 -0500 @@ -0,0 +1,451 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +*/ + +package com.nokia.carbide.cpp.internal.sdk.core.model; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.osgi.framework.Version; + +import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1; +import com.nokia.carbide.cpp.internal.api.sdk.BuildPlat; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils; +import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DefaultType; +import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DeviceType; +import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; +import com.nokia.carbide.cpp.sdk.core.IBSFPlatform; +import com.nokia.carbide.cpp.sdk.core.ISBVCatalog; +import com.nokia.carbide.cpp.sdk.core.ISBVPlatform; +import com.nokia.carbide.cpp.sdk.core.ISDKManager; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures; +import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; + +/** + * SBSv1 specific build information. + * + */ +public class SBSv1BuildInfo implements ISBSv1BuildInfo { + + private Date createDate; + private File licenseFile; + private File prefixFile; + private Version sdkVersion; + private String sdkOSBranch; + private String sdkDescription; + private String publisherName; + private URL publisherURL; + private IBSFCatalog bsfCatalog; + private ISBVCatalog sbvCatalog; + private List binaryVariantContextList = new ArrayList(0); + private List bsfContextList = new ArrayList(0); + + public List getFilteredBuildConfigurations(ISymbianSDK sdk) { + // This is probably a bug, but the filtering only uses SBSv1 preferences if SBSv1 is enabled... + List filteredContexts; + if (SBSv2Utils.enableSBSv1Support()) { + filteredContexts = getSBSv1FilteredBuildConfigurations(sdk); + } else { + // be optimistic in this case... SBSv3? ;) + filteredContexts = getAllBuildConfigurations(sdk); + } + return filteredContexts; + } + + @SuppressWarnings("rawtypes") + public List getAllBuildConfigurations(ISymbianSDK sdk) { + Set sdkFeatures = sdk.getSupportedFeatures(); + List buildTargets = new ArrayList(); + + // note that this gets variant platforms but not regular BSF's + List buildPlats = getAvailablePlatforms(sdk); + + if (buildPlats.size() == 0){ + return Collections.emptyList(); + } + // TODO: Hard code build context hack + buildTargets.add(new BuildContextSBSv1(sdk, ISymbianBuildContext.EMULATOR_PLATFORM, ISymbianBuildContext.DEBUG_TARGET)); + + if (sdkFeatures.contains(ISymbianSDKFeatures.IS_WINSCW_UREL_SUPPORTED)){ + // TODO: Hard code build context hack + buildTargets.add(new BuildContextSBSv1(sdk, ISymbianBuildContext.EMULATOR_PLATFORM, ISymbianBuildContext.RELEASE_TARGET)); + } + + for (String currPlat : buildPlats){ + if (currPlat.equals(ISymbianBuildContext.EMULATOR_PLATFORM) ) { + // emulation targets already determined (some SDKs don't get WISNCW UREL + continue; + } + // TODO: Hard code build context hack + buildTargets.add(new BuildContextSBSv1(sdk, currPlat, ISymbianBuildContext.DEBUG_TARGET)); + + // everything gets release except for WINSCW + // TODO: Hard code build context hack + buildTargets.add(new BuildContextSBSv1(sdk, currPlat, ISymbianBuildContext.RELEASE_TARGET)); + } + + ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); + if (sdkMgr.getBSFScannerEnabled()){ + buildTargets.addAll(getBSFPlatformContexts(sdk)); + buildTargets.addAll(getBinaryVariationPlatformContexts(sdk)); // Symbian Binary Variation (.var) + } + + return buildTargets; + } + + public List getPlatformMacros(ISymbianSDK sdk, String platform) { + if (sdk instanceof SymbianSDK) { + return ((SymbianSDK)sdk).getPlatformMacros(platform); + } + return null; + } + + public List getVendorSDKMacros(ISymbianSDK sdk) { + ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); + return sdkMgr.getSymbianMacroStore().getVendorMacros(getSDKVersion(sdk), getName(sdk)); + } + + public List getAvailablePlatforms(ISymbianSDK sdk) { + ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); + return sdkMgr.getSymbianMacroStore().getSupportedPlatforms(((SymbianSDK)sdk).getOSVersion(), getSDKOSBranch(sdk), getBSFCatalog(sdk)); + } + + public String getName(ISymbianSDK sdk) { + if (sdk instanceof SymbianSDK) { + DeviceType deviceEntry = ((SymbianSDK)sdk).getDeviceEntry(); + if (deviceEntry != null) { + return deviceEntry.getName(); + } + } + return ""; + } + + public String getVendor(ISymbianSDK sdk) { + String[] parts = getName(sdk).split("\\."); + if (parts.length == 3) + return parts[1]; + + return ""; + } + + public String getFamily(ISymbianSDK sdk) { + String[] parts = getName(sdk).split("\\."); + if (parts.length == 3){ + if (getSDKVersion(sdk).getMajor() == 5 && getName(sdk).equalsIgnoreCase(NOKIA_SF_SDK_NAME)){ + // A vendor of "symbian" and SDK major version 5 is the same as prior naming for "com.nokia.s60" & 5th Edition. + // Return "s60" so that project template generation continues to work as it's a S60 5th ed. SDK. + return ISBSv1BuildInfo.S60_FAMILY_ID; + } else { + return parts[2]; + } + } + + return ""; + } + + public Version getSDKVersion(ISymbianSDK sdk) { + if (sdkVersion == null){ + return new Version("0.0"); + } + return sdkVersion; + } + + public File getPrefixFile(ISymbianSDK sdk) { + return prefixFile; + } + + public IPath getToolsPath(ISymbianSDK sdk) { + String epocRoot = sdk.getEPOCROOT(); + if (epocRoot.length() > 0) { + IPath epoc32ToolsPath = new Path(epocRoot).append("epoc32/tools"); + // try to canonicalize it so it matches actual file system case + try { + epoc32ToolsPath = new Path(epoc32ToolsPath.toFile().getCanonicalPath()); + } catch (IOException e) { + } + return epoc32ToolsPath; + } + return null; + } + + public IPath getReleaseRoot(ISymbianSDK sdk) { + String epocRoot = sdk.getEPOCROOT(); + if (epocRoot.length() > 0) { + IPath epoc32RelPath = new Path(epocRoot).append("epoc32/release"); + // try to canonicalize it so it matches actual file system case + try { + epoc32RelPath = new Path(epoc32RelPath.toFile().getCanonicalPath()); + } catch (IOException e) { + } + return epoc32RelPath; + } + return null; + } + + public IPath getIncludePath(ISymbianSDK sdk) { + String epocRoot = sdk.getEPOCROOT(); + if (epocRoot.length() > 0) { + IPath epoc32IncPath = new Path(epocRoot).append("epoc32/include"); + // try to canonicalize it so it matches actual file system case + try { + epoc32IncPath = new Path(epoc32IncPath.toFile().getCanonicalPath()); + } catch (IOException e) { + } + return epoc32IncPath; + } + return null; + } + + public String getSDKDescription(ISymbianSDK sdk) { + if (sdkDescription == null){ + return ""; + } + return sdkDescription; + } + + public Date getCreationDate(ISymbianSDK sdk) { + return createDate; + } + + public File getLicenseFile(ISymbianSDK sdk) { + return licenseFile; + } + + public String getSDKOSBranch(ISymbianSDK sdk) { + if (sdkOSBranch == null){ + return ""; + } + return sdkOSBranch; + } + + public URL getPublisherURL(ISymbianSDK sdk) { + return publisherURL; + } + + public String getPublisherName(ISymbianSDK sdk) { + return publisherName; + } + + public List getTargetTypeMacros(ISymbianSDK sdk, String targettype) { + // this is based on \epoc32\tools\trgtype.pm which changes from + // OS version to OS version, but largely remains constant with + // regards to the basic type. + List macros = new ArrayList(); + + // if it's not one of these then it's a DLL + if (targettype.compareToIgnoreCase("EPOCEXE") == 0) { + macros.add("__EXEDLL__"); + } else if (targettype.compareToIgnoreCase("EXEDLL") == 0) { + macros.add("__EXEDLL__"); + } else if (targettype.compareToIgnoreCase("EXE") == 0) { + macros.add("__EXE__"); + } else if (targettype.compareToIgnoreCase("EXEXP") == 0) { + macros.add("__EXE__"); + } else if (targettype.compareToIgnoreCase("IMPLIB") == 0) { + macros.add("__IMPLIB__"); + } else if (targettype.compareToIgnoreCase("KLIB") == 0) { + macros.add("__LIB__"); + } else if (targettype.compareToIgnoreCase("LIB") == 0) { + macros.add("__LIB__"); + } else { + macros.add("__DLL__"); + } + return macros; + } + + public IBSFCatalog getBSFCatalog(ISymbianSDK sdk) { + synchronized (sdk) { + if (bsfCatalog == null) { + bsfCatalog = BSFCatalogFactory.createCatalog(sdk); + } + } + return bsfCatalog; + } + + public ISBVCatalog getSBVCatalog(ISymbianSDK sdk) { + synchronized (sdk) { + if (sbvCatalog == null) { + sbvCatalog = SBVCatalogFactory.createCatalog(sdk); + } + } + return sbvCatalog; + } + + public boolean isDefaultSDK(ISymbianSDK sdk) { + if (sdk instanceof SymbianSDK) { + DeviceType deviceEntry = ((SymbianSDK)sdk).getDeviceEntry(); + if (deviceEntry == null) { + return false; + } + if (deviceEntry.getDefault().equals(DefaultType.YES_LITERAL)){ + return true; + } + } + return false; + } + + public boolean isS60(ISymbianSDK sdk) { + return getFamily(sdk).equals(ISBSv1BuildInfo.S60_FAMILY_ID) + || getFamily(sdk).equals(ISBSv1BuildInfo.SERIES60_FAMILY_ID); + } + + public boolean isPreviouslyScanned(ISymbianSDK sdk) { + if (sdk instanceof SymbianSDK) { + return ((SymbianSDK)sdk).isPreviouslyScanned(); + } + return true; + } + + public void setLicenseFile(ISymbianSDK sdk, File licenseFile) { + this.licenseFile = licenseFile; + } + + public void setPrefixFile(ISymbianSDK sdk, IPath prefixFile) { + this.prefixFile = new File(prefixFile.toOSString()); + } + + public void setSDKVersion(ISymbianSDK sdk, Version sdkVers) { + sdkVersion = sdkVers; + } + + public void setPublisherURL(ISymbianSDK sdk, URL pubURL) { + publisherURL = pubURL; + } + + public void setCreateDate(ISymbianSDK sdk, Date createDate) { + this.createDate = createDate; + } + + public void setOSSDKBranch(ISymbianSDK sdk, String branch) { + sdkOSBranch = branch; + } + + public void setSDKDescription(ISymbianSDK sdk, String descr) { + sdkDescription = descr; + } + + public void setPublisherName(ISymbianSDK sdk, String pubName) { + publisherName = pubName; + } + + public void setName(ISymbianSDK sdk, String name) { + if (sdk instanceof SymbianSDK) { + DeviceType deviceEntry = ((SymbianSDK)sdk).getDeviceEntry(); + if (deviceEntry != null) { + deviceEntry.setName(name); + } + } + } + + public void setIsDefaultSDK(ISymbianSDK sdk, boolean isDefault) { + if (sdk instanceof SymbianSDK) { + DeviceType deviceEntry = ((SymbianSDK)sdk).getDeviceEntry(); + if (deviceEntry != null) { + if (isDefault){ + deviceEntry.setDefault(DefaultType.YES_LITERAL); + } else { + deviceEntry.setDefault(DefaultType.NO_LITERAL); + } + } + } + } + + public void setPreviouslyScanned(ISymbianSDK sdk, boolean wasScanned) { + if (sdk instanceof SymbianSDK) { + ((SymbianSDK)sdk).setPreviouslyScanned(wasScanned); + } + } + + protected List getBinaryVariationPlatformContexts(ISymbianSDK sdk) { + synchronized (binaryVariantContextList) { + if (!binaryVariantContextList.isEmpty()){ + return binaryVariantContextList; + } + + ISBVCatalog catalog = getSBVCatalog(sdk); + for (ISBVPlatform sbvPlatform : catalog.getPlatforms()) { + // Currently only variation of ARMV5 is supported... So just hard code the variated platform + // Only add the build platform if it's not virtual. + if (!sbvPlatform.isVirtual()){ + // TODO: Hard code build context hack + binaryVariantContextList.add(new BuildContextSBSv1(sdk, BuildContextSBSv1.ARMV5_PLATFORM + "." + sbvPlatform.getName(), ISymbianBuildContext.DEBUG_TARGET)); + // TODO: Hard code build context hack + binaryVariantContextList.add(new BuildContextSBSv1(sdk, BuildContextSBSv1.ARMV5_PLATFORM + "." + sbvPlatform.getName(), ISymbianBuildContext.RELEASE_TARGET)); + } + } + } + return binaryVariantContextList; + } + + protected List getBSFPlatformContexts(ISymbianSDK sdk) { + synchronized (bsfContextList) { + if (!bsfContextList.isEmpty()){ + return bsfContextList; + } + + IBSFCatalog catalog = getBSFCatalog(sdk); + for (IBSFPlatform platform : catalog.getPlatforms()) { + // only return non-variant style BSF's. see boog #4533 for details. + if (!platform.isVariant()) { + // TODO: Hard code build context hack + bsfContextList.add(new BuildContextSBSv1(sdk, platform.getName().toUpperCase(), ISymbianBuildContext.DEBUG_TARGET)); + // TODO: Hard code build context hack + bsfContextList.add(new BuildContextSBSv1(sdk, platform.getName().toUpperCase(), ISymbianBuildContext.RELEASE_TARGET)); + } + } + } + return bsfContextList; + } + + @SuppressWarnings("rawtypes") + protected List getSBSv1FilteredBuildConfigurations(ISymbianSDK sdk) { + Set sdkFeatures = sdk.getSupportedFeatures(); + List buildContexts = getAllBuildConfigurations(sdk); + if (buildContexts.size() == 0){ + return Collections.emptyList(); + } + + ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); + List platFilterList = sdkMgr.getPlatformList(); + Iterator li = buildContexts.iterator(); + while(li.hasNext()){ + ISymbianBuildContext currContext = li.next(); + for (BuildPlat currPlat : platFilterList){ // see which ones need to be filtered out. + + if (currPlat.getPlatName().equals(currContext.getPlatformString())){ + if (!currPlat.isEnabled()){ + if (sdkFeatures.contains(ISymbianSDKFeatures.IS_EKA2) && + currPlat.getOsIdentifier().equals(BuildPlat.EKA2_IDENTIFIER)){ + li.remove(); // filtered out in UI, don't show + break; + } + } + } + } + } + return buildContexts; + } + +} diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Mon Jun 07 20:50:55 2010 -0500 @@ -0,0 +1,239 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +*/ + +package com.nokia.carbide.cpp.internal.sdk.core.model; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; + +import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1; +import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv2; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils; +import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; +import com.nokia.carbide.cpp.sdk.core.IBSFPlatform; +import com.nokia.carbide.cpp.sdk.core.ISBVCatalog; +import com.nokia.carbide.cpp.sdk.core.ISBVPlatform; +import com.nokia.carbide.cpp.sdk.core.ISDKManager; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures; +import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; + +/** + * SBSv2 specific build information. + * + */ +public class SBSv2BuildInfo implements ISBSv2BuildInfo { + + private File prefixFile; + private IBSFCatalog bsfCatalog; + private ISBVCatalog sbvCatalog; + private List binaryVariantContextList = new ArrayList(0); + private List bsfContextList = new ArrayList(0); + + @Override + public List getFilteredBuildConfigurations(ISymbianSDK sdk) { + // This is probably a bug, but the filtering only uses SBSv1 preferences if SBSv1 is enabled... + List filteredContexts; + if (SBSv2Utils.enableSBSv2Support()) { + filteredContexts = SBSv2Utils.getFilteredSBSv2BuildContexts(sdk); + } else { + // be optimistic in this case... SBSv3? ;) + filteredContexts = getAllBuildConfigurations(sdk); + } + return filteredContexts; + } + + @Override + public List getAllBuildConfigurations(ISymbianSDK sdk) { + Set sdkFeatures = sdk.getSupportedFeatures(); + List buildTargets = new ArrayList(); + + // note that this gets variant platforms but not regular BSF's + List buildPlats = getAvailablePlatforms(sdk); + + if (buildPlats.size() == 0){ + return Collections.emptyList(); + } + // TODO: Hard code build context hack + buildTargets.add(new BuildContextSBSv2(sdk, ISymbianBuildContext.EMULATOR_PLATFORM, ISymbianBuildContext.DEBUG_TARGET, "")); + + if (sdkFeatures.contains(ISymbianSDKFeatures.IS_WINSCW_UREL_SUPPORTED)){ + // TODO: Hard code build context hack + buildTargets.add(new BuildContextSBSv2(sdk, ISymbianBuildContext.EMULATOR_PLATFORM, ISymbianBuildContext.RELEASE_TARGET, "")); + } + + for (String currPlat : buildPlats){ + if (currPlat.equals(ISymbianBuildContext.EMULATOR_PLATFORM) ) { + // emulation targets already determined (some SDKs don't get WISNCW UREL + continue; + } + // TODO: Hard code build context hack + buildTargets.add(new BuildContextSBSv2(sdk, currPlat, ISymbianBuildContext.DEBUG_TARGET, "")); + + // everything gets release except for WINSCW + // TODO: Hard code build context hack + buildTargets.add(new BuildContextSBSv2(sdk, currPlat, ISymbianBuildContext.RELEASE_TARGET, "")); + } + + ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); + if (sdkMgr.getBSFScannerEnabled()){ + buildTargets.addAll(getBSFPlatformContexts(sdk)); + buildTargets.addAll(getBinaryVariationPlatformContexts(sdk)); // Symbian Binary Variation (.var) + } + + return buildTargets; + } + + public List getPlatformMacros(ISymbianSDK sdk, String platform) { + if (sdk instanceof SymbianSDK) { + return ((SymbianSDK)sdk).getPlatformMacros(platform); + } + return null; + } + + public List getTargetTypeMacros(ISymbianSDK sdk, String targettype) { + // this is based on \epoc32\tools\trgtype.pm which changes from + // OS version to OS version, but largely remains constant with + // regards to the basic type. + List macros = new ArrayList(); + + // if it's not one of these then it's a DLL + if (targettype.compareToIgnoreCase("EPOCEXE") == 0) { + macros.add("__EXEDLL__"); + } else if (targettype.compareToIgnoreCase("EXEDLL") == 0) { + macros.add("__EXEDLL__"); + } else if (targettype.compareToIgnoreCase("EXE") == 0) { + macros.add("__EXE__"); + } else if (targettype.compareToIgnoreCase("EXEXP") == 0) { + macros.add("__EXE__"); + } else if (targettype.compareToIgnoreCase("IMPLIB") == 0) { + macros.add("__IMPLIB__"); + } else if (targettype.compareToIgnoreCase("KLIB") == 0) { + macros.add("__LIB__"); + } else if (targettype.compareToIgnoreCase("LIB") == 0) { + macros.add("__LIB__"); + } else { + macros.add("__DLL__"); + } + return macros; + } + + public List getAvailablePlatforms(ISymbianSDK sdk) { + ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); + return sdkMgr.getSymbianMacroStore().getSupportedPlatforms(((SymbianSDK)sdk).getOSVersion(), "", null); + } + + public File getPrefixFile(ISymbianSDK sdk) { + return prefixFile; + } + + public IPath getIncludePath(ISymbianSDK sdk) { + String epocRoot = sdk.getEPOCROOT(); + if (epocRoot.length() > 0) { + IPath epoc32IncPath = new Path(epocRoot).append("epoc32/include"); + // try to canonicalize it so it matches actual file system case + try { + epoc32IncPath = new Path(epoc32IncPath.toFile().getCanonicalPath()); + } catch (IOException e) { + } + return epoc32IncPath; + } + return null; + } + + public boolean isPreviouslyScanned(ISymbianSDK sdk) { + if (sdk instanceof SymbianSDK) { + return ((SymbianSDK)sdk).isPreviouslyScanned(); + } + return true; + } + + public IBSFCatalog getBSFCatalog(ISymbianSDK sdk) { + synchronized (sdk) { + if (bsfCatalog == null) { + bsfCatalog = BSFCatalogFactory.createCatalog(sdk); + } + } + return bsfCatalog; + } + + public ISBVCatalog getSBVCatalog(ISymbianSDK sdk) { + synchronized (sdk) { + if (sbvCatalog == null) { + sbvCatalog = SBVCatalogFactory.createCatalog(sdk); + } + } + return sbvCatalog; + } + + public void setPreviouslyScanned(ISymbianSDK sdk, boolean wasScanned) { + if (sdk instanceof SymbianSDK) { + ((SymbianSDK)sdk).setPreviouslyScanned(wasScanned); + } + } + + public void setPrefixFile(ISymbianSDK sdk, IPath prefixFile) { + this.prefixFile = new File(prefixFile.toOSString()); + } + + protected List getBinaryVariationPlatformContexts(ISymbianSDK sdk) { + synchronized (binaryVariantContextList) { + if (!binaryVariantContextList.isEmpty()){ + return binaryVariantContextList; + } + + ISBVCatalog catalog = getSBVCatalog(sdk); + for (ISBVPlatform sbvPlatform : catalog.getPlatforms()) { + // Currently only variation of ARMV5 is supported... So just hard code the variated platform + // Only add the build platform if it's not virtual. + if (!sbvPlatform.isVirtual()){ + // TODO: Hard code build context hack + binaryVariantContextList.add(new BuildContextSBSv2(sdk, BuildContextSBSv1.ARMV5_PLATFORM + "." + sbvPlatform.getName(), ISymbianBuildContext.DEBUG_TARGET, "")); + // TODO: Hard code build context hack + binaryVariantContextList.add(new BuildContextSBSv2(sdk, BuildContextSBSv1.ARMV5_PLATFORM + "." + sbvPlatform.getName(), ISymbianBuildContext.RELEASE_TARGET, "")); + } + } + } + return binaryVariantContextList; + } + + protected List getBSFPlatformContexts(ISymbianSDK sdk) { + synchronized (bsfContextList) { + if (!bsfContextList.isEmpty()){ + return bsfContextList; + } + + IBSFCatalog catalog = getBSFCatalog(sdk); + for (IBSFPlatform platform : catalog.getPlatforms()) { + // only return non-variant style BSF's. see boog #4533 for details. + if (!platform.isVariant()) { + // TODO: Hard code build context hack + bsfContextList.add(new BuildContextSBSv2(sdk, platform.getName().toUpperCase(), ISymbianBuildContext.DEBUG_TARGET, "")); + // TODO: Hard code build context hack + bsfContextList.add(new BuildContextSBSv2(sdk, platform.getName().toUpperCase(), ISymbianBuildContext.RELEASE_TARGET, "")); + } + } + } + return bsfContextList; + } + +} diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBVCatalogFactory.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBVCatalogFactory.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBVCatalogFactory.java Mon Jun 07 20:50:55 2010 -0500 @@ -12,7 +12,12 @@ */ package com.nokia.carbide.cpp.internal.sdk.core.model; +import java.io.File; + +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; import com.nokia.carbide.cpp.sdk.core.ISBVCatalog; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import org.eclipse.core.runtime.IPath; @@ -31,7 +36,17 @@ * @return a catalog, never null */ public static ISBVCatalog createCatalog(ISymbianSDK sdk) { - SBVCatalog catalog = new SBVCatalog(new Path(sdk.getEPOCROOT()), sdk.getIncludePath()); + IPath sdkIncludePath; + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + if (sbsv1BuildInfo != null) { + sdkIncludePath = sbsv1BuildInfo.getIncludePath(sdk); + } else if (sbsv2BuildInfo != null) { + sdkIncludePath = sbsv2BuildInfo.getIncludePath(sdk); + } else { + sdkIncludePath = new Path(sdk.getEPOCROOT()).append("include"); + } + SBVCatalog catalog = new SBVCatalog(new Path(sdk.getEPOCROOT()), sdkIncludePath); return catalog; } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Mon Jun 07 20:50:55 2010 -0500 @@ -38,11 +38,13 @@ import org.eclipse.ui.PlatformUI; import org.osgi.framework.Version; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DefaultType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DeviceType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DevicesFactory; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DevicesType; import com.nokia.carbide.cpp.internal.sdk.core.xml.DevicesLoader; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; import com.nokia.carbide.cpp.sdk.core.SDKEnvInfoFailureException; @@ -144,7 +146,10 @@ { for (ISymbianSDK currSDK : sdkList){ if (!currSDK.getUniqueId().equals(sdk.getUniqueId())){ - currSDK.setIsDefaultSDK(false); // set all to false, except the input one + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + sbsv1BuildInfo.setIsDefaultSDK(currSDK, false); // set all to false, except the input one + } } } } @@ -408,9 +413,13 @@ needsRescan = true; break; } - if (!sdk.getName().equalsIgnoreCase(currSDK.getName())){ - needsRescan = true; - break; + ISBSv1BuildInfo sbsv1BuildInfo1 = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv1BuildInfo sbsv1BuildInfo2 = (ISBSv1BuildInfo)currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo1 != null) { + if (!sbsv1BuildInfo1.getName(sdk).equalsIgnoreCase(sbsv1BuildInfo2.getName(currSDK))){ + needsRescan = true; + break; + } } } } @@ -455,7 +464,7 @@ deviceType.setUserdeletetable("false"); ISymbianSDK sdk = new SymbianSDK(deviceType); if (sdk.getOSVersion().toString().equals("0.0.0")) { - sdk.setOSVersion(new Version("9.5")); + ((SymbianSDK)sdk).setOSVersion(new Version("9.5")); } if (!isSupportedSDK(sdk)) { diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianMissingSDKFactory.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianMissingSDKFactory.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianMissingSDKFactory.java Mon Jun 07 20:50:55 2010 -0500 @@ -14,9 +14,11 @@ import org.osgi.framework.Version; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DefaultType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DeviceType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DevicesFactory; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SymbianSDKFactory; @@ -31,15 +33,19 @@ SymbianMissingSDK sdk = new SymbianMissingSDK(newDeviceEntry); // create SDK and set the attribs found in devices.xml // Set other essential paramaters not in devices.xml - + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); if (sdk.getOSVersion().getMajor() != 0){ // use the version detected from the SDK creation } else { - sdk.setOSVersion(new Version("0.0")); //$NON-NLS-1$ - sdk.setOSSDKBranch("0.0"); //$NON-NLS-1$ + sdk.setOSVersion(new Version("0.0")); //$NON-NLS-1$ + if (sbsv1BuildInfo != null) { + sbsv1BuildInfo.setOSSDKBranch(sdk, "0.0"); //$NON-NLS-1$ + } } - sdk.setSDKVersion(new Version("0.0")); //$NON-NLS-1$ + if (sbsv1BuildInfo != null) { + sbsv1BuildInfo.setSDKVersion(sdk, new Version("0.0")); //$NON-NLS-1$ + } return sdk; } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianSDK.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianSDK.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianSDK.java Mon Jun 07 20:50:55 2010 -0500 @@ -22,11 +22,11 @@ import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; -import java.util.Date; import java.util.HashMap; -import java.util.Iterator; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -53,45 +53,31 @@ import org.w3c.dom.traversal.NodeIterator; import org.xml.sax.SAXException; -import com.nokia.carbide.cpp.epoc.engine.preprocessor.DefaultModelDocumentProvider; -import com.nokia.carbide.cpp.epoc.engine.preprocessor.DefaultTranslationUnitProvider; -import com.nokia.carbide.cpp.epoc.engine.preprocessor.DefineFactory; -import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine; -import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1; -import com.nokia.carbide.cpp.internal.api.sdk.BuildPlat; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISymbianSDKModifier; import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils; -import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DefaultType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DeviceType; import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; -import com.nokia.carbide.cpp.sdk.core.IBSFPlatform; -import com.nokia.carbide.cpp.sdk.core.ISBVCatalog; -import com.nokia.carbide.cpp.sdk.core.ISBVPlatform; +import com.nokia.carbide.cpp.sdk.core.ISDKBuildInfo; import com.nokia.carbide.cpp.sdk.core.ISDKManager; -import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; -import com.nokia.carbide.internal.api.cpp.epoc.engine.preprocessor.BasicIncludeFileLocator; -import com.nokia.carbide.internal.api.cpp.epoc.engine.preprocessor.MacroScanner; import com.nokia.cpp.internal.api.utils.core.PathUtils; import com.sun.org.apache.xpath.internal.XPathAPI; -public class SymbianSDK implements ISymbianSDK { +public class SymbianSDK implements ISymbianSDK, ISymbianSDKModifier { public static final String MANIFEST_XML_LOCATION = "/epoc32/kit/manifest.xml"; //$NON-NLS-1$ // manifest.xml attributes - private static final String PATH_ID_EPOC32DIR = "epoc32Dir"; //$NON-NLS-1$ private static final String PATH_ID_INCLUDEDIR = "includeDir"; //$NON-NLS-1$ private static final String PATH_ID_TOOLSDIR = "toolsDir"; //$NON-NLS-1$ private static final String PATH_ID_SRCDIR = "srcDir"; //$NON-NLS-1$ - private static final String INCLUDE = "include"; //$NON-NLS-1$ private static final String RELEASE = "release"; //$NON-NLS-1$ - private static final String TOOLS = "tools"; //$NON-NLS-1$ - private static final String EPOC32_DIR = "epoc32"; //$NON-NLS-1$ - private static final String INCLUDE_SUBDIR = "epoc32/" + INCLUDE; //$NON-NLS-1$ - private static final String RELEASE_SUBDIR = "epoc32/" + RELEASE; //$NON-NLS-1$ - private static final String TOOLS_SUBDIR = "epoc32/" + TOOLS; //$NON-NLS-1$ private static final String VARIANT_CFG_FILE = "epoc32/tools/variant/variant.cfg"; //$NON-NLS-1$ private static final String SPP_VARIANT_CFG_FILE = "epoc32/tools/variant/spp_variant.cfg"; //$NON-NLS-1$ private static final String TARGETTYPE_PM_FILE = "epoc32/tools/trgtype.pm"; //$NON-NLS-1$ @@ -104,86 +90,52 @@ private boolean enabled = true; private boolean wasScanned = false; private Version osVersion; - private Version sdkVersion; - private String sdkOSBranch; + private List supportedTargetTypesList = new ArrayList(); + private Map> cachedPlatformMacros = new HashMap>(); + private Map buildInfoMap = new HashMap(); + @SuppressWarnings("rawtypes") + private Set sdkFeatures = new HashSet(); - private File licenseFile; - private File prefixFile; - - private List variantHRHMacros = null; - private List bsfContextList = new ArrayList(0); - - private List binaryVariantContextList = new ArrayList(0); - - private Date createDate; - private URL publisherURL; - private String sdkDescription; - private String publisherName; - - private boolean supportsWINSCW_UREL; - - List supportedTargetTypesList = new ArrayList(); - - private IBSFCatalog bsfCatalog; - private ISBVCatalog sbvCatalog; - - private Map> cachedPlatformMacros = new HashMap>(); - // greedy match means the filename is in the last group private static Pattern VARIANT_HRH_LINE_PATTERN = Pattern.compile("(?i)(.*)(/|\\\\)(.*hrh)"); - private long hrhFileTimeStamp = 0; - public SymbianSDK(DeviceType device) { deviceEntry = device; + if (SDKCorePlugin.SUPPORTS_SBSV1_BUILDER) { + setBuildInfo(new SBSv1BuildInfo(), ISymbianBuilderID.SBSV1_BUILDER); + } + if (SBSv2Utils.enableSBSv2Support()) { + setBuildInfo(new SBSv2BuildInfo(), ISymbianBuilderID.SBSV2_BUILDER); + } + scanSDK(); } public void scanSDK(){ cachedPlatformMacros.clear(); - variantHRHMacros = null; if (!setDataFromManifestXML()){ - // must derive the OS and SDK version - if (!deriveOSVersionFromDeviceId()){ - //need to scan SDK files for OS and SDK version - scanSDKForVersionInfo(); + //need to scan SDK files for OS and SDK version + scanSDKForVersionInfo(); + } + + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + + IPath prefixFileFullPath = getPrefixFromVariantCfg(); + if (prefixFileFullPath != null) { + if (sbsv1BuildInfo != null) { + sbsv1BuildInfo.setPrefixFile(this, prefixFileFullPath); + } + if (sbsv2BuildInfo != null) { + sbsv2BuildInfo.setPrefixFile(this, prefixFileFullPath); } } - IPath prefixFileFullPath = getPrefixFromVariantCfg(); - if (prefixFileFullPath != null){ - setPrefixFile(prefixFileFullPath); - } - - // Trick for SEMC. Try to set the SDK version based on a UIQ HRH file - // if there's is no SDK version - if (getSDKVersion().getMajor() == 0 && getName().equalsIgnoreCase(ISymbianSDK.UIQ_SDK_NAME)){ - // This might be an SEMC CustKit, get the version from the HRH file - if (getPrefixFile() != null){ - String prefixFileStr = getPrefixFile().toString(); - if (prefixFileStr.indexOf("UIQ_") != -1 && prefixFileStr.indexOf(".hrh") != -1){ - prefixFileStr = prefixFileStr.substring(prefixFileStr.indexOf("UIQ_")+4, prefixFileStr.indexOf(".hrh")); - if (prefixFileStr.length() == 3 && prefixFileStr.contains(".")){ - setSDKVersion(new Version(prefixFileStr)); - } - } - } - } - - scanForWINSCW_UREL(); + setSupportFeatures(); } - public List getAvailablePlatforms() { - ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); - return sdkMgr.getSymbianMacroStore().getSupportedPlatforms(getOSVersion(), getSDKOSBranch(), getBSFCatalog()); - } - - public Date getCreationDate() { - return createDate; - } - public String getEPOCROOT() { if (deviceEntry != null) { String epocRoot = deviceEntry.getEpocroot(); @@ -224,207 +176,6 @@ enabled = enable; } - public String getFamily() { - String[] parts = getName().split("\\."); - if (parts.length == 3){ - if (getSDKVersion().getMajor() == 5 && getName().equalsIgnoreCase(NOKIA_SF_SDK_NAME)){ - // A vendor of "symbian" and SDK major version 5 is the same as prior naming for "com.nokia.s60" & 5th Edition. - // Return "s60" so that project template generation continues to work as it's a S60 5th ed. SDK. - return ISymbianSDK.S60_FAMILY_ID; - } else { - return parts[2]; - } - } - - return ""; - } - - - public List getTargetTypeMacros(String targettype) { - // this is based on \epoc32\tools\trgtype.pm which changes from - // OS version to OS version, but largely remains constant with - // regards to the basic type. - List macros = new ArrayList(); - - // if it's not one of these then it's a DLL - if (targettype.compareToIgnoreCase("EPOCEXE") == 0) { - macros.add("__EXEDLL__"); - } else if (targettype.compareToIgnoreCase("EXEDLL") == 0) { - macros.add("__EXEDLL__"); - } else if (targettype.compareToIgnoreCase("EXE") == 0) { - macros.add("__EXE__"); - } else if (targettype.compareToIgnoreCase("EXEXP") == 0) { - macros.add("__EXE__"); - } else if (targettype.compareToIgnoreCase("IMPLIB") == 0) { - macros.add("__IMPLIB__"); - } else if (targettype.compareToIgnoreCase("KLIB") == 0) { - macros.add("__LIB__"); - } else if (targettype.compareToIgnoreCase("LIB") == 0) { - macros.add("__LIB__"); - } else { - macros.add("__DLL__"); - } - return macros; - } - - - public List getUnfilteredBuildConfigurations() { - - List buildTargets = new ArrayList(); - - // note that this gets variant platforms but not regular BSF's - List buildPlats = getAvailablePlatforms(); - - if (buildPlats.size() == 0){ - return Collections.emptyList(); - } - // TODO: Hard code build context hack - buildTargets.add(new BuildContextSBSv1(this, ISymbianBuildContext.EMULATOR_PLATFORM, ISymbianBuildContext.DEBUG_TARGET)); - - if (supportsWINSCW_UREL()){ - // TODO: Hard code build context hack - buildTargets.add(new BuildContextSBSv1(this, ISymbianBuildContext.EMULATOR_PLATFORM, ISymbianBuildContext.RELEASE_TARGET)); - } - - for (String currPlat : buildPlats){ - - if (currPlat.equals(ISymbianBuildContext.EMULATOR_PLATFORM) ) { - // emulation targets already determined (some SDKs don't get WISNCW UREL - continue; - } - // TODO: Hard code build context hack - buildTargets.add(new BuildContextSBSv1(this, currPlat, ISymbianBuildContext.DEBUG_TARGET)); - - // everything gets release except for WINSCW - // TODO: Hard code build context hack - buildTargets.add(new BuildContextSBSv1(this, currPlat, ISymbianBuildContext.RELEASE_TARGET)); - } - - ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); - if (sdkMgr.getBSFScannerEnabled()){ - buildTargets.addAll(getBSFPlatformContexts()); - buildTargets.addAll(getBinaryVariationPlatformContexts()); // Symbian Binary Variation (.var) - } - - return buildTargets; - } - - public List getBSFPlatformContexts(){ - - synchronized (bsfContextList) { - if (!bsfContextList.isEmpty()){ - return bsfContextList; - } - - IBSFCatalog catalog = getBSFCatalog(); - for (IBSFPlatform platform : catalog.getPlatforms()) { - // only return non-variant style BSF's. see boog #4533 for details. - if (!platform.isVariant()) { - // TODO: Hard code build context hack - bsfContextList.add(new BuildContextSBSv1(this, platform.getName().toUpperCase(), ISymbianBuildContext.DEBUG_TARGET)); - // TODO: Hard code build context hack - bsfContextList.add(new BuildContextSBSv1(this, platform.getName().toUpperCase(), ISymbianBuildContext.RELEASE_TARGET)); - } - } - } - - return bsfContextList; - } - -public List getBinaryVariationPlatformContexts(){ - - synchronized (binaryVariantContextList) { - if (!binaryVariantContextList.isEmpty()){ - return binaryVariantContextList; - } - - ISBVCatalog catalog = getSBVCatalog(); - for (ISBVPlatform sbvPlatform : catalog.getPlatforms()) { - // Currently only variation of ARMV5 is supported... So just hard code the variated platform - // Only add the build platform if it's not virtual. - if (!sbvPlatform.isVirtual()){ - // TODO: Hard code build context hack - binaryVariantContextList.add(new BuildContextSBSv1(this, BuildContextSBSv1.ARMV5_PLATFORM + "." + sbvPlatform.getName(), ISymbianBuildContext.DEBUG_TARGET)); - // TODO: Hard code build context hack - binaryVariantContextList.add(new BuildContextSBSv1(this, BuildContextSBSv1.ARMV5_PLATFORM + "." + sbvPlatform.getName(), ISymbianBuildContext.RELEASE_TARGET)); - } - } - } - - return binaryVariantContextList; - } - - public List getFilteredBuildConfigurations() { - // This is probably a bug, but the filtering only uses SBSv1 preferences if SBSv1 is enabled... - List filteredContexts; - if (SBSv2Utils.enableSBSv1Support()) { - filteredContexts = getSBSv1FilteredBuildConfigurations(); - } else { - if (SBSv2Utils.enableSBSv2Support()) { - filteredContexts = SBSv2Utils.getFilteredSBSv2BuildContexts(this); - } else { - // be optimistic in this case... SBSv3? ;) - filteredContexts = getUnfilteredBuildConfigurations(); - } - } - return filteredContexts; - } - - protected List getSBSv1FilteredBuildConfigurations() { - List buildContexts = getUnfilteredBuildConfigurations(); - - if (buildContexts.size() == 0){ - return Collections.emptyList(); - } - - ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); - List platFilterList = sdkMgr.getPlatformList(); - - Iterator li = buildContexts.iterator(); - - while(li.hasNext()){ - ISymbianBuildContext currContext = li.next(); - for (BuildPlat currPlat : platFilterList){ // see which ones need to be filtered out. - - if (currPlat.getPlatName().equals(currContext.getPlatformString())){ - if (!currPlat.isEnabled()){ - if (isEKA2() && currPlat.getOsIdentifier().equals(BuildPlat.EKA2_IDENTIFIER)){ - li.remove(); // filtered out in UI, don't show - break; - } - } - } - } - } - - return buildContexts; - } - - public IPath getIncludePath() { - String epocRoot = getEPOCROOT(); - if (epocRoot.length() > 0) { - IPath epoc32IncPath = new Path(epocRoot).append("epoc32/include"); - // try to canonicalize it so it matches actual file system case - try { - epoc32IncPath = new Path(epoc32IncPath.toFile().getCanonicalPath()); - } catch (IOException e) { - } - return epoc32IncPath; - } - return null; - } - - public File getLicenseFile() { - return licenseFile; - } - - public String getName() { - if (deviceEntry != null) { - return deviceEntry.getName(); - } - return ""; - } - public Version getOSVersion() { if (osVersion == null){ return new Version("0.0"); @@ -432,80 +183,24 @@ return osVersion; } - public Version getSDKVersion() { - if (sdkVersion == null){ - return new Version("0.0"); - } - return sdkVersion; - } - public List getPlatformMacros(String platform) { List platformMacros = cachedPlatformMacros.get(platform.toUpperCase()); if (platformMacros == null) { synchronized (cachedPlatformMacros) { + String branch = ""; + IBSFCatalog bsfCatalog = null; + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + branch = sbsv1BuildInfo.getSDKOSBranch(this); + bsfCatalog = sbsv1BuildInfo.getBSFCatalog(this); + } ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); - platformMacros = sdkMgr.getSymbianMacroStore().getPlatformMacros(getOSVersion(), getSDKOSBranch(), getBSFCatalog(), platform); + platformMacros = sdkMgr.getSymbianMacroStore().getPlatformMacros(getOSVersion(), branch, bsfCatalog, platform); cachedPlatformMacros.put(platform.toUpperCase(), platformMacros); } } return platformMacros; } - - public List getVendorSDKMacros() { - ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); - return sdkMgr.getSymbianMacroStore().getVendorMacros(getSDKVersion(), getName()); - } - - public File getPrefixFile() { - return prefixFile; - } - - public URL getPublisherURL() { - return publisherURL; - } - - public IPath getReleaseRoot() { - String epocRoot = getEPOCROOT(); - if (epocRoot.length() > 0) { - IPath epoc32RelPath = new Path(epocRoot).append("epoc32/release"); - // try to canonicalize it so it matches actual file system case - try { - epoc32RelPath = new Path(epoc32RelPath.toFile().getCanonicalPath()); - } catch (IOException e) { - } - return epoc32RelPath; - } - return null; - } - - public String getSDKDescription() { - if (sdkDescription == null){ - return ""; - } - return sdkDescription; - } - - public String getSDKOSBranch() { - if (sdkOSBranch == null){ - return ""; - } - - return sdkOSBranch; - } - - public IPath getToolsPath() { - String epocRoot = getEPOCROOT(); - if (epocRoot.length() > 0) { - IPath epoc32ToolsPath = new Path(epocRoot).append("epoc32/tools"); - // try to canonicalize it so it matches actual file system case - try { - epoc32ToolsPath = new Path(epoc32ToolsPath.toFile().getCanonicalPath()); - } catch (IOException e) { - } - return epoc32ToolsPath; - } - return null; - } public String getUniqueId() { if (deviceEntry != null) { @@ -514,83 +209,6 @@ return ""; } - public String getVendor() { - String[] parts = getName().split("\\."); - if (parts.length == 3) - return parts[1]; - - return ""; - } - - public List getProjectVariantHRHDefines() { - // this is deprecated. should use the one in ISymbianBuildContext instead. - - long hrhTime = 0; - if (getPrefixFile() != null){ - hrhTime = getPrefixFile().lastModified(); - } - - if (variantHRHMacros == null || variantHRHMacros.size() == 0 || hrhTime != hrhFileTimeStamp) { - synchronized (this) { - hrhFileTimeStamp = hrhTime; // update time stamp to latest - List macros = new ArrayList(); - Map namedMacros = new HashMap(); - File file = getPrefixFile(); - if (file != null){ - - // Note: MacroScanner argument 'BasicIncludeFileLocation' can take - // paramaters for user/system includes, however, for getting macros - // from the prefix file it should not be necessary. - MacroScanner scanner = new MacroScanner( - new BasicIncludeFileLocator(null, null), - DefaultModelDocumentProvider.getInstance(), - DefaultTranslationUnitProvider.getInstance()); - scanner.scanFile(file); - - List scannedMacros = (List)scanner.getMacroDefinitions(); - for (IDefine scannedMacro : scannedMacros){ - // we don't want duplicate macros, so check to see if it's already there. - // if it is, remove it and then add the newer one. this is consistent with - // how it would be from a compiler standpoint. - IDefine macro = namedMacros.get(scannedMacro.getName()); - if (macro != null) { - macros.remove(macro); - } - - macros.add(scannedMacro); - namedMacros.put(scannedMacro.getName(), scannedMacro); - } - - List variantCFGMacros = getVariantCFGMacros(); - for (String cfgMacros : variantCFGMacros){ - // we don't want duplicate macros, so check to see if it's already there. - IDefine existingMacro = namedMacros.get(cfgMacros); - if (existingMacro != null) { - macros.remove(existingMacro); - } - - IDefine macro = DefineFactory.createSimpleFreeformDefine(cfgMacros); - macros.add(macro); - namedMacros.put(macro.getName(), macro); - } - } - variantHRHMacros = macros; - } - } - - return variantHRHMacros; - } - - public List getProjectVariantHRHMacros() { - // this API is deprecated, so don't cache this - List defines = getProjectVariantHRHDefines(); - List macros = new ArrayList(defines.size()); - for (IDefine define : defines) { - macros.add(define.getDefinitionText()); - } - return macros; - } - @SuppressWarnings("unchecked") public List getVariantCFGMacros(){ @@ -631,8 +249,7 @@ return variantCFGMacros; } - - + public List getSupportedTargetTypes() { synchronized (supportedTargetTypesList) { @@ -676,18 +293,6 @@ return supportedTargetTypesList; } - public boolean isDefaultSDK() { - if (deviceEntry == null) { - return false; - } - - if (deviceEntry.getDefault().equals(DefaultType.YES_LITERAL)){ - return true; - } else { - return false; - } - } - public boolean isValid() { // TODO: What makes us valid? We only need a valid devices.xml entry // to do a build, but we need the other data for most everything else. @@ -737,55 +342,56 @@ // XML Valiation code from: http://java.sun.com/developer/technicalArticles/xml/validationxpath/ try { - // Parse an XML document into a DOM tree. - DocumentBuilder parser = - DocumentBuilderFactory.newInstance().newDocumentBuilder(); - doc = parser.parse(manifestFile); - - // Create a SchemaFactory capable of understanding WXS schemas. - SchemaFactory factory = - SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); - - // Load a WXS schema, represented by a Schema instance. - String tempStr = manifestFile.getAbsolutePath(); - int index = tempStr.lastIndexOf(File.separator); - tempStr = tempStr.substring(0, index); - tempStr += File.separator + "sdkManifest.xsd"; - Source schemaFile = new StreamSource(new File(tempStr)); - Schema schema = factory.newSchema(schemaFile); - - // Create a Validator object, which can be used to validate - // an instance document. - Validator validator = schema.newValidator(); + // Parse an XML document into a DOM tree. + DocumentBuilder parser = + DocumentBuilderFactory.newInstance().newDocumentBuilder(); + doc = parser.parse(manifestFile); + + // Create a SchemaFactory capable of understanding WXS schemas. + SchemaFactory factory = + SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + + // Load a WXS schema, represented by a Schema instance. + String tempStr = manifestFile.getAbsolutePath(); + int index = tempStr.lastIndexOf(File.separator); + tempStr = tempStr.substring(0, index); + tempStr += File.separator + "sdkManifest.xsd"; + Source schemaFile = new StreamSource(new File(tempStr)); + Schema schema = factory.newSchema(schemaFile); + + // Create a Validator object, which can be used to validate + // an instance document. + Validator validator = schema.newValidator(); + + // Validate the DOM tree. + // Don't use new DOMSource(doc) for manifest, that requires namespace + // and some (e.g. S60) manifest.xml says xsi:noNamespaceSchemaLocation. + // Failure will show in Java 6 + // see detail in XERCESJ-1163 boog report + // http://issues.apache.org/jira/browse/XERCESJ-1163?page=all + validator.validate(new StreamSource(manifestFile)); - // Validate the DOM tree. - // Don't use new DOMSource(doc) for manifest, that requires namespace - // and some (e.g. S60) manifest.xml says xsi:noNamespaceSchemaLocation. - // Failure will show in Java 6 - // see detail in XERCESJ-1163 boog report - // http://issues.apache.org/jira/browse/XERCESJ-1163?page=all - validator.validate(new StreamSource(manifestFile)); - - } catch (ParserConfigurationException e) { - ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.getPluginId(), IStatus.ERROR, "SDK Manifest could not be parsed correctly.", e)); - hasParseError = true; - } catch (SAXException e) { - ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.getPluginId(), IStatus.ERROR, "SDK Manifest failed schema validation.", e)); - hasParseError = true; - // exception handling - document not valid! - } catch (IOException e) { - // This SDK has not manifest, don't post error - hasParseError = true; - } + } catch (ParserConfigurationException e) { + ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.getPluginId(), IStatus.ERROR, "SDK Manifest could not be parsed correctly.", e)); + hasParseError = true; + } catch (SAXException e) { + ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.getPluginId(), IStatus.ERROR, "SDK Manifest failed schema validation.", e)); + hasParseError = true; + // exception handling - document not valid! + } catch (IOException e) { + // This SDK has not manifest, don't post error + hasParseError = true; + } - // if there were any parse errors, throw an exception so that suitable defaults - // can be calculated from the devices.xml entry. - if (hasParseError) { - return false; - } + // if there were any parse errors, throw an exception so that suitable defaults + // can be calculated from the devices.xml entry. + if (hasParseError) { + return false; + } + + try { - try { - + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); Node node = XPathAPI.selectSingleNode(doc, "sdk/paths"); for (NodeIterator nodeIter = XPathAPI.selectNodeIterator(doc, "sdk"); (node = nodeIter.nextNode()) != null;) { NamedNodeMap attribs = node.getAttributes(); @@ -794,14 +400,12 @@ if (node != null) { // currently ignored... String tempStr = node.getNodeValue(); - - } // name is currently ignored node = attribs.getNamedItem("name"); String sdkFamily = node == null ? null : node.getNodeValue(); - + node = XPathAPI.selectSingleNode(doc, "sdk/paths/@root"); String path = node == null ? null : node.getNodeValue(); if (null != path) { @@ -816,68 +420,30 @@ // Loop through the sdk:paths:root elements and pick out check all the 'id' attriutes for matches... attribs = node.getAttributes(); String rootType = attribs.getNamedItem("id").getNodeValue(); - if (rootType.equals(PATH_ID_INCLUDEDIR)) { - node = attribs.getNamedItem("path"); - /*if (null!=node){ - setIncludePath(new Path(path + node.getNodeName())); - }*/ - } else if (rootType.equals(RELEASE)) { - node = attribs.getNamedItem("path"); - /*if (null!=node){ - setReleaseRoot(new Path(path + node.getNodeName())); - }*/ - } else if (rootType.equals(PATH_ID_TOOLSDIR)) { - node = attribs.getNamedItem("path"); - /*if (null!=node){ - setToolsPath(new Path(path + node.getNodeName())); - }*/ - } else if (rootType.equals(PATH_ID_SRCDIR)) { - node = attribs.getNamedItem("path"); - /*if (null!=node){ - setSourcePath(new Path(path + node.getNodeName())); - }*/ - } /* - else if (rootType.equals(PATH_ID_EPOC32DIR)) { - node = attribs.getNamedItem("path"); - if (null!=node){ - set(new File(path, node.getNodeName())); - } - } - */ + if (rootType.equals(PATH_ID_INCLUDEDIR)) { + node = attribs.getNamedItem("path"); + /*if (null!=node){ + setIncludePath(new Path(path + node.getNodeName())); + }*/ + } else if (rootType.equals(RELEASE)) { + node = attribs.getNamedItem("path"); + /*if (null!=node){ + setReleaseRoot(new Path(path + node.getNodeName())); + }*/ + } else if (rootType.equals(PATH_ID_TOOLSDIR)) { + node = attribs.getNamedItem("path"); + /*if (null!=node){ + setToolsPath(new Path(path + node.getNodeName())); + }*/ + } else if (rootType.equals(PATH_ID_SRCDIR)) { + node = attribs.getNamedItem("path"); + /*if (null!=node){ + setSourcePath(new Path(path + node.getNodeName())); + }*/ } + } } - - node = XPathAPI.selectSingleNode(doc, "sdk/paths/license/@file"); - if (node != null){ - String licenseStr = node.getNodeValue(); - this.setLicenseFile(new File(path, licenseStr)); - } - // Get the general SDK description... - node = XPathAPI.selectSingleNode(doc, "sdk/description"); - if (null != node) { - setSDKDescription(node.getTextContent()); - } - - // Get the build configuration to use... - /* - node = XPathAPI.selectSingleNode(doc, "sdk/buildConfig"); - if (null != node) { - sdkManifest.setSDKBuildConfig(node.getTextContent()); - this.id = sdkManifest.getSDKBuildConfig(); - } - */ - - // Get the SDK Version... - node = XPathAPI.selectSingleNode(doc, "sdk/sdkVersion"); - if (null != node) { - try { - setSDKVersion(new Version(node.getTextContent())); - } - catch (IllegalArgumentException e){ - // ignored...improper format - } - } - + // Get the osInfo node = XPathAPI.selectSingleNode(doc, "sdk/osInfo"); if (null != node){ @@ -896,51 +462,76 @@ if (null != node) { if (getOSVersion().getMajor() == 9){ - setOSSDKBranch(""); + sbsv1BuildInfo.setOSSDKBranch(this, ""); }else { - setOSSDKBranch(node.getNodeValue()); + sbsv1BuildInfo.setOSSDKBranch(this, node.getNodeValue()); } } } - // Get the creation time/date - node = XPathAPI.selectSingleNode(doc, "sdk/createdDate"); - if (null != node){ - try { - // Get the default MEDIUM/SHORT DateFormat - DateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT); - setCreateDate(format.parse(node.getTextContent())); - } - catch (ParseException pe) { - // ignore, we're just using the date for info, not critical if missing - } - } - // Get the publisher - node = XPathAPI.selectSingleNode(doc, "sdk/publisher"); - if (null != node){ - attribs = node.getAttributes(); - node = attribs.getNamedItem("link"); - if (null != node) - { + if (sbsv1BuildInfo != null) { + node = XPathAPI.selectSingleNode(doc, "sdk/paths/license/@file"); + if (node != null){ + String licenseStr = node.getNodeValue(); + sbsv1BuildInfo.setLicenseFile(this, new File(path, licenseStr)); + } + + // Get the general SDK description... + node = XPathAPI.selectSingleNode(doc, "sdk/description"); + if (null != node) { + sbsv1BuildInfo.setSDKDescription(this, node.getTextContent()); + } + + // Get the SDK Version... + node = XPathAPI.selectSingleNode(doc, "sdk/sdkVersion"); + if (null != node) { try { - setPublisherURL(new URL(node.getNodeValue())); + sbsv1BuildInfo.setSDKVersion(this, new Version(node.getTextContent())); } catch (IllegalArgumentException e){ // ignored...improper format + } + } + + // Get the creation time/date + node = XPathAPI.selectSingleNode(doc, "sdk/createdDate"); + if (null != node){ + try { + // Get the default MEDIUM/SHORT DateFormat + DateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT); + sbsv1BuildInfo.setCreateDate(this, format.parse(node.getTextContent())); + } + catch (ParseException pe) { + // ignore, we're just using the date for info, not critical if missing } } - node = attribs.getNamedItem("logo"); - /*if (null != node){ - setPublisherLogo(new File(path, node.getNodeValue())); - }*/ - node = attribs.getNamedItem("name"); - if (null != node) - { - setPublisherName(node.getNodeValue()); + + // Get the publisher + node = XPathAPI.selectSingleNode(doc, "sdk/publisher"); + if (null != node){ + attribs = node.getAttributes(); + node = attribs.getNamedItem("link"); + if (null != node) + { + try { + sbsv1BuildInfo.setPublisherURL(this, new URL(node.getNodeValue())); + } + catch (IllegalArgumentException e){ + // ignored...improper format + } + } + node = attribs.getNamedItem("logo"); + /*if (null != node){ + setPublisherLogo(new File(path, node.getNodeValue())); + }*/ + node = attribs.getNamedItem("name"); + if (null != node) + { + sbsv1BuildInfo.setPublisherName(this, node.getNodeValue()); + } } } } - } catch (TransformerException e){ e.printStackTrace(); } catch (MalformedURLException e){ @@ -949,100 +540,9 @@ return true; } - - public void setLicenseFile(File licenseFile) { - this.licenseFile = licenseFile; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } - - - public void setIsDefaultSDK(boolean isDefault) { - if (isDefault){ - deviceEntry.setDefault(DefaultType.YES_LITERAL); - } else { - deviceEntry.setDefault(DefaultType.NO_LITERAL); - } - - } - - public void setOSSDKBranch(String branch) { - sdkOSBranch = branch; - - } public void setOSVersion(Version osVer) { this.osVersion = osVer; - - } - - public void setPrefixFile(IPath prefixFile) { - this.prefixFile = new File(prefixFile.toOSString()); - } - - - public void setPublisherURL(URL publisherURL) { - this.publisherURL = publisherURL; - } - - public void setSDKVersion(Version sdkVers) { - sdkVersion = sdkVers; - } - - public void setSDKDescription(String sdkDescription) { - this.sdkDescription = sdkDescription; - } - - public void setPublisherName(String publisherName) { - this.publisherName = publisherName; - } - - private boolean deriveOSVersionFromDeviceId(){ - boolean foundOSVersion = false; - - if (getUniqueId().equals("S60_3rd")){ - setOSVersion(new Version("9.1.0")); - setSDKVersion(new Version("3.0.0")); - foundOSVersion = true; - } else if (getUniqueId().equals("UIQ3") || getUniqueId().equals("UIQ_3_PB2")){ - setOSVersion(new Version("9.1.0")); - setSDKVersion(new Version("3.0.0")); - foundOSVersion = true; - } else if (getUniqueId().equals("Series60_1_2_CW")){ - setOSVersion(new Version("6.1.0")); - setSDKVersion(new Version("1.2.0")); - foundOSVersion = true; - } else if (getUniqueId().equals("Series60_2_0_CW")){ - setOSVersion(new Version("7.0.0")); - setSDKVersion(new Version("2.0.0")); - foundOSVersion = true; - } else if (getUniqueId().equals("Series60_v21_CW")){ - setOSVersion(new Version("7.0.0")); - setSDKVersion(new Version("2.1.0")); - foundOSVersion = true; - } else if (getUniqueId().equals("S60_2nd_FP2_CW")){ - setOSVersion(new Version("8.0.0")); - setSDKVersion(new Version("2.6.0")); - setOSSDKBranch(EKA1_A_BRANCH_IDENTIFIER); - foundOSVersion = true; - } else if (getUniqueId().equals("S60_2nd_FP3") || getUniqueId().equals("S60_2nd_FP3_CW") || getUniqueId().equals("S60_2nd_FP3_B")){ - setOSVersion(new Version("8.1.0")); - setSDKVersion(new Version("2.8.0")); - setOSSDKBranch(EKA1_A_BRANCH_IDENTIFIER); - foundOSVersion = true; - } else if (getUniqueId().equals("UIQ_21")){ - setOSVersion(new Version("7.0.15")); - setSDKVersion(new Version("2.1.0")); - foundOSVersion = true; - } else if (getUniqueId().equals("Series80_DP2_0_SDK_CW")){ - setOSVersion(new Version("7.0.0")); - setSDKVersion(new Version("2.0.0")); - foundOSVersion = true; - } - return foundOSVersion; - } /** @@ -1060,6 +560,7 @@ setOSVersion(new Version("9.5.0")); // Set a default version that will work with all EKA2 try { + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); char[] cbuf = new char[(int) bldInfoFile.length()]; Reader reader = new FileReader(bldInfoFile); reader.read(cbuf); @@ -1078,28 +579,34 @@ if (versionTokens[2].toUpperCase().contains("TB92SF")){ setOSVersion(new Version("9.5.0")); - setSDKVersion(new Version("5.2.0")); + if (sbsv1BuildInfo != null) { + sbsv1BuildInfo.setSDKVersion(this, new Version("5.2.0")); + } break; } else if (versionTokens[2].toUpperCase().contains("TB101SF")){ setOSVersion(new Version("9.6.0")); - setSDKVersion(new Version("6.0.0")); + if (sbsv1BuildInfo != null) { + sbsv1BuildInfo.setSDKVersion(this, new Version("6.0.0")); + } break; } else if (versionTokens[2].toUpperCase().contains("TB102SF")){ setOSVersion(new Version("9.6.0")); - setSDKVersion(new Version("6.0.0")); + if (sbsv1BuildInfo != null) { + sbsv1BuildInfo.setSDKVersion(this, new Version("6.0.0")); + } break; } else if (versionTokens[2].lastIndexOf("v") > 0){ int index = versionTokens[2].lastIndexOf("v"); String osVersionString = versionTokens[2].substring(index+1, versionTokens[2].length()); - if (osVersionString.endsWith(EKA1_A_BRANCH_IDENTIFIER) || - osVersionString.endsWith(EKA2_B_BRANCH_IDENTIFIER) || - osVersionString.endsWith(EKA1_S_BRANCH_IDENTIFIER)){ + if (osVersionString.endsWith(ISBSv1BuildInfo.EKA1_A_BRANCH_IDENTIFIER) || + osVersionString.endsWith(ISBSv1BuildInfo.EKA2_B_BRANCH_IDENTIFIER) || + osVersionString.endsWith(ISBSv1BuildInfo.EKA1_S_BRANCH_IDENTIFIER)){ String branch = osVersionString.substring(osVersionString.length()-1, osVersionString.length()); - if (branch != null){ - setOSSDKBranch(branch); + if (sbsv1BuildInfo != null && branch != null){ + sbsv1BuildInfo.setOSSDKBranch(this, branch); } } @@ -1203,92 +710,34 @@ deviceEntry.setEpocroot(epocRoot); } - public void setName(String name) { - deviceEntry.setName(name); - } - - public void setUniqueID(String id) { + public void setUniqueId(String id) { deviceEntry.setId(id); } - @Deprecated - public boolean getRequiresRestart() { - return false; - } - - public String getPublisherName() { - return publisherName; - } - - public boolean isEKA1() { - return !isEKA2() && getOSVersion().getMajor() < 9 && getOSVersion().getMajor() >= 6; - } - - public boolean isEKA2() { + private boolean isEKA2() { if (getOSVersion().getMajor() >= 9) { return true; } - if (getOSVersion().getMajor() == 8 - && getSDKOSBranch().equals(ISymbianSDK.EKA2_B_BRANCH_IDENTIFIER)){ - return true; - } return false; } - public boolean isS60() { - return getFamily().equals(ISymbianSDK.S60_FAMILY_ID) - || getFamily().equals(ISymbianSDK.SERIES60_FAMILY_ID); - } - - public void setSupportsWINSCW_UREL(boolean isSupported) { - supportsWINSCW_UREL = isSupported; - } - - public boolean supportsWINSCW_UREL() { - return supportsWINSCW_UREL; - } - /** * Check to see whether or not we should support WINSCW UREL */ + @SuppressWarnings("unchecked") private void scanForWINSCW_UREL(){ - supportsWINSCW_UREL = false; String winscwURELFullPathStr = getEPOCROOT(); winscwURELFullPathStr += WINSCW_UREL_DIR; IPath winscwURELPath = new Path(winscwURELFullPathStr); if (winscwURELPath != null && winscwURELPath.toFile().exists()){ if (winscwURELPath.append("epoc.exe").toFile().exists()){ if (winscwURELPath.append("euser.dll").toFile().exists()){ - supportsWINSCW_UREL = true; + sdkFeatures.add(ISymbianSDKFeatures.IS_WINSCW_UREL_SUPPORTED); } } } } - /* (non-Javadoc) - * @see com.nokia.carbide.cpp.sdk.core.ISymbianSDK#getBSFCatalog() - */ - public IBSFCatalog getBSFCatalog() { - synchronized (this) { - if (bsfCatalog == null) { - bsfCatalog = BSFCatalogFactory.createCatalog(this); - } - } - return bsfCatalog; - } - - /* (non-Javadoc) - * @see com.nokia.carbide.cpp.sdk.core.ISymbianSDK#getBSFCatalog() - */ - public ISBVCatalog getSBVCatalog() { - synchronized (this) { - if (sbvCatalog == null) { - sbvCatalog = SBVCatalogFactory.createCatalog(this); - } - } - return sbvCatalog; - } - public void setPreviouslyScanned(boolean wasScanned) { this.wasScanned = wasScanned; } @@ -1296,5 +745,39 @@ public boolean isPreviouslyScanned() { return wasScanned; } - + + public ISDKBuildInfo getBuildInfo(String builderId) { + ISDKBuildInfo buildInfo = buildInfoMap.get(builderId); + return buildInfo; + } + + @SuppressWarnings("rawtypes") + public Set getSupportedFeatures() { + return sdkFeatures; + } + + public DeviceType getDeviceEntry() { + return deviceEntry; + } + + public void setBuildInfo(ISDKBuildInfo buildInfo, String builderId) { + buildInfoMap.put(builderId, buildInfo); + } + + @SuppressWarnings("unchecked") + private void setSupportFeatures() { + scanForWINSCW_UREL(); + if (isEKA2()) { + sdkFeatures.add(ISymbianSDKFeatures.IS_EKA2); + } + else { + sdkFeatures.add(ISymbianSDKFeatures.IS_EKA1); + } + } + + @SuppressWarnings("unchecked") + public void addSupportedFeature(Object feature) { + sdkFeatures.add(feature); + } + } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/processes/CheckS60CustKitSupport.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/processes/CheckS60CustKitSupport.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/processes/CheckS60CustKitSupport.java Mon Jun 07 20:50:55 2010 -0500 @@ -21,9 +21,11 @@ import org.eclipse.core.runtime.Plugin; import org.osgi.framework.Version; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.api.sdk.Messages; import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; import com.nokia.carbide.template.engine.ITemplate; @@ -173,12 +175,13 @@ ISymbianSDK sdk = symbianBuildContext.getSDK(); if (sdk != null) { File middleWareInclude = new File(sdk.getEPOCROOT(), S60_MIDDWARE_INC); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); // NOTE: Here we need to check the SDK major version becuase // the 3.2 CustKit // has the middleware folder but doesn't use the new build // macros for include paths - if (sdk.getSDKVersion().getMajor() >= 5 && middleWareInclude.exists()) { + if (sbsv1BuildInfo != null && sbsv1BuildInfo.getSDKVersion(sdk).getMajor() >= 5 && middleWareInclude.exists()) { // add symbol as at least one build config is a CustKit S60_50_Macros_String = S60_INC_MACROS; break; @@ -187,7 +190,7 @@ middleWareInclude = new File(sdk.getEPOCROOT(), S60_MIDDWARE_INC2); File sfoPath = new File(sdk.getEPOCROOT(), S60_SF_FOLDER); // check for middleware paths and /sf path (if SFO kit) - if (sdk.getSDKVersion().getMajor() >= 5 && middleWareInclude.exists() && sfoPath.exists()) { + if (sbsv1BuildInfo != null && sbsv1BuildInfo.getSDKVersion(sdk).getMajor() >= 5 && middleWareInclude.exists() && sfoPath.exists()) { // add symbol as at least one build config is a CustKit S60_50_Macros_String = S60_INC_MACROS_SF; break; @@ -195,7 +198,7 @@ // try newer middleware paths moved to app layer includes - if (sdk.getSDKVersion().getMajor() >= 5 && middleWareInclude.exists()) { + if (sbsv1BuildInfo != null && sbsv1BuildInfo.getSDKVersion(sdk).getMajor() >= 5 && middleWareInclude.exists()) { // add symbol as at least one build config is a CustKit File domainPath = new File(sdk.getEPOCROOT(), S60_DOMAND_OSTEXT_PLAT_PATHS); if (domainPath.exists()){ diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/scripting/SymbianSDKs.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/scripting/SymbianSDKs.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/scripting/SymbianSDKs.java Mon Jun 07 20:50:55 2010 -0500 @@ -21,7 +21,9 @@ import java.util.List; import java.util.Map; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.sdk.core.ISDKManager; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; @@ -39,10 +41,13 @@ ArrayList> sdkMapArray = new ArrayList>(); List sdkList = getSDKManager().getSDKList(); for (ISymbianSDK sdk : sdkList){ + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); Map mp = new HashMap(); mp.put(KEY_SDK_ID, sdk.getUniqueId()); - mp.put(KEY_SDK_NAME, sdk.getName()); mp.put(KEY_SDK_EPOCROOT, sdk.getEPOCROOT()); + if (sbsv1BuildInfo != null) { + mp.put(KEY_SDK_NAME, sbsv1BuildInfo.getName(sdk)); + } sdkMapArray.add(mp); } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/xml/DevicesLoader.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/xml/DevicesLoader.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/xml/DevicesLoader.java Mon Jun 07 20:50:55 2010 -0500 @@ -21,12 +21,14 @@ import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.Resource; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DefaultType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DeviceType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DevicesFactory; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DevicesType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DocumentRoot; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.util.DevicesResourceFactoryImpl; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; public class DevicesLoader { @@ -104,6 +106,7 @@ DocumentRoot root = (DocumentRoot) contents.get(0); DevicesType devices = root.getDevices(); EList devicesList = devices.getDevice(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); // Find the device entry we are updating boolean deviceExists = false; @@ -113,7 +116,9 @@ deviceExists = true; currDevice.setEpocroot(sdk.getEPOCROOT()); currDevice.setId(sdk.getUniqueId()); - currDevice.setName(sdk.getName()); + if (sbsv1BuildInfo != null) { + currDevice.setName(sbsv1BuildInfo.getName(sdk)); + } if (currDevice.getUserdeletetable() != null){ currDevice.setUserdeletable(currDevice.getUserdeletetable()); } @@ -132,11 +137,13 @@ DeviceType newDeviceEntry = DevicesFactory.eINSTANCE.createDeviceType(); newDeviceEntry.setId(sdk.getUniqueId()); newDeviceEntry.setEpocroot(sdk.getEPOCROOT()); - newDeviceEntry.setName(sdk.getName()); - if (sdk.isDefaultSDK() == true){ - newDeviceEntry.setDefault(DefaultType.YES_LITERAL); - } else { - newDeviceEntry.setDefault(DefaultType.NO_LITERAL); + if (sbsv1BuildInfo != null) { + newDeviceEntry.setName(sbsv1BuildInfo.getName(sdk)); + if (sbsv1BuildInfo.isDefaultSDK(sdk) == true){ + newDeviceEntry.setDefault(DefaultType.YES_LITERAL); + } else { + newDeviceEntry.setDefault(DefaultType.NO_LITERAL); + } } newDeviceEntry.setUserdeletable("no"); newDeviceEntry.setUserdeletetable(null); // just to be sure it doens't get written out @@ -167,18 +174,19 @@ DocumentRoot root = (DocumentRoot) contents.get(0); DevicesType devices = root.getDevices(); EList devicesList = devices.getDevice(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); // Iterate all the devices and set the all to default=false // Set the input sdk paramater's default to whatever it's default value is for (Iterator i = devicesList.iterator(); i.hasNext();) { DeviceType currDevice = (DeviceType)i.next(); if (currDevice.getId().equals(sdk.getUniqueId())){ - if (sdk.isDefaultSDK()){ + if (sbsv1BuildInfo != null && sbsv1BuildInfo.isDefaultSDK(sdk)){ currDevice.setDefault(DefaultType.YES_LITERAL); } else { currDevice.setDefault(DefaultType.NO_LITERAL); } - }else { + } else { currDevice.setDefault(DefaultType.NO_LITERAL); } } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISDKBuildInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISDKBuildInfo.java Mon Jun 07 20:50:55 2010 -0500 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +*/ + +package com.nokia.carbide.cpp.sdk.core; + +import java.util.List; + +/** + * Interface for build related information of a Symbian SDK. + * + */ +public interface ISDKBuildInfo { + + /** + * Returns platform-filtered build configurations for a Symbian SDK. + * @param sdk Symbian SDK + * @return list of ISymbianBuildContext + */ + List getFilteredBuildConfigurations(ISymbianSDK sdk); + + /** + * Returns all available build configurations for a Symbian SDK. + * @param sdk Symbian SDK + * @return list of ISymbianBuildContext + */ + List getAllBuildConfigurations(ISymbianSDK sdk); + +} diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianBuilderID.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianBuilderID.java Mon Jun 07 20:50:55 2010 -0500 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +*/ + +package com.nokia.carbide.cpp.sdk.core; + +/** + * A collection of Symbian builder IDs. + * + */ +public interface ISymbianBuilderID { + + public static final String SBSV1_BUILDER = "SBSv1Builder"; + public static final String SBSV2_BUILDER = "SBSv2Builder"; + +} diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java Mon Jun 07 20:50:55 2010 -0500 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -12,14 +12,9 @@ */ package com.nokia.carbide.cpp.sdk.core; -import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine; +import java.util.List; +import java.util.Set; -import java.io.File; -import java.net.URL; -import java.util.Date; -import java.util.List; - -import org.eclipse.core.runtime.IPath; import org.osgi.framework.Version; /** @@ -35,32 +30,20 @@ public interface ISymbianSDK { - /** Branch identifier to note Beech branch, OS 8.1a and prior */ - public static final String EKA1_A_BRANCH_IDENTIFIER = "a"; - /** Branch identifier to note S branch, OS 7.0x */ - public static final String EKA1_S_BRANCH_IDENTIFIER = "s"; - /** Branch identifier to note Cedar branch, OS 8.0b and later (not used for OS 9.x and greater) */ - public static final String EKA2_B_BRANCH_IDENTIFIER = "b"; + /** + * Returns build info for a particular builder. + * @param builderId id string of a builder + * @return build info + */ + ISDKBuildInfo getBuildInfo(String builderId); - // Family Ids don't include the vendor - public static final String SERIES60_FAMILY_ID = "series60"; //deprecated - public static final String S60_FAMILY_ID = "s60"; - public static final String S80_FAMILY_ID = "Series80"; - public static final String UIQ_FAMILY_ID = "UIQ"; - public static final String TECHVIEW_FAMILY_ID = "TechView"; - public static final String SYMBIAN_FOUNDATION_FAMILY_ID = "symbian"; // Symbian Foundation, starting with Symbian^3 - - // Unique Ids include the vendor - public static final String SERIES60_SDK_NAME = "com.nokia." + SERIES60_FAMILY_ID; - public static final String S60_SDK_NAME = "com.nokia." + S60_FAMILY_ID; - public static final String NOKIA_SF_SDK_NAME = "com.nokia." + SYMBIAN_FOUNDATION_FAMILY_ID; // Nokia+Symbian Foundation SDK - public static final String S80_SDK_NAME = "com.nokia." + S80_FAMILY_ID; - public static final String UIQ_SDK_NAME = "com.symbian." + UIQ_FAMILY_ID; - public static final String TECHVIEW_SDK_NAME = "com.symbian." + TECHVIEW_FAMILY_ID; - - public static final String PUBLISHER_NOKIA = "Nokia, Inc."; - public static final String PUBLISHER_UIQ = "UIQ Technology"; - public static final String PUBLISHER_SYMBIAN = "Symbian, Ltd."; + /** + * Returns a set of features supported by the SDK. + * Feature IDs are defined in ISymbianSDKFeatures. + * @return set of features + */ + @SuppressWarnings("rawtypes") + Set getSupportedFeatures(); /** * Returns true if the SDK is configured properly, false otherwise. @@ -78,7 +61,7 @@ * @see #isValid() */ List validationErrors(); - + /** * Returns true if the SDK is enabled, false otherwise. * @@ -88,219 +71,34 @@ boolean isEnabled(); /** - * Marks the SDK as enabled or disabled - * - * @param enable whether to enable or disable the SDK - */ - void setEnabled(boolean enable); - - /** - * Returns the list of all platform macros for this SDK. - *

- * This is somewhat equivalent to calling "bldmake plat" on the command line - * These are the macros that can be used in MMP and INF files. They are only given by name (no value) - *

- * @param platform the platform name - * @return a list of macros, which may be empty. - */ - List getPlatformMacros(String platform); - - - /** - * Returns the list of all vendor specific C/C++ macros for this SDK. The list of macros is defined in - * the variant configuration file inside \epoc32\tools\variant.cfg (or \epoc32\tools\spp_variant.cfg - * for platform variation SDKs). The file itself contains an HRH file entry and may also contain macro definitions - * thereafter. - *

- * Macros follow the form of a #define statement, excluding the "#define", e.g.:
- * "FOO", "BAR=1", "_INCLUDE_=\"\\mydir\\prefix.hrh\\\"", "INCLUDE(x)=\epoc32\include\##x" - *

- * - * @return a list of macros which may be empty. - * @deprecated use #getProjectVariantHRHDefines() which returns a list of IDefine instead. - */ - List getProjectVariantHRHMacros(); - - - /** - * Returns the list of all vendor specific C/C++ macros for this SDK. The list of macros is defined in - * the variant configuration file inside \epoc32\tools\variant.cfg (or \epoc32\tools\spp_variant.cfg - * for platform variation SDKs). The file itself contains an HRH file entry and may also contain macro definitions - * thereafter. - * @return a list of macros which may be empty. - * @deprecated use {@link ISymbianBuildContext#getVariantHRHDefines()} instead. This was moved because the include paths - * in which to find any header files included from the main .hrh file may be build configuration specific. - */ - List getProjectVariantHRHDefines(); - - /** * Returns a list of the macros defined in the variant.cfg file. This is NOT the macros * in the HRH file, but the actual maros written to the variant.cfg file. * @return A String list of macros found as is, or an empty list if none. */ List getVariantCFGMacros(); - - /** - * Get a list of macros that are used to distinguish this SDK. Typically only - * S603rd edition SDKs contain this information and it's used to differentiate between - * varios S60 SDK releases. Other vendors, such as UIQ may put their macros in the variant HRH file. - * @return A list of macros just returned by name. - */ - public List getVendorSDKMacros(); - - /** - * Returns the list of all available platforms for this SDK. - * - * @return a list of platform names which may be empty. - */ - List getAvailablePlatforms(); - - /** - * Returns the filtered list of build configurations for this SDK. - *

- * Build configs to display can be filtered by the user using the SBSv1 or SBSv2 - * panes of the Platform Filtering Preferences global preference page. - *

- * If SBSv1 building is supported, the platforms are filtered with SBSv1 preferences. - * If SBSv2 building but not SBSv1 is supported, the platforms are filtered with SBSv2 preferences. - * If both builders are supported, SBSv1 preferences are used. - *

- * - * @return a list build configuration names which may be empty. - */ - List getFilteredBuildConfigurations(); - - /** - * Returns the unfiltered list of build configurations for this SDK. - * - * @return a list build configuration names which may be empty. - */ - List getUnfilteredBuildConfigurations(); /** * Returns the unique id of this SDK. This is the devices.xml 'id' attribute. * - * @return the id string of this sdk. + * @return the id string of this SDK. */ String getUniqueId(); /** - * Returns the display name of this SDK. This is the com.vendor.family identifier. - * - * @return the name of this sdk. - */ - String getName(); - - /** - * Returns the vendor name of this SDK. This is parsed from the 'name' attribute from devices.xml. - * - * @return the vendor name of this sdk. - */ - String getVendor(); - - /** - * Returns the family name of this SDK. This is parsed from the 'vendor' attribute from devices.xml. - * - * @return the family name of this sdk. - */ - String getFamily(); - - /** * Returns the absolute path to the epoc32 directory of this SDK. This method is guaranteed to * return the path with a trailing File.separator. * * @return the absolute path to the epoc32 directory. */ String getEPOCROOT(); - - /** - * Returns whether or not this is the default SDK in the devices.xml file. - * - * @return true if the SDK is the default, and - * false otherwise - */ - boolean isDefaultSDK(); - + /** * Returns the OS version string of this SDK. * * @return the OS Version object. If the version cannot be determined it will be "0.0". */ Version getOSVersion(); - - /** - * Returns the SDK version string of this SDK. - * - * @return the SDK Version object. If the version cannot be determined it will be "0.0". - */ - Version getSDKVersion(); - - /** - * Returns the File object for the prefix file for this SDK. - * - * @return the File object for the prefix file, or - * null if there isn't one for this SDK. - */ - File getPrefixFile(); - - /** - * Returns an IPath for the epoc32\tools directory of this SDK. - * - * @return an IPath for the epoc32\tools directory, or null. - */ - IPath getToolsPath(); - - /** - * Returns an IPath for the epoc32\release directory of this SDK. - * - * @return an IPath for the epoc32\release directory, or null. - */ - IPath getReleaseRoot(); - - /** - * Returns an IPath for the epoc32\include directory of this SDK. - * - * @return an IPath for the epoc32\include directory, or null. - */ - IPath getIncludePath(); - - /** - * Get the human readable description of the SDK. - * @return The description string, empty string for none. - */ - String getSDKDescription(); - - /** - * Get the creation date of the manifest.xml - * @return a Date object - */ - Date getCreationDate(); - - /** - * Get the licese file location in the SDK. Comes from manifest.xml. - * @return File, full path to the license file. - */ - File getLicenseFile(); - - /** - * Get the branch qualifier for the OS. Typically "a" or "b" to denote the Beech and Cedar code branchs respectively. - * This is typically used to denote EKA1 from EKA2. - * @return the branch, or empty string if none. - */ - String getSDKOSBranch(); - - /** - * Get the HTTP location for the SDK publisher. Comes from manifest.xml. - * @return A (hopefully) valid URL. - */ - URL getPublisherURL(); - - /** - * Get the publisher name present in manifest.xml - * @return The name entry or empty string if not present. - */ - String getPublisherName(); - + /** * Get a list of supported targettypes listed by this SDK. This routine parses the * \epoc32\tools\trgttype.pm file to build it's list. @@ -309,80 +107,14 @@ List getSupportedTargetTypes(); /** - * Get a list of macros specific to the given target type, e.g. "__EXE__" or "__DLL__" - * @param targettype - * @return list of macro strings, may be empty + * Set the absolute path to the epoc32 directory of this SDK. + * @param epocRoot absolute path to the epoc32 directory */ - List getTargetTypeMacros(String targettype); - - @Deprecated - public boolean getRequiresRestart(); - void setLicenseFile(File licenseFile); - void setPrefixFile(IPath prefixFile); - void setOSVersion(Version osVer); - void setSDKVersion(Version sdkVers); - void setPublisherURL(URL pubURL); - void setCreateDate(Date createDate); - void setOSSDKBranch(String branch); - void setIsDefaultSDK(boolean isDefault); - void setSDKDescription(String descr); - void setPublisherName(String pubName); - - void setUniqueID(String id); void setEPOCROOT(String epocRoot); - void setName(String name); - - /** Tell if the SDK is EKA1 */ - boolean isEKA1(); - - /** Tell if the SDK is EKA2 */ - boolean isEKA2(); - - /** Tell if the SDK is Series60 */ - boolean isS60(); - - /** - * Get whether or not this SDK has WINSCW UREL binary support - * @return true if the SDK has the WINSCW/UREL folder with epoc.exe components. - */ - boolean supportsWINSCW_UREL(); - - /** - * Set the flag wheter or not this SDK has WINSCW UREL binary support - * @param isSuported - * @return - */ - void setSupportsWINSCW_UREL(boolean isSupported); /** * Scans/Rescans the SDK for info such as prefix file, variant macros, manifest.xml, etc. */ void scanSDK(); - /** - * Get the BSF catalog for the SDK. - */ - IBSFCatalog getBSFCatalog(); - - /** - * Get the Symbian Binary Variation (SBV) catalog for the SDK. - * @since 2.0 - */ - ISBVCatalog getSBVCatalog(); - - /** - * Tells whether or not the plug-in installer has sniffed this SDK for eclipse plug-ins to install. - * @return true if the SDK was scanned. - * @since 2.0 - */ - boolean isPreviouslyScanned(); - - /** - * Set flag to tell whether or not the SDK was scanned for eclipse plugins to install. - * @param wasScanned was the SDK scanned for plugins? - * @since 2.0 - */ - void setPreviouslyScanned(boolean wasScanned); - - } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDKFeatures.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDKFeatures.java Mon Jun 07 20:50:55 2010 -0500 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +*/ + +package com.nokia.carbide.cpp.sdk.core; + +/** + * A collection of Symbian SDK feature IDs. + * + */ +public interface ISymbianSDKFeatures { + + public static final String IS_QT_INSTALLED = "isQtInstalled"; + public static final String IS_AVKON_SUPPORTED = "isAvkonSupported"; + public static final String IS_WINSCW_UREL_SUPPORTED = "isWINSCWURELSupported"; + public static final String IS_EKA1 = "isEAK1"; + public static final String IS_EKA2 = "isEKA2"; + +} diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/SymbianSDKFactory.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/SymbianSDKFactory.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/SymbianSDKFactory.java Mon Jun 07 20:50:55 2010 -0500 @@ -14,6 +14,7 @@ import org.osgi.framework.Version; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DefaultType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DeviceType; import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DevicesFactory; @@ -54,17 +55,21 @@ } SymbianSDK sdk = new SymbianSDK(newDeviceEntry); // create SDK and set the attribs found in devices.xml - // Set other essential paramaters not in devices.xml - - if (sdk.getOSVersion().getMajor() != 0){ + // Set other essential parameters not in devices.xml + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sdk.getOSVersion().getMajor() != 0) { // use the version detected from the SDK creation } else { sdk.setOSVersion(osVersion); - sdk.setOSSDKBranch(osBranch); + if (sbsv1BuildInfo != null) { + sbsv1BuildInfo.setOSSDKBranch(sdk, osBranch); + } } - if (sdk.getSDKVersion().getMajor() == 0){ - sdk.setSDKVersion(sdkVersion); + if (sbsv1BuildInfo != null) { + if (sbsv1BuildInfo.getSDKVersion(sdk).getMajor() == 0){ + sbsv1BuildInfo.setSDKVersion(sdk, sdkVersion); + } } return sdk; diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/TemplateUtils.java --- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/TemplateUtils.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/TemplateUtils.java Mon Jun 07 20:50:55 2010 -0500 @@ -23,6 +23,8 @@ import org.osgi.framework.Version; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; import com.nokia.carbide.template.engine.ITemplate; @@ -49,8 +51,9 @@ * versionRange is a minVersion and maxVersion delimited by - */ public static boolean sdkMatchesTemplate(ISymbianSDK symbianSDK, ITemplate template) { - Version sdkVersion = symbianSDK.getSDKVersion(); - String family = symbianSDK.getFamily(); // S60, symbian... 3rd segment of devices.xml 'name' attrib + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)symbianSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + Version sdkVersion = sbsv1BuildInfo.getSDKVersion(symbianSDK); + String family = sbsv1BuildInfo.getFamily(symbianSDK); // S60, symbian... 3rd segment of devices.xml 'name' attrib return sdkMatchesTemplate(sdkVersion, family, template); } @@ -59,10 +62,10 @@ if (f1.equalsIgnoreCase(f2)) return true; - if ((f1.equalsIgnoreCase(ISymbianSDK.S60_FAMILY_ID) && - f2.equalsIgnoreCase(ISymbianSDK.SERIES60_FAMILY_ID)) || - (f2.equalsIgnoreCase(ISymbianSDK.S60_FAMILY_ID) && - f1.equalsIgnoreCase(ISymbianSDK.SERIES60_FAMILY_ID))) + if ((f1.equalsIgnoreCase(ISBSv1BuildInfo.S60_FAMILY_ID) && + f2.equalsIgnoreCase(ISBSv1BuildInfo.SERIES60_FAMILY_ID)) || + (f2.equalsIgnoreCase(ISBSv1BuildInfo.S60_FAMILY_ID) && + f1.equalsIgnoreCase(ISBSv1BuildInfo.SERIES60_FAMILY_ID))) return true; return false; diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java --- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java Mon Jun 07 20:50:55 2010 -0500 @@ -16,21 +16,25 @@ */ package com.nokia.carbide.cpp.internal.sdk.ui; -import com.nokia.carbide.cpp.internal.sdk.core.model.DynamicFeatureInstaller; -import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; -import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; -import com.nokia.carbide.cpp.sdk.ui.SDKUIPlugin; -import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; +import java.io.File; +import java.util.List; import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.*; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchWindow; -import java.io.File; -import java.util.List; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.sdk.core.model.DynamicFeatureInstaller; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; +import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; +import com.nokia.carbide.cpp.sdk.ui.SDKUIPlugin; +import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; @SuppressWarnings("restriction") public class NewPluginChecker { @@ -50,25 +54,26 @@ boolean installed = false; boolean oneSDKWasScanned = false; for (ISymbianSDK sdk : sdkList) { - - if (sdk.isPreviouslyScanned() == false) { - oneSDKWasScanned = true; - // XML was parsed, now try to run the feature installer - sdk.setPreviouslyScanned(true); - File featureDir = new File(sdk.getEPOCROOT() + SDK_FEATURE_SUBDIR); - try { - DynamicFeatureInstaller installer = new DynamicFeatureInstaller(featureDir, null); - if (installer.install()) { - installed = true; + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + if (sbsv1BuildInfo.isPreviouslyScanned(sdk) == false) { + oneSDKWasScanned = true; + // XML was parsed, now try to run the feature installer + sbsv1BuildInfo.setPreviouslyScanned(sdk, true); + File featureDir = new File(sdk.getEPOCROOT() + SDK_FEATURE_SUBDIR); + try { + DynamicFeatureInstaller installer = new DynamicFeatureInstaller(featureDir, null); + if (installer.install()) { + installed = true; + } + } catch (Exception e) { + // Boog 8383: We should fail silently, since this will not break anything and may SDKs will not have any documentation + // Otherwise, these errors will be logged every time this check is done (workspace is opened) + // Originally, this was used to install MBS build support, but now is only used for SDK documentation + // ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.PLUGIN_ID, IStatus.ERROR, "Unable to install plug-ins dynamically.", e)); } - } catch (Exception e) { - // Boog 8383: We should fail silently, since this will not break anything and may SDKs will not have any documentation - // Otherwise, these errors will be logged every time this check is done (workspace is opened) - // Originally, this was used to install MBS build support, but now is only used for SDK documentation - // ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.PLUGIN_ID, IStatus.ERROR, "Unable to install plug-ins dynamically.", e)); } } - } if (oneSDKWasScanned) { diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java --- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java Mon Jun 07 20:50:55 2010 -0500 @@ -69,6 +69,7 @@ import com.nokia.carbide.cpp.internal.api.sdk.SymbianBuildContextDataCache; import com.nokia.carbide.cpp.internal.sdk.core.model.SDKManager; +import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianSDK; import com.nokia.carbide.cpp.sdk.core.ISDKManager; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; @@ -137,7 +138,7 @@ } ISymbianSDK sdk = (ISymbianSDK) element; - sdk.setUniqueID(sdkID); + ((SymbianSDK)sdk).setUniqueId(sdkID); SDKCorePlugin.getSDKManager().updateSDK(sdk); getViewer().refresh(); } @@ -315,13 +316,13 @@ // Remember which SDK is enabled for (ISymbianSDK sdk : sdkMgr.getSDKList()){ - sdk.setEnabled(false); + ((SymbianSDK)sdk).setEnabled(false); } Object[] sdkObjects = sdkListTableViewer.getCheckedElements(); for (Object currObj : sdkObjects){ if (currObj instanceof ISymbianSDK){ ISymbianSDK sdk = (ISymbianSDK)currObj; - sdk.setEnabled(true); + ((SymbianSDK)sdk).setEnabled(true); } } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPropertiesDialog.java --- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPropertiesDialog.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPropertiesDialog.java Mon Jun 07 20:50:55 2010 -0500 @@ -29,7 +29,6 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; -import org.eclipse.swt.widgets.Text; import org.eclipse.ui.PlatformUI; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; @@ -89,7 +88,7 @@ // OS Version at Row 1. TableItem itemOSVersion = new TableItem(propsTable, SWT.NONE); itemOSVersion.setText(new String[] {Messages.getString("SDKPropertiesDialog.OS_Version"), //$NON-NLS-2$ - sdk.getOSVersion().toString() + sdk.getSDKOSBranch()}); //$NON-NLS-1$ + sdk.getOSVersion().toString()}); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, SDKUIHelpIds.SDK_PROPERTIES_DIALOG); diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/AddSDKDialog.java --- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/AddSDKDialog.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/AddSDKDialog.java Mon Jun 07 20:50:55 2010 -0500 @@ -40,8 +40,11 @@ import org.eclipse.ui.PlatformUI; import org.osgi.framework.Version; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianSDK; import com.nokia.carbide.cpp.internal.sdk.ui.Messages; import com.nokia.carbide.cpp.internal.sdk.ui.SDKUIHelpIds; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; import com.nokia.carbide.cpp.sdk.core.SymbianSDKFactory; @@ -178,7 +181,7 @@ } // No objections raised, write the new device entry - String vendorName = ISymbianSDK.S60_SDK_NAME; + String vendorName = ISBSv1BuildInfo.S60_SDK_NAME; Version osVersion = new Version("9.4.0"); //$NON-NLS-1$ String osBranch = ""; //$NON-NLS-1$ Version sdkVersion = new Version("0.0"); //$NON-NLS-1$ @@ -189,13 +192,16 @@ osBranch, sdkVersion, false); - sdk.setEnabled(true); + ((SymbianSDK)sdk).setEnabled(true); SDKCorePlugin.getSDKManager().addSDK(sdk); List sdkList = SDKCorePlugin.getSDKManager().getSDKList(); if (sdkList != null){ sdkList.add(sdk); } - sdk.setIsDefaultSDK(false); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + sbsv1BuildInfo.setIsDefaultSDK(sdk, false); + } super.okPressed(); } diff -r 1a693b01d107 -r 79471fd1fd69 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java --- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java Fri Jun 04 16:34:02 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java Mon Jun 07 20:50:55 2010 -0500 @@ -27,6 +27,7 @@ import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils; import com.nokia.carbide.cpp.sdk.core.ISDKManager; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; @@ -52,7 +53,9 @@ public BuildTargetTreeNode(ISymbianSDK value, boolean sbsv2Project) { super(value); - List configurations = sbsv2Project ? SBSv2Utils.getFilteredSBSv2BuildContexts(value) : value.getFilteredBuildConfigurations(); + List configurations = sbsv2Project ? + SBSv2Utils.getFilteredSBSv2BuildContexts(value) : + value.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getFilteredBuildConfigurations(value); TreeNode[] children = new TreeNode[configurations.size()]; int index = 0; diff -r 1a693b01d107 -r 79471fd1fd69 project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/TestsPlugin.java --- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/TestsPlugin.java Fri Jun 04 16:34:02 2010 -0500 +++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/TestsPlugin.java Mon Jun 07 20:50:55 2010 -0500 @@ -16,6 +16,8 @@ */ package com.nokia.carbide.cpp.epoc.engine.tests; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; import com.nokia.carbide.cpp.sdk.core.*; import org.eclipse.core.runtime.Plugin; @@ -68,9 +70,19 @@ */ public static List getUsableBuildConfigs() { for (ISymbianSDK sdk : SDKCorePlugin.getSDKManager().getSDKList()) { - List contexts = sdk.getUnfilteredBuildConfigurations(); - if (contexts.size() > 0) { - return contexts.subList(0, Math.min(contexts.size(), 8)); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + List contexts; + if (sbsv1BuildInfo != null) { + contexts = sbsv1BuildInfo.getAllBuildConfigurations(sdk); + if (contexts.size() > 0) { + return contexts.subList(0, Math.min(contexts.size(), 8)); + } + } else if (sbsv2BuildInfo != null) { + contexts = sbsv2BuildInfo.getAllBuildConfigurations(sdk); + if (contexts.size() > 0) { + return contexts.subList(0, Math.min(contexts.size(), 8)); + } } } TestCase.fail("No installed SDKs provide build configurations"); diff -r 1a693b01d107 -r 79471fd1fd69 project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/api/project/core/ProjectCorePluginUtility.java --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/api/project/core/ProjectCorePluginUtility.java Fri Jun 04 16:34:02 2010 -0500 +++ b/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/api/project/core/ProjectCorePluginUtility.java Mon Jun 07 20:50:55 2010 -0500 @@ -30,6 +30,7 @@ import com.nokia.carbide.cdt.builder.project.ISISBuilderInfo; import com.nokia.carbide.cdt.internal.api.builder.SISBuilderInfo2; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures; public class ProjectCorePluginUtility { @@ -94,7 +95,7 @@ if (pkgFilePath != null) { SISBuilderInfo2 sisInfo = new SISBuilderInfo2(projDes.getProject()); sisInfo.setPKGFile(pkgFilePath); - if (config.getSDK().isEKA2()) { + if (config.getSDK().getSupportedFeatures().contains(ISymbianSDKFeatures.IS_EKA2)) { // set to self signing sisInfo.setSigningType(ISISBuilderInfo.SELF_SIGN); } diff -r 1a693b01d107 -r 79471fd1fd69 project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/editors/images/MultiImageEditorContextBase.java --- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/editors/images/MultiImageEditorContextBase.java Fri Jun 04 16:34:02 2010 -0500 +++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/editors/images/MultiImageEditorContextBase.java Mon Jun 07 20:50:55 2010 -0500 @@ -52,6 +52,7 @@ import com.nokia.carbide.cpp.epoc.engine.model.IModel; import com.nokia.carbide.cpp.epoc.engine.model.IModelProvider; import com.nokia.carbide.cpp.epoc.engine.model.IView; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.project.ui.ProjectUIPlugin; import com.nokia.carbide.cpp.internal.project.ui.images.CarbideImageModelFactory; import com.nokia.carbide.cpp.internal.project.ui.images.IImageResolver; @@ -61,7 +62,9 @@ import com.nokia.carbide.cpp.internal.project.ui.images.providers.ThumbnailImageLabelProvider; import com.nokia.carbide.cpp.internal.ui.images.CachingImageLoader; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures; import com.nokia.carbide.cpp.ui.images.IImageLoader; import com.nokia.carbide.cpp.ui.images.IImageModel; import com.nokia.cpp.internal.api.utils.core.CacheMap; @@ -423,7 +426,7 @@ ISymbianBuildContext buildContext = getCarbideBuildConfiguration().getBuildContext(); ISymbianSDK sdk = buildContext != null ? buildContext.getSDK() : null; if (sdk != null) { - return sdk.isEKA2(); + return sdk.getSupportedFeatures().contains(ISymbianSDKFeatures.IS_EKA2); } return false; } @@ -436,7 +439,10 @@ ISymbianBuildContext buildContext = getCarbideBuildConfiguration().getBuildContext(); ISymbianSDK sdk = buildContext != null ? buildContext.getSDK() : null; if (sdk != null) { - return sdk.isS60(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + return sbsv1BuildInfo.isS60(sdk); + } } return false; diff -r 1a693b01d107 -r 79471fd1fd69 project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/images/CarbideImageModelFactory.java --- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/images/CarbideImageModelFactory.java Fri Jun 04 16:34:02 2010 -0500 +++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/images/CarbideImageModelFactory.java Mon Jun 07 20:50:55 2010 -0500 @@ -21,7 +21,9 @@ import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo; import com.nokia.carbide.cpp.epoc.engine.image.*; import com.nokia.carbide.cpp.epoc.engine.model.mmp.IMMPAIFInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.internal.ui.images.CachingImageLoader; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.ui.images.*; import com.nokia.cpp.internal.api.utils.core.ProjectUtils; @@ -287,20 +289,23 @@ List buildConfigurations = projectInfo.getBuildConfigurations(); for (ICarbideBuildConfiguration buildConfiguration : buildConfigurations) { ISymbianSDK sdk = buildConfiguration.getSDK(); - if (sdk.isS60()) { - Version version = sdk.getSDKVersion(); - if (version != null) { - if (version.compareTo(new Version(2, 8, 0)) >= 0) { - supportsSVG = true; - break; + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + if (sbsv1BuildInfo.isS60(sdk)) { + Version version = sbsv1BuildInfo.getSDKVersion(sdk); + if (version != null) { + if (version.compareTo(new Version(2, 8, 0)) >= 0) { + supportsSVG = true; + break; + } } + } + if (sbsv1BuildInfo.getFamily(sdk).equals(ISBSv1BuildInfo.UIQ_FAMILY_ID)) { + Version version = sbsv1BuildInfo.getSDKVersion(sdk); + supportsSVG |= version != null && version.compareTo(new Version(3, 1, 0)) >= 0; + if (supportsSVG) + break; } - } - if (sdk.getFamily().equals(ISymbianSDK.UIQ_FAMILY_ID)) { - Version version = sdk.getSDKVersion(); - supportsSVG |= version != null && version.compareTo(new Version(3, 1, 0)) >= 0; - if (supportsSVG) - break; } } return supportsSVG; @@ -318,9 +323,12 @@ List buildConfigurations = projectInfo.getBuildConfigurations(); for (ICarbideBuildConfiguration buildConfiguration : buildConfigurations) { ISymbianSDK sdk = buildConfiguration.getSDK(); - if (sdk.getFamily().equals(ISymbianSDK.UIQ_FAMILY_ID)) { - imageConverterFactory = new UIQImageConverterFactory(); - break; + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + if (sbsv1BuildInfo.getFamily(sdk).equals(ISBSv1BuildInfo.UIQ_FAMILY_ID)) { + imageConverterFactory = new UIQImageConverterFactory(); + break; + } } } } diff -r 1a693b01d107 -r 79471fd1fd69 project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ImporterBuildTargetsPage.java --- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ImporterBuildTargetsPage.java Fri Jun 04 16:34:02 2010 -0500 +++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ImporterBuildTargetsPage.java Mon Jun 07 20:50:55 2010 -0500 @@ -24,6 +24,9 @@ import org.eclipse.jface.viewers.TreeNode; import org.eclipse.swt.widgets.TreeItem; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; +import com.nokia.carbide.cpp.internal.sdk.core.model.BSFCatalog; import com.nokia.carbide.cpp.sdk.core.*; import com.nokia.carbide.cpp.sdk.ui.shared.BuildTargetsPage; @@ -67,7 +70,15 @@ for (int i=0; i 0){ + IBSFCatalog bsfCatalog = null; + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + if (sbsv1BuildInfo != null) { + bsfCatalog = sbsv1BuildInfo.getBSFCatalog(sdk); + } else if (sbsv2BuildInfo != null) { + bsfCatalog = sbsv2BuildInfo.getBSFCatalog(sdk); + } + if (sdkMgr.getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){ // Check and see if any of the configs in the SDK // match any configuration that has been selected before // for this SDK. @@ -121,7 +132,15 @@ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); for (ISymbianBuildContext currContext : selectedConfigs){ ISymbianSDK sdk = currContext.getSDK(); - if (sdk.getBSFCatalog().getVirtualVariantPlatforms().length > 0 || sdkMgr.getBSFScannerEnabled()){ + IBSFCatalog bsfCatalog = null; + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + if (sbsv1BuildInfo != null) { + bsfCatalog = sbsv1BuildInfo.getBSFCatalog(sdk); + } else if (sbsv2BuildInfo != null) { + bsfCatalog = sbsv2BuildInfo.getBSFCatalog(sdk); + } + if (sdkMgr.getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){ // this setting needs to be persisted. settingsNeedUpdate = true; selectedConfigsToSave.add(currContext); diff -r 1a693b01d107 -r 79471fd1fd69 project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/views/SPNViewContentProvider.java --- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/views/SPNViewContentProvider.java Fri Jun 04 16:34:02 2010 -0500 +++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/views/SPNViewContentProvider.java Mon Jun 07 20:50:55 2010 -0500 @@ -106,8 +106,11 @@ import com.nokia.carbide.cpp.epoc.engine.preprocessor.DefaultModelDocumentProvider; import com.nokia.carbide.cpp.epoc.engine.preprocessor.DefaultTranslationUnitProvider; import com.nokia.carbide.cpp.epoc.engine.preprocessor.IIncludeFileLocator; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; import com.nokia.carbide.cpp.internal.project.ui.ProjectUIPlugin; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.ui.CarbideUIPlugin; import com.nokia.carbide.cpp.ui.ICarbideSharedImages; @@ -1654,7 +1657,13 @@ if (buildConfig != null) { ISymbianSDK sdk = buildConfig.getSDK(); if (sdk != null) { - sdkEpoc32IncludeDir = sdk.getIncludePath(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + if (sbsv1BuildInfo != null) { + sdkEpoc32IncludeDir = sbsv1BuildInfo.getIncludePath(sdk); + } else if (sbsv2BuildInfo != null) { + sdkEpoc32IncludeDir = sbsv2BuildInfo.getIncludePath(sdk); + } } } } diff -r 1a693b01d107 -r 79471fd1fd69 project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/scripting/ImporterScritpingUtils.java --- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/scripting/ImporterScritpingUtils.java Fri Jun 04 16:34:02 2010 -0500 +++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/scripting/ImporterScritpingUtils.java Mon Jun 07 20:50:55 2010 -0500 @@ -11,8 +11,11 @@ import com.nokia.carbide.cdt.builder.EpocEngineHelper; import com.nokia.carbide.cpp.internal.api.sdk.BuildContextSBSv1; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; import com.nokia.carbide.cpp.internal.project.utils.BldInfImportWrapper; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; public class ImporterScritpingUtils { @@ -120,7 +123,15 @@ } } else { - selectedConfigs = sdk.getFilteredBuildConfigurations(); + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + if (sbsv1BuildInfo != null) { + selectedConfigs = sbsv1BuildInfo.getFilteredBuildConfigurations(sdk); + } else if (sbsv2BuildInfo != null) { + selectedConfigs = sbsv2BuildInfo.getFilteredBuildConfigurations(sdk); + } else { + selectedConfigs = new ArrayList(); + } } return selectedConfigs; } diff -r 1a693b01d107 -r 79471fd1fd69 qt/com.nokia.carbide.cpp.qt.core/src/com/nokia/carbide/cpp/internal/qt/core/QtFilter.java --- a/qt/com.nokia.carbide.cpp.qt.core/src/com/nokia/carbide/cpp/internal/qt/core/QtFilter.java Fri Jun 04 16:34:02 2010 -0500 +++ b/qt/com.nokia.carbide.cpp.qt.core/src/com/nokia/carbide/cpp/internal/qt/core/QtFilter.java Mon Jun 07 20:50:55 2010 -0500 @@ -18,20 +18,32 @@ import java.io.File; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; import org.eclipse.jface.viewers.IFilter; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; +import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; public abstract class QtFilter implements IFilter { protected File getLibFile(ISymbianBuildContext context) { - + ISymbianSDK sdk = context.getSDK(); + IPath releaseRoot; + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)context.getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + if (sbsv1BuildInfo != null) { + releaseRoot = sbsv1BuildInfo.getReleaseRoot(sdk); + } else { + releaseRoot = new Path(sdk.getEPOCROOT()).append("epoc32/release"); + } if (context.getPlatformString().equals(ISymbianBuildContext.EMULATOR_PLATFORM)) { - return context.getSDK().getReleaseRoot().append(context.getPlatformString()). + return releaseRoot.append(context.getPlatformString()). append(context.getTargetString()).append("QtCore.dll").toFile(); //$NON-NLS-1$ } else { // for non-emulator targets, check in the armv5/lib directory (ARMV5 and GCCE) - return context.getSDK().getReleaseRoot().append("armv5/lib/QtCore.lib").toFile(); //$NON-NLS-1$ + return releaseRoot.append("armv5/lib/QtCore.lib").toFile(); //$NON-NLS-1$ } } diff -r 1a693b01d107 -r 79471fd1fd69 qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/QtImporterBuildTargetsPage.java --- a/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/QtImporterBuildTargetsPage.java Fri Jun 04 16:34:02 2010 -0500 +++ b/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/QtImporterBuildTargetsPage.java Mon Jun 07 20:50:55 2010 -0500 @@ -21,8 +21,12 @@ import org.eclipse.jface.dialogs.IDialogSettings; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; +import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; +import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; import com.nokia.carbide.cpp.sdk.core.ISDKManager; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; +import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; @@ -59,7 +63,15 @@ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager(); for (ISymbianBuildContext currContext : selectedConfigs){ ISymbianSDK sdk = currContext.getSDK(); - if (sdk.getBSFCatalog().getVirtualVariantPlatforms().length > 0 || sdkMgr.getBSFScannerEnabled()){ + IBSFCatalog bsfCatalog = null; + ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); + ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); + if (sbsv1BuildInfo != null) { + bsfCatalog = sbsv1BuildInfo.getBSFCatalog(sdk); + } else if (sbsv2BuildInfo != null) { + bsfCatalog = sbsv2BuildInfo.getBSFCatalog(sdk); + } + if (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0 || sdkMgr.getBSFScannerEnabled()){ // this setting needs to be persisted. settingsNeedUpdate = true; selectedConfigsToSave.add(currContext);