More ISymbianSDK refactoring.
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/TestPlugin.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/TestPlugin.java Fri Jun 11 12:09:52 2010 -0500
@@ -79,7 +79,7 @@
*/
public static List<ISymbianBuildContext> getUsableBuildConfigs() {
for (ISymbianSDK sdk : SDKCorePlugin.getSDKManager().getSDKList()) {
- List<ISymbianBuildContext> contexts = sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations(sdk);
+ List<ISymbianBuildContext> contexts = sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations();
if (contexts.size() > 0) {
return contexts.subList(0, Math.min(contexts.size(), 8));
}
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/ErrorParserRegressionGenerator.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/ErrorParserRegressionGenerator.java Fri Jun 11 12:09:52 2010 -0500
@@ -61,7 +61,7 @@
// You need to set the proper default configuration so the correct set of error parsers is called
List<ISymbianSDK> sdkList = SDKCorePlugin.getSDKManager().getSDKList();
for (ISymbianSDK currSDK : sdkList){
- List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations(currSDK);
+ List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations();
for (ISymbianBuildContext context : contexts) {
if (context.getPlatformString().equals(PLATFORM_STRING)) {
contextList.add(context);
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/TestGcceErrorParser.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/TestGcceErrorParser.java Fri Jun 11 12:09:52 2010 -0500
@@ -57,7 +57,7 @@
// You need to set the proper default configuration so the correct set of error parsers is called
List<ISymbianSDK> sdkList = SDKCorePlugin.getSDKManager().getSDKList();
for (ISymbianSDK currSDK : sdkList){
- List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations(currSDK);
+ List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations();
for (ISymbianBuildContext context : contexts) {
if (context.getPlatformString().equals(ISymbianBuildContext.GCCE_PLATFORM)) {
contextList.add(context);
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/TestMakeErrorParser.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/TestMakeErrorParser.java Fri Jun 11 12:09:52 2010 -0500
@@ -58,7 +58,7 @@
// You need to set the proper default configuration so the correct set of error parsers is called
List<ISymbianSDK> sdkList = SDKCorePlugin.getSDKManager().getSDKList();
for (ISymbianSDK currSDK : sdkList){
- List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations(currSDK);
+ List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations();
for (ISymbianBuildContext context : contexts) {
if (context.getPlatformString().equals(ISymbianBuildContext.EMULATOR_PLATFORM)) {
contextList.add(context);
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/TestMakmakeErrorParser.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/TestMakmakeErrorParser.java Fri Jun 11 12:09:52 2010 -0500
@@ -55,7 +55,7 @@
// You need to set the proper default configuration so the correct set of error parsers is called
List<ISymbianSDK> sdkList = SDKCorePlugin.getSDKManager().getSDKList();
for (ISymbianSDK currSDK : sdkList){
- List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations(currSDK);
+ List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations();
for (ISymbianBuildContext context : contexts) {
if (context.getPlatformString().equals(ISymbianBuildContext.ARMV5_PLATFORM)) {
contextList.add(context);
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/TestRVCTErrorParser.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/TestRVCTErrorParser.java Fri Jun 11 12:09:52 2010 -0500
@@ -55,7 +55,7 @@
// You need to set the proper default configuration so the correct set of error parsers is called
List<ISymbianSDK> sdkList = SDKCorePlugin.getSDKManager().getSDKList();
for (ISymbianSDK currSDK : sdkList){
- List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations(currSDK);
+ List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations();
for (ISymbianBuildContext context : contexts) {
if (context.getPlatformString().equals(ISymbianBuildContext.ARMV5_PLATFORM)) {
contextList.add(context);
--- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/TestSBSv2ErrorParser.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/errorParsers/TestSBSv2ErrorParser.java Fri Jun 11 12:09:52 2010 -0500
@@ -55,7 +55,7 @@
// You need to set the proper default configuration so the correct set of error parsers is called
List<ISymbianSDK> sdkList = SDKCorePlugin.getSDKManager().getSDKList();
for (ISymbianSDK currSDK : sdkList){
- List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations(currSDK);
+ List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations();
for (ISymbianBuildContext context : contexts) {
if (context.getPlatformString().equals(ISymbianBuildContext.ARMV5_PLATFORM)) {
contextList.add(context);
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/DefaultViewConfiguration.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/DefaultViewConfiguration.java Fri Jun 11 12:09:52 2010 -0500
@@ -209,18 +209,18 @@
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())) {
+ for (String platMacro : sbsv2BuildInfo.getPlatformMacros(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())) {
+ for (String platMacro : sbsv1BuildInfo.getPlatformMacros(context.getPlatformString())) {
macros.add(DefineFactory.createDefine(platMacro.trim(), platMacro.trim()));
}
- for (String vendorMacro : sbsv1BuildInfo.getVendorSDKMacros(sdk)){
+ for (String vendorMacro : sbsv1BuildInfo.getVendorSDKMacros()){
macros.add(DefineFactory.createDefine(vendorMacro.trim(), vendorMacro.trim()));
}
}
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Fri Jun 11 12:09:52 2010 -0500
@@ -79,6 +79,7 @@
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.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;
@@ -402,16 +403,13 @@
&& new File(context.getSDK().getEPOCROOT()).exists()) {
defaultContext = context;
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)
+ if (context instanceof ISBSv2BuildContext){
+ if (sdk.getPrefixFile(ISymbianBuilderID.SBSV2_BUILDER) != null)
break;
- } else if (sbsv2BuildInfo != null) {
- if (sbsv2BuildInfo.getPrefixFile(sdk) != null)
+ } else {
+ if (sdk.getPrefixFile(ISymbianBuilderID.SBSV1_BUILDER) != null)
break;
}
-
}
}
final ISymbianBuildContext defaultContextToUse = defaultContext;
@@ -755,32 +753,38 @@
}
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());
+ String releasePlatform;
+ IPath path;
+ if (buildConfig.getBuildContext() instanceof ISBSv2BuildContext) {
+ ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
+ releasePlatform = sbsv2BuildInfo.getBSFCatalog().getReleasePlatform(buildConfig.getPlatformString());
+ path = sdk.getReleaseRoot().append(releasePlatform.toLowerCase()).append(buildConfig.getTargetString().toLowerCase());
+ } else {
+ ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
+ releasePlatform = sbsv1BuildInfo.getBSFCatalog().getReleasePlatform(buildConfig.getPlatformString());
+ path = sdk.getReleaseRoot().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;
- }
+ // 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();
}
+
+ exePath = targetPath.toOSString();
return exePath;
@@ -1100,15 +1104,7 @@
}
}
- 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$
+ IPath dataZDir = buildConfig.getSDK().getReleaseRoot().removeLastSegments(1).append("/data/z/"); //$NON-NLS-1$
// get the aifs
List<IMMPAIFInfo> aifs = mmpData.getAifs();
@@ -1211,15 +1207,7 @@
public Object run(IBldInfView view) {
EpocEnginePathHelper helper = new EpocEnginePathHelper(buildConfig);
- 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$
+ final String dataZDir = buildConfig.getSDK().getReleaseRoot().removeLastSegments(1).toOSString() + "\\data\\z\\"; //$NON-NLS-1$
for (IMakefileReference ref : view.getAllMakefileReferences()) {
final IPath workspaceRelativeMakefilePath = helper.convertToWorkspace(ref.getPath());
@@ -1804,14 +1792,7 @@
*/
public static IPath[] getLibDirectoriesForBuildContext(ISymbianBuildContext buildContext) {
ArrayList<IPath> dirList = new ArrayList<IPath>();
- ISymbianSDK sdk = buildContext.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 releaseRoot = buildContext.getSDK().getReleaseRoot();
String platformString = buildContext.getPlatformString();
boolean isDebug = ISymbianBuildContext.DEBUG_TARGET.equals(buildContext.getTargetString());
// TODO is this correct, what about ARMv6?
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/builder/CarbideCPPBuilder.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/builder/CarbideCPPBuilder.java Fri Jun 11 12:09:52 2010 -0500
@@ -76,14 +76,11 @@
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.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;
@@ -640,15 +637,7 @@
targetPath = "sys\\bin\\"; //$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$
+ String dataZDir = buildConfig.getSDK().getReleaseRoot().removeLastSegments(1).toOSString() + "\\Data\\z\\"; //$NON-NLS-1$
IPath rezPath = null;
List<EMMPLanguage> languages = null;
@@ -1378,15 +1367,7 @@
args.add(resolvedPKGPath.toOSString());
args.add(sisName);
- 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);
+ IPath makeSisPath = config.getSDK().getToolsPath().append(MAKESIS_EXE);
cmdLauncher.writeToConsole("\n***Invoking " + MAKESIS_EXE + " ....\n");
cmdLauncher.setErrorParserManager(pkgPath.removeLastSegments(1), getParserIdArray(ICarbideBuildConfiguration.ERROR_PARSERS_SIS_BUILDER));
@@ -1494,14 +1475,6 @@
}
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) {
@@ -1519,7 +1492,7 @@
cmdLauncher.writeToConsole("\n***Invoking makekeys....\n");
- IPath makekeys = toolsPath.append(MAKEKEYS_EXE);
+ IPath makekeys = config.getSDK().getToolsPath().append(MAKEKEYS_EXE);
List<String> makekeysArgList = new ArrayList<String>();
makekeysArgList.add("-cert");
makekeysArgList.add("-password");
@@ -1553,7 +1526,7 @@
// call signsis...
cmdLauncher.writeToConsole("\n***Invoking " + SIGNSIS_EXE + "....\n");
- IPath signsis = toolsPath.append(SIGNSIS_EXE);
+ IPath signsis = config.getSDK().getToolsPath().append(SIGNSIS_EXE);
List<String> signSISArgList = new ArrayList<String>();
@@ -1771,15 +1744,7 @@
cmdLauncher.writeToConsole("\n***Invoking " + MAKESIS_EXE + " for partial upgrade....\n");
cmdLauncher.setErrorParserManager(pkgPath.removeLastSegments(1), getParserIdArray(ICarbideBuildConfiguration.ERROR_PARSERS_SIS_BUILDER));
- 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);
+ IPath makeSisPath = config.getSDK().getToolsPath().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);
@@ -1830,15 +1795,7 @@
// call signsis...
cmdLauncher.writeToConsole("\n***Invoking " + SIGNSIS_EXE + " for partial upgrade....\n");
- 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);
+ IPath signsis = config.getSDK().getToolsPath().append(SIGNSIS_EXE);
List<String> signSISArgList = new ArrayList<String>();
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/CarbideConfigurationDataProvider.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/CarbideConfigurationDataProvider.java Fri Jun 11 12:09:52 2010 -0500
@@ -244,7 +244,7 @@
if (sdk != null){
return new BuildContextSBSv2(sdk, platform, target, buidAlias, displayString, configID);
} else {
- ISymbianSDK deadSDK = SymbianSDKFactory.createInstance(sdkID, "FIXME", "", new Version("0.0"), "", new Version("0.0"), false);
+ ISymbianSDK deadSDK = SymbianSDKFactory.createInstance(sdkID, "FIXME", "", new Version("0.0"), new Version("0.0"));
SDKCorePlugin.getSDKManager().addSDK(deadSDK);
return new BuildContextSBSv2(deadSDK, platform, target, buidAlias, displayString, configID);
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Fri Jun 11 12:09:52 2010 -0500
@@ -452,27 +452,18 @@
public IPath getTargetOutputDirectory() {
String releasePlatform = "";
ISymbianSDK sdk = getSDK();
- ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
if (context instanceof ISBSv1BuildContext){
ISBSv1BuildContext v1Context = (ISBSv1BuildContext)context;
- if (sbsv1BuildInfo != null) {
- releasePlatform = sbsv1BuildInfo.getBSFCatalog(sdk).getReleasePlatform(v1Context.getBasePlatformForVariation());
- }
- }
- if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(getCarbideProject().getProject())){
+ ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
+ releasePlatform = sbsv1BuildInfo.getBSFCatalog().getReleasePlatform(v1Context.getBasePlatformForVariation());
+ } else if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(getCarbideProject().getProject())){
// Test is this is an SBSv2 build binary variant (changes the output directory)
ISBSv2BuildConfigInfo sbsv2Info = getSBSv2BuildConfigInfo();
if ( sbsv2Info != null && SBSv2Utils.getVariantOutputDirModifier(sbsv2Info.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT)) != null && !releasePlatform.contains(".") ){
releasePlatform = releasePlatform + SBSv2Utils.getVariantOutputDirModifier(sbsv2Info.getSBSv2Setting(ISBSv2BuildConfigInfo.ATTRIB_SBSV2_VARIANT));
}
}
- 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());
+ return sdk.getReleaseRoot().append(releasePlatform.toLowerCase()).append(getTargetString().toLowerCase());
}
public boolean getRebuildNeeded() {
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Fri Jun 11 12:09:52 2010 -0500
@@ -54,7 +54,9 @@
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.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;
@@ -196,18 +198,19 @@
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);
+ ISymbianBuildContext context = carbideBuildConfig.getBuildContext();
// add platform includes first
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 (context instanceof ISBSv1BuildContext) {
+ ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
+ platform = sbsv1BuildInfo.getBSFCatalog().findPlatform(carbideBuildConfig.getPlatformString());
+ sbvPlat = sbsv1BuildInfo.getSBVCatalog().findPlatform(carbideBuildConfig.getPlatformString());
+ } else {
+ ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
+ platform = sbsv2BuildInfo.getBSFCatalog().findPlatform(carbideBuildConfig.getPlatformString());
+ sbvPlat = sbsv2BuildInfo.getSBVCatalog().findPlatform(carbideBuildConfig.getPlatformString());
}
if (platform != null) {
IPath[] systemIncludePaths = platform.getSystemIncludePaths();
@@ -255,15 +258,7 @@
}
// add OEM dir
- 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();
+ File oemDir = sdk.getIncludePath().append("oem").toFile();
if (oemDir.exists()) {
includeEntries.add(new CIncludePathEntry(new Path(oemDir.getAbsolutePath()), 0));
}
@@ -276,19 +271,21 @@
Map<String, String> macros = new HashMap<String, String>();
// platform macros
- if (sbsv1BuildInfo != null) {
+ if (context instanceof ISBSv1BuildContext) {
+ ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
// platform macros
- for (String platMacro : sbsv1BuildInfo.getPlatformMacros(sdk, carbideBuildConfig.getPlatformString())) {
+ for (String platMacro : sbsv1BuildInfo.getPlatformMacros(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)) {
+ for (String builtinMacro : sbsv1BuildInfo.getVendorSDKMacros()) {
macros.put(builtinMacro, ""); //$NON-NLS-1$
}
- } else if (sbsv2BuildInfo != null) {
+ } else {
+ ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
// platform macros
- for (String platMacro : sbsv2BuildInfo.getPlatformMacros(sdk, carbideBuildConfig.getPlatformString())) {
+ for (String platMacro : sbsv2BuildInfo.getPlatformMacros(carbideBuildConfig.getPlatformString())) {
macros.put("__" + platMacro + "__", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -305,12 +302,14 @@
// 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) {
- if (sbsv1BuildInfo != null) {
- for (String targetTypeMacro : sbsv1BuildInfo.getTargetTypeMacros(sdk, targetTypes.get(0))) {
+ if (context instanceof ISBSv1BuildContext) {
+ ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
+ for (String targetTypeMacro : sbsv1BuildInfo.getTargetTypeMacros(targetTypes.get(0))) {
macros.put(targetTypeMacro, ""); //$NON-NLS-1$
}
- } else if (sbsv2BuildInfo != null) {
- for (String targetTypeMacro : sbsv2BuildInfo.getTargetTypeMacros(sdk, targetTypes.get(0))) {
+ } else {
+ ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
+ for (String targetTypeMacro : sbsv2BuildInfo.getTargetTypeMacros(targetTypes.get(0))) {
macros.put(targetTypeMacro, ""); //$NON-NLS-1$
}
}
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java Fri Jun 11 12:09:52 2010 -0500
@@ -142,7 +142,7 @@
ISymbianSDK sdk = buildConfig.getSDK();
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
if (sbsv1BuildInfo != null) {
- IBSFPlatform[] bsfPlatforms = sbsv1BuildInfo.getBSFCatalog(sdk).getAdditionalBuiltPlatforms(buildConfig.getPlatformString());
+ IBSFPlatform[] bsfPlatforms = sbsv1BuildInfo.getBSFCatalog().getAdditionalBuiltPlatforms(buildConfig.getPlatformString());
if (bsfPlatforms.length > 0) {
String plats = "";
for (IBSFPlatform plat : bsfPlatforms) {
@@ -661,15 +661,7 @@
}
}
- 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$
+ String dataZDir = buildConfig.getSDK().getReleaseRoot().removeLastSegments(1).toOSString() + "\\Data\\z\\"; //$NON-NLS-1$
IPath rezPath = null;
List<EMMPLanguage> languages = null;
@@ -763,13 +755,7 @@
// 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");
- }
+ IPath toolsPath = sdk.getToolsPath();
boolean updated = false;
try {
File mdFile = toolsPath.append("makdeps.pm").toFile();
@@ -2321,12 +2307,7 @@
}
// we need to check the variant hrh files as well
- ISymbianSDK sdk = config.getSDK();
- ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
- File prefixFile = null;
- if (sbsv1BuildInfo != null) {
- prefixFile = sbsv1BuildInfo.getPrefixFile(sdk);
- }
+ File prefixFile = config.getSDK().getPrefixFile(ISymbianBuilderID.SBSV1_BUILDER);
if (prefixFile != null && prefixFile.lastModified() > oldestMakefileTimestamp) {
return true;
}
@@ -2447,12 +2428,7 @@
final long makefileTimestamp = makefile.lastModified();
// we need to check the variant hrh files as well
- ISymbianSDK sdk = config.getSDK();
- ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
- File prefixFile = null;
- if (sbsv1BuildInfo != null) {
- prefixFile = sbsv1BuildInfo.getPrefixFile(sdk);
- }
+ File prefixFile = config.getSDK().getPrefixFile(ISymbianBuilderID.SBSV1_BUILDER);
if (prefixFile != null && prefixFile.lastModified() > makefileTimestamp) {
return true;
}
@@ -2535,12 +2511,7 @@
final long makefileTimestamp = makefile.lastModified();
// we need to check the variant hrh files as well
- ISymbianSDK sdk = config.getSDK();
- ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
- File prefixFile = null;
- if (sbsv1BuildInfo != null) {
- prefixFile = sbsv1BuildInfo.getPrefixFile(sdk);
- }
+ File prefixFile = config.getSDK().getPrefixFile(ISymbianBuilderID.SBSV1_BUILDER);
if (prefixFile != null && prefixFile.lastModified() > makefileTimestamp) {
return true;
}
@@ -2912,12 +2883,8 @@
// add the compiler prefix file if any
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);
- }
+ ISBVPlatform sbvPlatform = sbsv1BuildInfo.getSBVCatalog().findPlatform(config.getPlatformString());
+ File sdkPrefix = sdk.getPrefixFile(ISymbianBuilderID.SBSV1_BUILDER);
if (sbvPlatform != null){
// might be an alternate HRH file to use
@@ -2983,15 +2950,7 @@
// 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;
- 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()) {
+ if (config.getSDK().getToolsPath().removeLastSegments(1).append("gcc\\lib\\gcc-lib\\arm-epoc-pe\\3.0-psion-98r2").toFile().exists()) {
isGCC30 = true;
}
--- a/builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/PreprocessHandler.java Fri Jun 11 11:35:13 2010 -0500
+++ b/builder/com.nokia.carbide.cpp.builder.utils/src/com/nokia/carbide/cpp/internal/builder/utils/handlers/PreprocessHandler.java Fri Jun 11 12:09:52 2010 -0500
@@ -85,6 +85,7 @@
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.ISBSv1BuildContext;
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;
@@ -200,14 +201,11 @@
}
// add the sdk prefix file if any
- 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 (buildConfig.getBuildContext() instanceof ISBSv1BuildContext) {
+ sdkPrefix = buildConfig.getSDK().getPrefixFile(ISymbianBuilderID.SBSV1_BUILDER);
+ } else {
+ sdkPrefix = buildConfig.getSDK().getPrefixFile(ISymbianBuilderID.SBSV2_BUILDER);
}
if (sdkPrefix != null && sdkPrefix.exists()) {
args.add("-include"); //$NON-NLS-1$
@@ -416,17 +414,22 @@
private List<String> getMacros(ICarbideBuildConfiguration buildConfig, final IPath filePath, final IProgressMonitor monitor) {
final List<String> macros = new ArrayList<String>();
ISymbianSDK sdk = buildConfig.getSDK();
- ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
-
- if (sbsv1BuildInfo != null) {
+ if (buildConfig.getBuildContext() instanceof ISBSv1BuildContext) {
+ ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
// platform macros
- for (String platMacro : sbsv1BuildInfo.getPlatformMacros(sdk, buildConfig.getPlatformString())) {
+ for (String platMacro : sbsv1BuildInfo.getPlatformMacros(buildConfig.getPlatformString())) {
macros.add("__" + platMacro + "__"); //$NON-NLS-1$ //$NON-NLS-2$
}
// vendor macros (e.g. __SERIES60_3x__)
- for (String builtinMacro : sbsv1BuildInfo.getVendorSDKMacros(sdk)) {
+ for (String builtinMacro : sbsv1BuildInfo.getVendorSDKMacros()) {
macros.add(builtinMacro);
}
+ } else {
+ ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
+ // platform macros
+ for (String platMacro : sbsv2BuildInfo.getPlatformMacros(buildConfig.getPlatformString())) {
+ macros.add("__" + platMacro + "__"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
// built in macros
--- a/core/com.nokia.carbide.cpp.codescanner/src/com/nokia/carbide/cpp/internal/codescanner/kb/CSKbManager.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.codescanner/src/com/nokia/carbide/cpp/internal/codescanner/kb/CSKbManager.java Fri Jun 11 12:09:52 2010 -0500
@@ -394,12 +394,8 @@
List<ICarbideBuildConfiguration> buildConfigList = projectInfo.getBuildConfigurations();
for (Iterator<ICarbideBuildConfiguration> iterator = buildConfigList.iterator(); iterator.hasNext();) {
ICarbideBuildConfiguration buildConfig = iterator.next();
- ISymbianSDK sdk = buildConfig.getSDK();
- ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
- if (sbsv1BuildInfo != null) {
- Version version = sbsv1BuildInfo.getSDKVersion(sdk);
- sdkVersions.add(version);
- }
+ Version version = buildConfig.getSDK().getSDKVersion();
+ sdkVersions.add(version);
}
}
--- a/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/DevicesLoaderTest.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/DevicesLoaderTest.java Fri Jun 11 12:09:52 2010 -0500
@@ -16,6 +16,11 @@
*/
package com.nokia.carbide.cpp.sdk.core.test;
+import java.util.Iterator;
+
+import org.eclipse.emf.common.util.EList;
+import org.osgi.framework.Version;
+
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;
@@ -25,11 +30,6 @@
import com.nokia.cpp.internal.api.utils.core.FileUtils;
import com.nokia.cpp.internal.api.utils.core.HostOS;
-import org.eclipse.emf.common.util.EList;
-import org.osgi.framework.Version;
-
-import java.util.Iterator;
-
/**
* NOTE: this test expects all three methods to be run in order.
*
@@ -60,13 +60,13 @@
Version osVersion = new Version("9.1");
Version sdkVersion = new Version("3.0");
- ISymbianSDK sdk = SymbianSDKFactory.createInstance(S60_SDKID, M_DRIVE, ISBSv1BuildInfo.SERIES60_SDK_NAME, osVersion, "", sdkVersion, true);
+ ISymbianSDK sdk = SymbianSDKFactory.createInstance(S60_SDKID, M_DRIVE, ISBSv1BuildInfo.SERIES60_SDK_NAME, osVersion, sdkVersion);
DevicesLoader.updateDevice(sdk, devicesFile.toURI().toURL());
- sdk = SymbianSDKFactory.createInstance(TV_SDKID, P_DRIVE, ISBSv1BuildInfo.TECHVIEW_SDK_NAME, osVersion, "", sdkVersion, false);
+ sdk = SymbianSDKFactory.createInstance(TV_SDKID, P_DRIVE, ISBSv1BuildInfo.TECHVIEW_SDK_NAME, osVersion, sdkVersion);
DevicesLoader.updateDevice(sdk, devicesFile.toURI().toURL());
- sdk = SymbianSDKFactory.createInstance(UIQ3_SDKID, UIQ3_EPOCROOT, ISBSv1BuildInfo.UIQ_SDK_NAME, osVersion, "", sdkVersion, false);
+ sdk = SymbianSDKFactory.createInstance(UIQ3_SDKID, UIQ3_EPOCROOT, ISBSv1BuildInfo.UIQ_SDK_NAME, osVersion, sdkVersion);
DevicesLoader.updateDevice(sdk, devicesFile.toURI().toURL());
}
--- a/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SDKCreationTest.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SDKCreationTest.java Fri Jun 11 12:09:52 2010 -0500
@@ -53,22 +53,20 @@
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
// Test an SDK that exists and we know OS version
if (sdk.getUniqueId().equals("UIQ3")){
- List<String> platMacros = sdk.getPlatformMacros("WINSCW");
+ List<String> platMacros = sbsv1BuildInfo.getPlatformMacros("WINSCW");
assertTrue(platMacros != null);
assertEquals(3, platMacros.size());
- if (sbsv1BuildInfo != null) {
- assertTrue(sbsv1BuildInfo.getFilteredBuildConfigurations(sdk).size() > 0);
- }
+ assertTrue(sbsv1BuildInfo.getFilteredBuildConfigurations().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.getSDKVersion().getMajor() == 0);
+ assertTrue(sbsv1BuildInfo.getAvailablePlatforms().size() == 0);
+ assertTrue(sbsv1BuildInfo.getFilteredBuildConfigurations().size() == 0);
}
assertTrue(sdk.getOSVersion().getMajor() == 0);
- assertTrue(sdk.getPlatformMacros("WINSCW").size() == 0);
+ assertTrue(sbsv1BuildInfo.getPlatformMacros("WINSCW").size() == 0);
assertTrue(sdk.getSupportedTargetTypes().size() == 0);
File epocRoot = new File(sdk.getEPOCROOT());
assertTrue(epocRoot.exists() == false);
--- a/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SymbianContextTest.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SymbianContextTest.java Fri Jun 11 12:09:52 2010 -0500
@@ -61,9 +61,9 @@
*/
private void doTestSDK(ISymbianSDK sdk) {
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
- if (sbsv1BuildInfo != null && sbsv1BuildInfo.getName(sdk).equals("S60_5th_Edition_SDK_v1.0")) {
+ if (sdk.getName().equals("S60_5th_Edition_SDK_v1.0")) {
// test that we get the SDK version
- Version sdkVer = sbsv1BuildInfo.getSDKVersion(sdk);
+ Version sdkVer = sdk.getSDKVersion();
assertEquals(5,sdkVer.getMajor());
assertEquals(0,sdkVer.getMinor());
@@ -82,7 +82,7 @@
// test that we can get the macros for valid SDKs
// (if the default of 0.0, then we never fetch macros)
if (sbsv1BuildInfo != null && sdk.getOSVersion().compareTo(new Version(0, 0, 0)) > 0) {
- List<String> platMacros = sbsv1BuildInfo.getPlatformMacros(contextSDK, "WINSCW");
+ List<String> platMacros = sbsv1BuildInfo.getPlatformMacros("WINSCW");
if (platMacros.size() == 0)
fail("WINSCW platform macros should be > 0");
}
--- a/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/TestDevicesXMLListener.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/TestDevicesXMLListener.java Fri Jun 11 12:09:52 2010 -0500
@@ -28,6 +28,7 @@
import com.nokia.carbide.cpp.internal.api.sdk.ICarbideDevicesXMLChangeListener;
import com.nokia.carbide.cpp.internal.api.sdk.ISDKManagerInternal;
import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
+import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianSDK;
import com.nokia.carbide.cpp.sdk.core.*;
/**
@@ -91,7 +92,7 @@
assertTrue("Devices.xml has changed only timestamp, bad return value", sdkMgr.checkDevicesXMLSynchronized());
ISymbianSDK sdk = sdkMgr.getSDKList().get(0);
- sdk.setEPOCROOT("K:\\");
+ ((SymbianSDK)sdk).setEPOCROOT("K:\\");
sdkMgr.updateSDK(sdk);
assertTrue("Devices.xml should still be true with sdk update via APIs", sdkMgr.checkDevicesXMLSynchronized());
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java Fri Jun 11 12:09:52 2010 -0500
@@ -213,7 +213,7 @@
private ISBSv1BuildInfo getBuildInfo() {
ISBSv1BuildInfo buildInfo = (ISBSv1BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
if (buildInfo == null) {
- buildInfo = new SBSv1BuildInfo();
+ buildInfo = new SBSv1BuildInfo(getSDK());
((SymbianSDK)getSDK()).setBuildInfo(buildInfo, ISymbianBuilderID.SBSV1_BUILDER);
}
return buildInfo;
@@ -225,7 +225,7 @@
String dirName = getDefFileDirectoryNameForPlatform(platform);
if (dirName == null) {
// check BSF's
- IBSFCatalog catalog = getBuildInfo().getBSFCatalog(getSDK());
+ IBSFCatalog catalog = getBuildInfo().getBSFCatalog();
if (catalog != null) {
for (IBSFPlatform plat : catalog.getPlatforms()) {
if (plat.getName().compareToIgnoreCase(platform) == 0) {
@@ -273,7 +273,7 @@
return getRVCTPrefixFilePath();
} else {
// check BSF's
- IBSFCatalog catalog = getBuildInfo().getBSFCatalog(getSDK());
+ IBSFCatalog catalog = getBuildInfo().getBSFCatalog();
if (catalog != null) {
for (IBSFPlatform plat : catalog.getPlatforms()) {
if (plat.getName().compareToIgnoreCase(platform) == 0) {
@@ -301,7 +301,7 @@
}
private IPath getIncludePath() {
- return getBuildInfo().getIncludePath(getSDK());
+ return getSDK().getIncludePath();
}
private IPath getGCCEPrefixFilePath() {
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java Fri Jun 11 12:09:52 2010 -0500
@@ -66,7 +66,7 @@
private ISBSv2BuildInfo getBuildInfo() {
ISBSv2BuildInfo buildInfo = (ISBSv2BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
if (buildInfo == null) {
- buildInfo = new SBSv2BuildInfo();
+ buildInfo = new SBSv2BuildInfo(getSDK());
((SymbianSDK)getSDK()).setBuildInfo(buildInfo, ISymbianBuilderID.SBSV2_BUILDER);
}
return buildInfo;
@@ -85,7 +85,7 @@
String dirName = getDefFileDirectoryNameForPlatform(platform);
if (dirName == null) {
// check BSF's
- IBSFCatalog catalog = getBuildInfo().getBSFCatalog(getSDK());
+ IBSFCatalog catalog = getBuildInfo().getBSFCatalog();
if (catalog != null) {
for (IBSFPlatform plat : catalog.getPlatforms()) {
if (plat.getName().compareToIgnoreCase(platform) == 0) {
@@ -136,7 +136,7 @@
return getRVCTPrefixFilePath();
} else {
// check BSF's
- IBSFCatalog catalog = getBuildInfo().getBSFCatalog(getSDK());
+ IBSFCatalog catalog = getBuildInfo().getBSFCatalog();
if (catalog != null) {
for (IBSFPlatform plat : catalog.getPlatforms()) {
if (plat.getName().compareToIgnoreCase(platform) == 0) {
@@ -164,7 +164,7 @@
}
private IPath getIncludePath() {
- return getBuildInfo().getIncludePath(getSDK());
+ return getSDK().getIncludePath();
}
private IPath getGCCEPrefixFilePath() {
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildInfo.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildInfo.java Fri Jun 11 12:09:52 2010 -0500
@@ -13,18 +13,11 @@
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.
@@ -32,13 +25,6 @@
*/
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";
@@ -59,188 +45,62 @@
public static final String PUBLISHER_UIQ = "UIQ Technology";
public static final String PUBLISHER_SYMBIAN = "Symbian, Ltd.";
+ void clearPlatformMacros();
+
+ /**
+ * Returns the list of all available platforms for a SDK.
+ * @return a list of platform names which may be empty.
+ */
+ List<String> getAvailablePlatforms();
+
+ /**
+ * Get the BSF catalog for a SDK.
+ */
+ IBSFCatalog getBSFCatalog();
+
/**
* Returns the list of all platform macros for a SDK.
* <p>
* 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)
* </p>
- * @param sdk Symbian SDK
* @param platform the platform name
* @return a list of macros, which may be empty.
*/
- List<String> getPlatformMacros(ISymbianSDK sdk, String platform);
+ List<String> getPlatformMacros(String platform);
+
+ /**
+ * Get the Symbian Binary Variation (SBV) catalog for a SDK.
+ */
+ ISBVCatalog getSBVCatalog();
+
+ /**
+ * 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
+ */
+ List<String> getTargetTypeMacros(String targettype);
/**
* 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<String> 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<String> 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
- * <code>null</code> 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 <code>null</code>.
- */
- 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 <code>null</code>.
- */
- 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 <code>null</code>.
- */
- IPath getIncludePath(ISymbianSDK sdk);
+ public List<String> getVendorSDKMacros();
/**
- * 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.
+ * 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
*/
- 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<String> 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 <code>true</code> if the SDK is the default, and
- * <code>false</code> otherwise
- */
- boolean isDefaultSDK(ISymbianSDK sdk);
+ boolean isPreviouslyScanned();
/**
* 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);
+ boolean isS60();
- 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);
+ void setPreviouslyScanned(boolean wasScanned);
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv2BuildInfo.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv2BuildInfo.java Fri Jun 11 12:09:52 2010 -0500
@@ -13,7 +13,6 @@
package com.nokia.carbide.cpp.internal.api.sdk;
-import java.io.File;
import java.util.List;
import org.eclipse.core.runtime.IPath;
@@ -21,7 +20,6 @@
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.
@@ -29,70 +27,49 @@
*/
public interface ISBSv2BuildInfo extends ISDKBuildInfo {
+ void clearPlatformMacros();
+
+ /**
+ * Get the BSF catalog for a SDK.
+ */
+ IBSFCatalog getBSFCatalog();
+
/**
* Returns the list of all platform macros for a SDK.
* <p>
* 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)
* </p>
- * @param sdk Symbian SDK
* @param platform the platform name
* @return a list of macros, which may be empty.
*/
- List<String> getPlatformMacros(ISymbianSDK sdk, String platform);
+ List<String> getPlatformMacros(String platform);
+
+ /**
+ * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
+ * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
+ */
+ public IPath getPrefixFromVariantCfg();
+
+ /**
+ * Get the Symbian Binary Variation (SBV) catalog for a SDK.
+ */
+ ISBVCatalog getSBVCatalog();
/**
* 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<String> 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<String> 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 <code>null</code>.
- */
- 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
- * <code>null</code> 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);
+ List<String> getTargetTypeMacros(String targettype);
/**
* 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);
+ boolean isPreviouslyScanned();
- void setPreviouslyScanned(ISymbianSDK sdk, boolean wasScanned);
- void setPrefixFile(ISymbianSDK sdk, IPath prefixFile);
+ void setPreviouslyScanned(boolean wasScanned);
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISymbianSDKModifier.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISymbianSDKModifier.java Fri Jun 11 12:09:52 2010 -0500
@@ -13,6 +13,7 @@
package com.nokia.carbide.cpp.internal.api.sdk;
+import org.eclipse.core.runtime.IPath;
import org.osgi.framework.Version;
import com.nokia.carbide.cpp.sdk.core.ISDKBuildInfo;
@@ -24,6 +25,12 @@
public interface ISymbianSDKModifier {
/**
+ * Add a feature supported by the SDK.
+ * @param feature supported feature
+ */
+ void addSupportedFeature(Object feature);
+
+ /**
* Sets the build info for a particular builder.
* @param buildInfo build info
* @param builderId id string of a builder
@@ -31,27 +38,46 @@
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);
/**
+ * Set the absolute path to the epoc32 directory of this SDK.
+ * @param epocRoot absolute path to the epoc32 directory
+ */
+ void setEPOCROOT(String epocRoot);
+
+ /**
+ * Sets display name of a SDK. This is the com.vendor.family identifier.
+ * @param name SDK display name
+ */
+ void setName(String name);
+
+ /**
+ * Sets the OS version string of a SDK.
+ * @param osVer OS version
+ */
+ public void setOSVersion(Version osVer);
+
+ /**
+ * Sets the prefix file for a particular builder.
+ * @param prefixFile path of prefix file
+ * @param builderId id string of a builder
+ */
+ void setPrefixFile(IPath prefixFile, String builderId);
+
+ /**
+ * Sets the SDK version string of a SDK.
+ * @param sdkVers SDK version
+ */
+ void setSDKVersion(Version sdkVers);
+
+ /**
* 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);
-
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Fri Jun 11 12:09:52 2010 -0500
@@ -102,8 +102,6 @@
private ExternalFileInfoCollection compilerPrefixFileInfo = null;
private List<File> systemIncludes;
private ISymbianSDK sdk;
- ISBSv1BuildInfo sbsv1BuildInfo;
- ISBSv2BuildInfo sbsv2BuildInfo;
private IPath compilerPrefixFile;
private String platformString;
@@ -111,7 +109,9 @@
private String displayString;
private String contextKey;
-
+
+ private String builderId;
+
private boolean changed;
private File cacheFile;
@@ -121,9 +121,12 @@
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);
+ if (context instanceof ISBSv1BuildContext) {
+ builderId = ISymbianBuilderID.SBSV1_BUILDER;
+ } else {
+ builderId = ISymbianBuilderID.SBSV2_BUILDER;
+ }
}
/* (non-Javadoc)
@@ -170,24 +173,16 @@
List<IDefine> macros = new ArrayList<IDefine>();
Map<String, IDefine> namedMacros = new HashMap<String, IDefine>();
- File prefixFile = null;
- if (sbsv1BuildInfo != null) {
- prefixFile = sbsv1BuildInfo.getPrefixFile(sdk);
- } else if (sbsv2BuildInfo != null) {
- prefixFile = sbsv2BuildInfo.getPrefixFile(sdk);
- }
+ File prefixFile = sdk.getPrefixFile(builderId);
if (prefixFile == null){
// Check that the prefix file may have become available since the SDK was scanned last.
// This can happen, for e.g., if the user opens the IDE _then_ does a subst on a drive that already has an SDK entry.
- IPath prefixCheck = ((SymbianSDK)sdk).getPrefixFromVariantCfg();
+ ISDKBuildInfo buildInfo = sdk.getBuildInfo(builderId);
+ IPath prefixCheck = buildInfo.getPrefixFromVariantCfg();
if (prefixCheck != null){
prefixFile = prefixCheck.toFile();
- if (sbsv1BuildInfo != null) {
- sbsv1BuildInfo.setPrefixFile(sdk, prefixCheck);
- } else if (sbsv2BuildInfo != null) {
- sbsv2BuildInfo.setPrefixFile(sdk, prefixCheck);
- }
+ ((SymbianSDK)sdk).setPrefixFile(prefixCheck, builderId);
}
}
@@ -202,12 +197,15 @@
// add any BSF/SBV includes so the headers are picked up from the correct location
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);
+ ISDKBuildInfo buildInfo = sdk.getBuildInfo(builderId);
+ if (buildInfo instanceof ISBSv1BuildInfo) {
+ ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)buildInfo;
+ bsfPlat = sbsv1BuildInfo.getBSFCatalog().findPlatform(platformString);
+ sbvPlat = sbsv1BuildInfo.getSBVCatalog().findPlatform(platformString);
+ } else {
+ ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)buildInfo;
+ bsfPlat = sbsv2BuildInfo.getBSFCatalog().findPlatform(platformString);
+ sbvPlat = sbsv2BuildInfo.getSBVCatalog().findPlatform(platformString);
}
if (bsfPlat != null) {
for (IPath path : bsfPlat.getSystemIncludePaths()) {
@@ -313,12 +311,7 @@
userPaths.add(prefixFile.removeLastSegments(1).toFile());
systemPaths.add(prefixFile.removeLastSegments(1).toFile());
- IPath includePath = null;
- if (sbsv1BuildInfo != null) {
- includePath = sbsv1BuildInfo.getIncludePath(sdk);
- } else if (sbsv2BuildInfo != null) {
- includePath = sbsv2BuildInfo.getIncludePath(sdk);
- }
+ IPath includePath = sdk.getIncludePath();
if (includePath != null) {
File includeDir = includePath.toFile().getAbsoluteFile();
userPaths.add(includeDir);
@@ -381,21 +374,19 @@
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);
+ ISDKBuildInfo buildInfo = sdk.getBuildInfo(builderId);
+ if (buildInfo instanceof ISBSv1BuildInfo) {
+ ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)buildInfo;
+ bsfplatform = sbsv1BuildInfo.getBSFCatalog().findPlatform(platformString);
+ sbvPlatform = sbsv1BuildInfo.getSBVCatalog().findPlatform(platformString);
+ } else {
+ ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)buildInfo;
+ bsfplatform = sbsv2BuildInfo.getBSFCatalog().findPlatform(platformString);
+ sbvPlatform = sbsv2BuildInfo.getSBVCatalog().findPlatform(platformString);
}
// look in the epoc32 directory of the SDK
- IPath includePath = null;
- if (sbsv1BuildInfo != null) {
- includePath = sbsv1BuildInfo.getIncludePath(sdk);
- } else if (sbsv2BuildInfo != null) {
- includePath = sbsv2BuildInfo.getIncludePath(sdk);
- }
+ IPath includePath = sdk.getIncludePath();
if (includePath != null) {
File includeDir = includePath.toFile().getAbsoluteFile();
File dir;
@@ -456,12 +447,7 @@
}
// also search files in same folder as variant.hrh
- File prefix = null;
- if (sbsv1BuildInfo != null) {
- prefix = sbsv1BuildInfo.getPrefixFile(sdk);
- } else if (sbsv2BuildInfo != null) {
- prefix = sbsv2BuildInfo.getPrefixFile(sdk);
- }
+ File prefix = sdk.getPrefixFile(builderId);
if (sbvPlatform != null){
// might be an alternate HRH file to use
IPath varVarHRH = sbvPlatform.getBuildVariantHRHFile();
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Fri Jun 11 12:09:52 2010 -0500
@@ -394,34 +394,22 @@
}
if (customEpocroot != null) {
- sdk.setEPOCROOT(customEpocroot);
+ ((SymbianSDK)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 (wasScanned.equalsIgnoreCase("true")){
+ sbsv1BuildInfo.setPreviouslyScanned(true);
+ sbsv2BuildInfo.setPreviouslyScanned(true);
+ } else {
+ sbsv1BuildInfo.setPreviouslyScanned(false);
+ sbsv2BuildInfo.setPreviouslyScanned(false);
}
-
- ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
- if (sbsv2BuildInfo != null) {
- if (wasScanned.equalsIgnoreCase("true")){
- sbsv2BuildInfo.setPreviouslyScanned(sdk, true);
- } else {
- sbsv2BuildInfo.setPreviouslyScanned(sdk, false);
+
+ if (!sdkVersion.equals("")){
+ if (Version.parseVersion(sdkVersion).getMajor() != 0){
+ ((SymbianSDK)sdk).setSDKVersion(Version.parseVersion(sdkVersion));
}
}
}
@@ -480,6 +468,10 @@
osVerNode.setNodeValue(currSDK.getOSVersion().toString());
attribs.setNamedItem(osVerNode);
+ 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());
@@ -487,23 +479,15 @@
}
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);
+ ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)currSDK.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
+ Node wasScannedNode = d.createAttribute(SDK_SCANNED_FOR_PLUGINS);
+ if (true == sbsv1BuildInfo.isPreviouslyScanned() ||
+ true == sbsv2BuildInfo.isPreviouslyScanned()) {
+ wasScannedNode.setNodeValue("true");
+ } else {
+ wasScannedNode.setNodeValue("false");
}
+ attribs.setNamedItem(wasScannedNode);
}
}
DOMSource domSource = new DOMSource(d);
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/BSFCatalogFactory.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/BSFCatalogFactory.java Fri Jun 11 12:09:52 2010 -0500
@@ -12,17 +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;
import org.eclipse.core.runtime.Path;
+import com.nokia.carbide.cpp.sdk.core.IBSFCatalog;
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+
/**
* This factory creates BSF catalogs.
*
@@ -36,17 +31,7 @@
* @return a catalog, never null
*/
public static IBSFCatalog createCatalog(ISymbianSDK sdk) {
- 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);
+ BSFCatalog catalog = new BSFCatalog(new Path(sdk.getEPOCROOT()), sdk.getIncludePath());
return catalog;
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv1BuildInfo.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv1BuildInfo.java Fri Jun 11 12:09:52 2010 -0500
@@ -14,25 +14,25 @@
package com.nokia.carbide.cpp.internal.sdk.core.model;
import java.io.File;
+import java.io.FileReader;
import java.io.IOException;
-import java.net.URL;
+import java.io.Reader;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Date;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import java.util.regex.Matcher;
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;
@@ -42,6 +42,7 @@
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.cpp.internal.api.utils.core.PathUtils;
/**
* SBSv1 specific build information.
@@ -49,38 +50,34 @@
*/
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 ISymbianSDK sdk;
private IBSFCatalog bsfCatalog;
private ISBVCatalog sbvCatalog;
+ private boolean wasScanned = false;
private List<ISymbianBuildContext> binaryVariantContextList = new ArrayList<ISymbianBuildContext>(0);
private List<ISymbianBuildContext> bsfContextList = new ArrayList<ISymbianBuildContext>(0);
+ private Map<String, List<String>> cachedPlatformMacros = new HashMap<String, List<String>>();
- public List<ISymbianBuildContext> getFilteredBuildConfigurations(ISymbianSDK sdk) {
- // This is probably a bug, but the filtering only uses SBSv1 preferences if SBSv1 is enabled...
- List<ISymbianBuildContext> filteredContexts;
- if (SBSv2Utils.enableSBSv1Support()) {
- filteredContexts = getSBSv1FilteredBuildConfigurations(sdk);
- } else {
- // be optimistic in this case... SBSv3? ;)
- filteredContexts = getAllBuildConfigurations(sdk);
- }
- return filteredContexts;
+ public SBSv1BuildInfo(ISymbianSDK sdk) {
+ this.sdk = sdk;
+ }
+
+ public void clearPlatformMacros() {
+ cachedPlatformMacros.clear();
+ }
+
+ public List<String> getAvailablePlatforms() {
+ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
+ return sdkMgr.getSymbianMacroStore().getSupportedPlatforms(((SymbianSDK)sdk).getOSVersion(), "", getBSFCatalog());
}
@SuppressWarnings("rawtypes")
- public List<ISymbianBuildContext> getAllBuildConfigurations(ISymbianSDK sdk) {
+ public List<ISymbianBuildContext> getAllBuildConfigurations() {
Set sdkFeatures = sdk.getSupportedFeatures();
List<ISymbianBuildContext> buildTargets = new ArrayList<ISymbianBuildContext>();
// note that this gets variant platforms but not regular BSF's
- List <String>buildPlats = getAvailablePlatforms(sdk);
+ List <String>buildPlats = getAvailablePlatforms();
if (buildPlats.size() == 0){
return Collections.emptyList();
@@ -108,147 +105,102 @@
ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
if (sdkMgr.getBSFScannerEnabled()){
- buildTargets.addAll(getBSFPlatformContexts(sdk));
- buildTargets.addAll(getBinaryVariationPlatformContexts(sdk)); // Symbian Binary Variation (.var)
+ buildTargets.addAll(getBSFPlatformContexts());
+ buildTargets.addAll(getBinaryVariationPlatformContexts()); // Symbian Binary Variation (.var)
}
return buildTargets;
}
- public List<String> getPlatformMacros(ISymbianSDK sdk, String platform) {
- if (sdk instanceof SymbianSDK) {
- return ((SymbianSDK)sdk).getPlatformMacros(platform);
- }
- return null;
- }
-
- public List<String> getVendorSDKMacros(ISymbianSDK sdk) {
- ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
- return sdkMgr.getSymbianMacroStore().getVendorMacros(getSDKVersion(sdk), getName(sdk));
- }
-
- public List<String> 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();
+ public IBSFCatalog getBSFCatalog() {
+ synchronized (sdk) {
+ if (bsfCatalog == null) {
+ bsfCatalog = BSFCatalogFactory.createCatalog(sdk);
}
}
- return "";
+ return bsfCatalog;
}
- public String getVendor(ISymbianSDK sdk) {
- String[] parts = getName(sdk).split("\\.");
- if (parts.length == 3)
- return parts[1];
-
- return "";
+ public List<ISymbianBuildContext> getFilteredBuildConfigurations() {
+ // This is probably a bug, but the filtering only uses SBSv1 preferences if SBSv1 is enabled...
+ List<ISymbianBuildContext> filteredContexts;
+ if (SBSv2Utils.enableSBSv1Support()) {
+ filteredContexts = getSBSv1FilteredBuildConfigurations();
+ } else {
+ // be optimistic in this case... SBSv3? ;)
+ filteredContexts = getAllBuildConfigurations();
+ }
+ return filteredContexts;
}
- 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];
+ public List<String> getPlatformMacros(String platform) {
+ List<String> platformMacros = cachedPlatformMacros.get(platform.toUpperCase());
+ if (platformMacros == null) {
+ synchronized (cachedPlatformMacros) {
+ IBSFCatalog bsfCatalog = getBSFCatalog();
+ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
+ platformMacros = sdkMgr.getSymbianMacroStore().getPlatformMacros(sdk.getOSVersion(), "", bsfCatalog, platform);
+ cachedPlatformMacros.put(platform.toUpperCase(), platformMacros);
}
}
-
- return "";
- }
-
- public Version getSDKVersion(ISymbianSDK sdk) {
- if (sdkVersion == null){
- return new Version("0.0");
- }
- return sdkVersion;
- }
-
- public File getPrefixFile(ISymbianSDK sdk) {
- return prefixFile;
+ return platformMacros;
}
- 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;
+ /**
+ * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
+ * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
+ */
+ public IPath getPrefixFromVariantCfg(){
+ File epocRoot = new File(sdk.getEPOCROOT());
+ File variantCfg;
+ variantCfg = new File(epocRoot, SymbianSDK.SPP_VARIANT_CFG_FILE);
+ if (!variantCfg.exists()) {
+ variantCfg = new File(epocRoot, SymbianSDK.VARIANT_CFG_FILE);
+ if (!variantCfg.exists())
+ return null;
}
- 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) {
+
+ String variantDir = null;
+ String variantFile = null;
+ try {
+ char[] cbuf = new char[(int) variantCfg.length()];
+ Reader reader = new FileReader(variantCfg);
+ reader.read(cbuf);
+ reader.close();
+ String[] lines = new String(cbuf).split("\r\n|\r|\n");
+ for (int i = 0; i < lines.length; i++) {
+ // skip comments and blank lines
+ String line = SymbianSDK.removeComments(lines[i]);
+ if (line.matches("\\s*#.*") || line.trim().length() == 0)
+ continue;
+
+ // parse the variant line, which is an EPOCROOT-relative
+ // path to a bldvariant.hrh file
+ Matcher matcher = SymbianSDK.VARIANT_HRH_LINE_PATTERN.matcher(line);
+ if (matcher.matches()) {
+ variantDir = matcher.group(1);
+ variantFile = matcher.group(3);
+ File variantFullPathFile = new File(epocRoot, variantDir + File.separator + variantFile);
+ IPath variantFilePath = new Path(PathUtils.convertPathToUnix(variantFullPathFile.getAbsolutePath()));
+ return variantFilePath;
+ }
}
- return epoc32RelPath;
+ } catch (IOException e) {
}
- return null;
+
+ return null; // can't find the file...
}
- 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) {
+ public ISBVCatalog getSBVCatalog() {
+ synchronized (sdk) {
+ if (sbvCatalog == null) {
+ sbvCatalog = SBVCatalogFactory.createCatalog(sdk);
}
- return epoc32IncPath;
}
- return null;
- }
-
- public String getSDKDescription(ISymbianSDK sdk) {
- if (sdkDescription == null){
- return "";
- }
- return sdkDescription;
+ return sbvCatalog;
}
- 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<String> getTargetTypeMacros(ISymbianSDK sdk, String targettype) {
+ public List<String> 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.
@@ -275,116 +227,31 @@
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 List<String> getVendorSDKMacros() {
+ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
+ return sdkMgr.getSymbianMacroStore().getVendorMacros(sdk.getSDKVersion(), sdk.getName());
}
- 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 boolean isS60() {
+ return sdk.getFamily().equals(ISBSv1BuildInfo.S60_FAMILY_ID)
+ || sdk.getFamily().equals(ISBSv1BuildInfo.SERIES60_FAMILY_ID);
}
- 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 boolean isPreviouslyScanned() {
+ return wasScanned;
}
- public void setName(ISymbianSDK sdk, String name) {
- if (sdk instanceof SymbianSDK) {
- DeviceType deviceEntry = ((SymbianSDK)sdk).getDeviceEntry();
- if (deviceEntry != null) {
- deviceEntry.setName(name);
- }
- }
+ public void setPreviouslyScanned(boolean wasScanned) {
+ this.wasScanned = wasScanned;
}
- 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<ISymbianBuildContext> getBinaryVariationPlatformContexts(ISymbianSDK sdk) {
+ protected List<ISymbianBuildContext> getBinaryVariationPlatformContexts() {
synchronized (binaryVariantContextList) {
if (!binaryVariantContextList.isEmpty()){
return binaryVariantContextList;
}
- ISBVCatalog catalog = getSBVCatalog(sdk);
+ 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.
@@ -399,13 +266,13 @@
return binaryVariantContextList;
}
- protected List<ISymbianBuildContext> getBSFPlatformContexts(ISymbianSDK sdk) {
+ protected List<ISymbianBuildContext> getBSFPlatformContexts() {
synchronized (bsfContextList) {
if (!bsfContextList.isEmpty()){
return bsfContextList;
}
- IBSFCatalog catalog = getBSFCatalog(sdk);
+ IBSFCatalog catalog = getBSFCatalog();
for (IBSFPlatform platform : catalog.getPlatforms()) {
// only return non-variant style BSF's. see boog #4533 for details.
if (!platform.isVariant()) {
@@ -420,9 +287,9 @@
}
@SuppressWarnings("rawtypes")
- protected List<ISymbianBuildContext> getSBSv1FilteredBuildConfigurations(ISymbianSDK sdk) {
+ protected List<ISymbianBuildContext> getSBSv1FilteredBuildConfigurations() {
Set sdkFeatures = sdk.getSupportedFeatures();
- List<ISymbianBuildContext> buildContexts = getAllBuildConfigurations(sdk);
+ List<ISymbianBuildContext> buildContexts = getAllBuildConfigurations();
if (buildContexts.size() == 0){
return Collections.emptyList();
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBSv2BuildInfo.java Fri Jun 11 12:09:52 2010 -0500
@@ -14,9 +14,14 @@
package com.nokia.carbide.cpp.internal.sdk.core.model;
import java.io.File;
+import java.io.FileReader;
import java.io.IOException;
+import java.io.Reader;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -29,6 +34,7 @@
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
+import com.nokia.cpp.internal.api.utils.core.PathUtils;
/**
* SBSv2 specific build information.
@@ -36,36 +42,117 @@
*/
public class SBSv2BuildInfo implements ISBSv2BuildInfo {
- private File prefixFile;
+ private ISymbianSDK sdk;
private IBSFCatalog bsfCatalog;
private ISBVCatalog sbvCatalog;
+ private boolean wasScanned = false;
+ private Map<String, List<String>> cachedPlatformMacros = new HashMap<String, List<String>>();
+
+ public SBSv2BuildInfo(ISymbianSDK sdk) {
+ this.sdk = sdk;
+ }
+
+ @Override
+ public void clearPlatformMacros() {
+ // TODO Auto-generated method stub
+
+ }
@Override
- public List<ISymbianBuildContext> getFilteredBuildConfigurations(ISymbianSDK sdk) {
+ public List<ISymbianBuildContext> getAllBuildConfigurations() {
+ return SBSv2Utils.getAllSBSv2BuildContexts(sdk);
+ }
+
+ public IBSFCatalog getBSFCatalog() {
+ synchronized (sdk) {
+ if (bsfCatalog == null) {
+ bsfCatalog = BSFCatalogFactory.createCatalog(sdk);
+ }
+ }
+ return bsfCatalog;
+ }
+
+ @Override
+ public List<ISymbianBuildContext> getFilteredBuildConfigurations() {
// This is probably a bug, but the filtering only uses SBSv1 preferences if SBSv1 is enabled...
List<ISymbianBuildContext> filteredContexts;
if (SBSv2Utils.enableSBSv2Support()) {
filteredContexts = SBSv2Utils.getFilteredSBSv2BuildContexts(sdk);
} else {
// be optimistic in this case... SBSv3? ;)
- filteredContexts = getAllBuildConfigurations(sdk);
+ filteredContexts = getAllBuildConfigurations();
}
return filteredContexts;
}
- @Override
- public List<ISymbianBuildContext> getAllBuildConfigurations(ISymbianSDK sdk) {
- return SBSv2Utils.getAllSBSv2BuildContexts(sdk);
+ public List<String> getPlatformMacros(String platform) {
+ List<String> platformMacros = cachedPlatformMacros.get(platform.toUpperCase());
+ if (platformMacros == null) {
+ synchronized (cachedPlatformMacros) {
+ IBSFCatalog bsfCatalog = getBSFCatalog();
+ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
+ platformMacros = sdkMgr.getSymbianMacroStore().getPlatformMacros(sdk.getOSVersion(), "", bsfCatalog, platform);
+ cachedPlatformMacros.put(platform.toUpperCase(), platformMacros);
+ }
+ }
+ return platformMacros;
}
- public List<String> getPlatformMacros(ISymbianSDK sdk, String platform) {
- if (sdk instanceof SymbianSDK) {
- return ((SymbianSDK)sdk).getPlatformMacros(platform);
+ /**
+ * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
+ * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
+ */
+ public IPath getPrefixFromVariantCfg(){
+ File epocRoot = new File(sdk.getEPOCROOT());
+ File variantCfg;
+ variantCfg = new File(epocRoot, SymbianSDK.SPP_VARIANT_CFG_FILE);
+ if (!variantCfg.exists()) {
+ variantCfg = new File(epocRoot, SymbianSDK.VARIANT_CFG_FILE);
+ if (!variantCfg.exists())
+ return null;
}
- return null;
+
+ String variantDir = null;
+ String variantFile = null;
+ try {
+ char[] cbuf = new char[(int) variantCfg.length()];
+ Reader reader = new FileReader(variantCfg);
+ reader.read(cbuf);
+ reader.close();
+ String[] lines = new String(cbuf).split("\r\n|\r|\n");
+ for (int i = 0; i < lines.length; i++) {
+ // skip comments and blank lines
+ String line = SymbianSDK.removeComments(lines[i]);
+ if (line.matches("\\s*#.*") || line.trim().length() == 0)
+ continue;
+
+ // parse the variant line, which is an EPOCROOT-relative
+ // path to a bldvariant.hrh file
+ Matcher matcher = SymbianSDK.VARIANT_HRH_LINE_PATTERN.matcher(line);
+ if (matcher.matches()) {
+ variantDir = matcher.group(1);
+ variantFile = matcher.group(3);
+ File variantFullPathFile = new File(epocRoot, variantDir + File.separator + variantFile);
+ IPath variantFilePath = new Path(PathUtils.convertPathToUnix(variantFullPathFile.getAbsolutePath()));
+ return variantFilePath;
+ }
+ }
+ } catch (IOException e) {
+ }
+
+ return null; // can't find the file...
}
- public List<String> getTargetTypeMacros(ISymbianSDK sdk, String targettype) {
+ public ISBVCatalog getSBVCatalog() {
+ synchronized (sdk) {
+ if (sbvCatalog == null) {
+ sbvCatalog = SBVCatalogFactory.createCatalog(sdk);
+ }
+ }
+ return sbvCatalog;
+ }
+
+ public List<String> 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.
@@ -92,62 +179,12 @@
return macros;
}
- public List<String> 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() {
+ return wasScanned;
}
- 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());
+ public void setPreviouslyScanned(boolean wasScanned) {
+ this.wasScanned = wasScanned;
}
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBVCatalogFactory.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBVCatalogFactory.java Fri Jun 11 12:09:52 2010 -0500
@@ -12,17 +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;
import org.eclipse.core.runtime.Path;
+import com.nokia.carbide.cpp.sdk.core.ISBVCatalog;
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+
/**
* This factory creates SBV catalogs.
*
@@ -36,17 +31,7 @@
* @return a catalog, never null
*/
public static ISBVCatalog createCatalog(ISymbianSDK sdk) {
- 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);
+ SBVCatalog catalog = new SBVCatalog(new Path(sdk.getEPOCROOT()), sdk.getIncludePath());
return catalog;
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Fri Jun 11 12:09:52 2010 -0500
@@ -38,13 +38,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.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;
@@ -138,35 +136,6 @@
}
}
- public void setDefaultSDK(ISymbianSDK sdk){
- try {
- File devicesFile = getDevicesXMLFile();
-
- synchronized(sdkList)
- {
- for (ISymbianSDK currSDK : sdkList){
- if (!currSDK.getUniqueId().equals(sdk.getUniqueId())){
- ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
- if (sbsv1BuildInfo != null) {
- sbsv1BuildInfo.setIsDefaultSDK(currSDK, false); // set all to false, except the input one
- }
- }
- }
- }
-
- DevicesLoader.setDefaultDevice(sdk, devicesFile.toURL());
- updateCarbideSDKCache();
-
- } catch (MalformedURLException e) {
- e.printStackTrace();
- } catch (URISyntaxException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
-
protected boolean doRemoveSDK(String sdkId) {
// Now actually remove it from the file...
DevicesType devicesType;
@@ -413,13 +382,9 @@
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;
- }
+ if (!sdk.getName().equalsIgnoreCase(currSDK.getName())){
+ needsRescan = true;
+ break;
}
}
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianMissingSDKFactory.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianMissingSDKFactory.java Fri Jun 11 12:09:52 2010 -0500
@@ -14,11 +14,9 @@
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;
@@ -33,19 +31,12 @@
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$
- if (sbsv1BuildInfo != null) {
- sbsv1BuildInfo.setOSSDKBranch(sdk, "0.0"); //$NON-NLS-1$
- }
}
-
- if (sbsv1BuildInfo != null) {
- sbsv1BuildInfo.setSDKVersion(sdk, new Version("0.0")); //$NON-NLS-1$
- }
+ sdk.setSDKVersion(new Version("0.0")); //$NON-NLS-1$
return sdk;
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianSDK.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianSDK.java Fri Jun 11 12:09:52 2010 -0500
@@ -16,10 +16,6 @@
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.DateFormat;
-import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -56,16 +52,12 @@
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.DeviceType;
-import com.nokia.carbide.cpp.sdk.core.IBSFCatalog;
import com.nokia.carbide.cpp.sdk.core.ISDKBuildInfo;
-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.ISymbianSDKFeatures;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
-import com.nokia.cpp.internal.api.utils.core.PathUtils;
import com.sun.org.apache.xpath.internal.XPathAPI;
public class SymbianSDK implements ISymbianSDK, ISymbianSDKModifier {
@@ -78,8 +70,8 @@
private static final String PATH_ID_SRCDIR = "srcDir"; //$NON-NLS-1$
private static final String RELEASE = "release"; //$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$
+ public static final String VARIANT_CFG_FILE = "epoc32/tools/variant/variant.cfg"; //$NON-NLS-1$
+ public 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$
private static final String BUILD_INFO_TXT_FILE = "epoc32/data/buildinfo.txt"; //$NON-NLS-1$
private static final String BUILD_INFO_KEYWORD = "ManufacturerSoftwareBuild";
@@ -88,54 +80,34 @@
protected DeviceType deviceEntry = null;
private boolean enabled = true;
- private boolean wasScanned = false;
private Version osVersion;
+ private Version sdkVersion;
private List<String> supportedTargetTypesList = new ArrayList<String>();
- private Map<String, List<String>> cachedPlatformMacros = new HashMap<String, List<String>>();
private Map<String, ISDKBuildInfo> buildInfoMap = new HashMap<String, ISDKBuildInfo>();
+ private Map<String, File> prefixFileMap = new HashMap<String, File>();
@SuppressWarnings("rawtypes")
private Set sdkFeatures = new HashSet();
// greedy match means the filename is in the last group
- private static Pattern VARIANT_HRH_LINE_PATTERN = Pattern.compile("(?i)(.*)(/|\\\\)(.*hrh)");
+ public static Pattern VARIANT_HRH_LINE_PATTERN = Pattern.compile("(?i)(.*)(/|\\\\)(.*hrh)");
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);
- }
-
+ setBuildInfo(new SBSv1BuildInfo(this), ISymbianBuilderID.SBSV1_BUILDER);
+ setBuildInfo(new SBSv2BuildInfo(this), ISymbianBuilderID.SBSV2_BUILDER);
scanSDK();
}
-
- public void scanSDK(){
-
- cachedPlatformMacros.clear();
-
- if (!setDataFromManifestXML()){
- //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);
- }
- }
-
- setSupportFeatures();
+
+ @SuppressWarnings("unchecked")
+ public void addSupportedFeature(Object feature) {
+ sdkFeatures.add(feature);
}
-
+
+ public ISDKBuildInfo getBuildInfo(String builderId) {
+ ISDKBuildInfo buildInfo = buildInfoMap.get(builderId);
+ return buildInfo;
+ }
+
public String getEPOCROOT() {
if (deviceEntry != null) {
String epocRoot = deviceEntry.getEpocroot();
@@ -163,17 +135,40 @@
return "";
}
- public boolean isEnabled() {
- if (!SDKCorePlugin.SUPPORTS_SBSV1_BUILDER &&
- (getOSVersion().getMajor() < 9 ||
- (getOSVersion().getMajor() == 9 && getOSVersion().getMinor() <= 4))){
- return false;
+ public String getFamily() {
+ String[] parts = getName().split("\\.");
+ if (parts.length == 3){
+ if (getSDKVersion().getMajor() == 5 && getName().equalsIgnoreCase(ISBSv1BuildInfo.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 enabled;
+
+ return "";
}
- public void setEnabled(boolean enable) {
- enabled = enable;
+ 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 String getName() {
+ if (deviceEntry != null) {
+ return deviceEntry.getName();
+ }
+ return "";
}
public Version getOSVersion() {
@@ -182,24 +177,93 @@
}
return osVersion;
}
-
- public List<String> getPlatformMacros(String platform) {
- List<String> 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);
+
+ public File getPrefixFile(String builderId) {
+ File prefixFile = prefixFileMap.get(builderId);
+ return prefixFile;
+ }
+
+ 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 Version getSDKVersion() {
+ if (sdkVersion == null){
+ return new Version("0.0");
+ }
+ return sdkVersion;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public Set getSupportedFeatures() {
+ return sdkFeatures;
+ }
+
+ public List<String> getSupportedTargetTypes() {
+
+ synchronized (supportedTargetTypesList) {
+ if (supportedTargetTypesList.size() > 0){
+ return supportedTargetTypesList;
+ }
+
+ File epocRoot = new File(getEPOCROOT());
+ File targetTypePM = new File(epocRoot, TARGETTYPE_PM_FILE);
+ if (!targetTypePM.exists())
+ return supportedTargetTypesList;
+
+ // greedy match means the filename is in the last group
+ try {
+ char[] cbuf = new char[(int) targetTypePM.length()];
+ Reader reader = new FileReader(targetTypePM);
+ reader.read(cbuf);
+ reader.close();
+ String[] lines = new String(cbuf).split("\r|\r\n|\n");
+ for (int i = 0; i < lines.length; i++) {
+ // skip comments and blank lines
+ String line = removeComments(lines[i]);
+ if (line.matches("\\s*#.*") || line.trim().length() == 0)
+ continue;
+
+ // parse current line... the slitting could be done better with more efficent reg exp....
+ line = line.trim();
+ line = line.replaceAll(" ", "");
+ if (line.endsWith("=>{")){
+ String[] lineSplit = line.split("=>");
+ if (lineSplit.length == 2 && Character.isLetter(lineSplit[0].charAt(0))){
+ supportedTargetTypesList.add(lineSplit[0]);
+ }
+ }
}
- ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
- platformMacros = sdkMgr.getSymbianMacroStore().getPlatformMacros(getOSVersion(), branch, bsfCatalog, platform);
- cachedPlatformMacros.put(platform.toUpperCase(), platformMacros);
+ } catch (IOException e) {
+ e.printStackTrace();
}
}
- return platformMacros;
+
+ return supportedTargetTypesList;
+ }
+
+ 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() {
@@ -250,74 +314,105 @@
return variantCFGMacros;
}
- public List<String> getSupportedTargetTypes() {
+ public String getVendor() {
+ String[] parts = getName().split("\\.");
+ if (parts.length == 3)
+ return parts[1];
+
+ return "";
+ }
+
+ public boolean isEnabled() {
+ if (!SDKCorePlugin.SUPPORTS_SBSV1_BUILDER &&
+ (getOSVersion().getMajor() < 9 ||
+ (getOSVersion().getMajor() == 9 && getOSVersion().getMinor() <= 4))){
+ return false;
+ }
+ return enabled;
+ }
+
+ /**
+ * Remove single line C-style comments, multi-line C++-style comments and blank lines
+ */
+ public static String removeComments(String aIntermediateContent) {
+ // Strip out comments. There are uncovered cases here where this regex approach fails
+ // when combining cpp and c style comments.
+ String lNewline = "(\\r\\n|\\r|\\n)";
+
+ // Note: we used to use the regex below for cpp comments (from http://ostermiller.org/findcomment.html )
+ // String lCppStyleComments = "/\\*(?:.|[\\n\\r])*?\\*/";
+ // but it throws StackOverFlowExceptions for large inputs
+ // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507
+ // suggests that regex OR is the cause - therefore use dotall mode: (?s) instead
- synchronized (supportedTargetTypesList) {
- if (supportedTargetTypesList.size() > 0){
- return supportedTargetTypesList;
- }
-
- File epocRoot = new File(getEPOCROOT());
- File targetTypePM = new File(epocRoot, TARGETTYPE_PM_FILE);
- if (!targetTypePM.exists())
- return supportedTargetTypesList;
-
- // greedy match means the filename is in the last group
- try {
- char[] cbuf = new char[(int) targetTypePM.length()];
- Reader reader = new FileReader(targetTypePM);
- reader.read(cbuf);
- reader.close();
- String[] lines = new String(cbuf).split("\r|\r\n|\n");
- for (int i = 0; i < lines.length; i++) {
- // skip comments and blank lines
- String line = removeComments(lines[i]);
- if (line.matches("\\s*#.*") || line.trim().length() == 0)
- continue;
-
- // parse current line... the slitting could be done better with more efficent reg exp....
- line = line.trim();
- line = line.replaceAll(" ", "");
- if (line.endsWith("=>{")){
- String[] lineSplit = line.split("=>");
- if (lineSplit.length == 2 && Character.isLetter(lineSplit[0].charAt(0))){
- supportedTargetTypesList.add(lineSplit[0]);
- }
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
+ String lCStyleComments = "(?m)//(.*)$";
+ String lCppStyleComments = "(?s)/\\*.*?\\*/";
+ String lBlankLines = "(?m)(^(\\s)*$"+lNewline+")+";
+ aIntermediateContent = aIntermediateContent.replaceAll(lCStyleComments, "");
+ aIntermediateContent = aIntermediateContent.replaceAll(lCppStyleComments, "");
+ aIntermediateContent = aIntermediateContent.replaceAll(lBlankLines,"");
+ return aIntermediateContent;
+ }
+
+ public void scanSDK(){
+ ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
+ ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
+
+ sbsv1BuildInfo.clearPlatformMacros();
+ sbsv2BuildInfo.clearPlatformMacros();
+
+ if (!setDataFromManifestXML()){
+ //need to scan SDK files for OS and SDK version
+ scanSDKForVersionInfo();
}
+
+ setPrefixFile(sbsv1BuildInfo.getPrefixFromVariantCfg(), ISymbianBuilderID.SBSV1_BUILDER);
+ setPrefixFile(sbsv2BuildInfo.getPrefixFromVariantCfg(), ISymbianBuilderID.SBSV2_BUILDER);
+
+ setSupportFeatures();
+ }
- return supportedTargetTypesList;
+ public void setBuildInfo(ISDKBuildInfo buildInfo, String builderId) {
+ buildInfoMap.put(builderId, buildInfo);
+ }
+
+ public void setEnabled(boolean enable) {
+ enabled = enable;
+ }
+
+ public void setEPOCROOT(String epocRoot) {
+ deviceEntry.setEpocroot(epocRoot);
+ }
+
+ public void setName(String name) {
+ if (deviceEntry != null) {
+ deviceEntry.setName(name);
+ }
+ }
+
+ public void setOSVersion(Version osVer) {
+ this.osVersion = osVer;
}
- 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.
- // this should probably return false unless we get everything we need.
- return false;
+ public void setSDKVersion(Version sdkVers) {
+ sdkVersion = sdkVers;
}
- public List<String> validationErrors() {
- // TODO return error strings for everything that is not setup
- // properly.
- return null;
+ public void setPrefixFile(IPath prefixFile, String builderId) {
+ File file = new File(prefixFile.toOSString());
+ prefixFileMap.put(builderId, file);
+ }
+
+ public void setUniqueId(String id) {
+ deviceEntry.setId(id);
}
- private boolean setDataFromManifestXML(){
- if (hasManifestXML()){
-
- if (processManifest(new File(deviceEntry.getEpocroot(), MANIFEST_XML_LOCATION))){
- return true;
- } else {
- return false;
- }
-
- } else {
- return false;
- }
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return getUniqueId();
}
private boolean hasManifestXML(){
@@ -396,16 +491,6 @@
for (NodeIterator nodeIter = XPathAPI.selectNodeIterator(doc, "sdk"); (node = nodeIter.nextNode()) != null;) {
NamedNodeMap attribs = node.getAttributes();
- node = XPathAPI.selectSingleNode(doc, "sdk/@id");
- 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) {
@@ -458,93 +543,26 @@
// ignored...improper format
}
}
- node = attribs.getNamedItem("branch");
- if (null != node)
- {
- if (getOSVersion().getMajor() == 9){
- sbsv1BuildInfo.setOSSDKBranch(this, "");
- }else {
- sbsv1BuildInfo.setOSSDKBranch(this, node.getNodeValue());
- }
- }
}
- 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 {
- sbsv1BuildInfo.setSDKVersion(this, new Version(node.getTextContent()));
- }
- catch (IllegalArgumentException e){
- // ignored...improper format
- }
+ // Get the SDK Version...
+ node = XPathAPI.selectSingleNode(doc, "sdk/sdkVersion");
+ if (null != node) {
+ try {
+ setSDKVersion(new Version(node.getTextContent()));
}
-
- // 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
- }
- }
-
- // 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 (IllegalArgumentException e){
+ // ignored...improper format
+ }
+ }
}
} catch (TransformerException e){
e.printStackTrace();
- } catch (MalformedURLException e){
- e.printStackTrace();
}
return true;
}
- public void setOSVersion(Version osVer) {
- this.osVersion = osVer;
- }
-
/**
* Scans the SDK's epoc32\data\buildinfo.txt file and tries to build the Version
* and branch identifiers. This should not be called when a manifest.xml file exits
@@ -580,19 +598,19 @@
if (versionTokens[2].toUpperCase().contains("TB92SF")){
setOSVersion(new Version("9.5.0"));
if (sbsv1BuildInfo != null) {
- sbsv1BuildInfo.setSDKVersion(this, new Version("5.2.0"));
+ setSDKVersion(new Version("5.2.0"));
}
break;
} else if (versionTokens[2].toUpperCase().contains("TB101SF")){
setOSVersion(new Version("9.6.0"));
if (sbsv1BuildInfo != null) {
- sbsv1BuildInfo.setSDKVersion(this, new Version("6.0.0"));
+ setSDKVersion(new Version("6.0.0"));
}
break;
} else if (versionTokens[2].toUpperCase().contains("TB102SF")){
setOSVersion(new Version("9.6.0"));
if (sbsv1BuildInfo != null) {
- sbsv1BuildInfo.setSDKVersion(this, new Version("6.0.0"));
+ setSDKVersion(new Version("6.0.0"));
}
break;
}
@@ -600,16 +618,6 @@
int index = versionTokens[2].lastIndexOf("v");
String osVersionString = versionTokens[2].substring(index+1, versionTokens[2].length());
- 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 (sbsv1BuildInfo != null && branch != null){
- sbsv1BuildInfo.setOSSDKBranch(this, branch);
- }
- }
-
// Set the version, split on alphanumeric to get rid of any junk at the end
String[] tempStr = osVersionString.split("[a-zA-Z_]");
if (tempStr.length != 0){
@@ -630,97 +638,6 @@
}
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return getUniqueId();
- }
-
- /**
- * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
- * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
- */
- public IPath getPrefixFromVariantCfg(){
- File epocRoot = new File(getEPOCROOT());
- File variantCfg;
- variantCfg = new File(epocRoot, SPP_VARIANT_CFG_FILE);
- if (!variantCfg.exists()) {
- variantCfg = new File(epocRoot, VARIANT_CFG_FILE);
- if (!variantCfg.exists())
- return null;
- }
-
- String variantDir = null;
- String variantFile = null;
- try {
- char[] cbuf = new char[(int) variantCfg.length()];
- Reader reader = new FileReader(variantCfg);
- reader.read(cbuf);
- reader.close();
- String[] lines = new String(cbuf).split("\r\n|\r|\n");
- for (int i = 0; i < lines.length; i++) {
- // skip comments and blank lines
- String line = removeComments(lines[i]);
- if (line.matches("\\s*#.*") || line.trim().length() == 0)
- continue;
-
- // parse the variant line, which is an EPOCROOT-relative
- // path to a bldvariant.hrh file
- Matcher matcher = VARIANT_HRH_LINE_PATTERN.matcher(line);
- if (matcher.matches()) {
- variantDir = matcher.group(1);
- variantFile = matcher.group(3);
- File variantFullPathFile = new File(epocRoot, variantDir + File.separator + variantFile);
- IPath variantFilePath = new Path(PathUtils.convertPathToUnix(variantFullPathFile.getAbsolutePath()));
- return variantFilePath;
- }
- }
- } catch (IOException e) {
- }
-
- return null; // can't find the file...
- }
-
- /**
- * Remove single line C-style comments, multi-line C++-style comments and blank lines
- */
- private static String removeComments(String aIntermediateContent) {
- // Strip out comments. There are uncovered cases here where this regex approach fails
- // when combining cpp and c style comments.
- String lNewline = "(\\r\\n|\\r|\\n)";
-
- // Note: we used to use the regex below for cpp comments (from http://ostermiller.org/findcomment.html )
- // String lCppStyleComments = "/\\*(?:.|[\\n\\r])*?\\*/";
- // but it throws StackOverFlowExceptions for large inputs
- // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507
- // suggests that regex OR is the cause - therefore use dotall mode: (?s) instead
-
- String lCStyleComments = "(?m)//(.*)$";
- String lCppStyleComments = "(?s)/\\*.*?\\*/";
- String lBlankLines = "(?m)(^(\\s)*$"+lNewline+")+";
- aIntermediateContent = aIntermediateContent.replaceAll(lCStyleComments, "");
- aIntermediateContent = aIntermediateContent.replaceAll(lCppStyleComments, "");
- aIntermediateContent = aIntermediateContent.replaceAll(lBlankLines,"");
- return aIntermediateContent;
- }
-
- public void setEPOCROOT(String epocRoot) {
- deviceEntry.setEpocroot(epocRoot);
- }
-
- public void setUniqueId(String id) {
- deviceEntry.setId(id);
- }
-
- private boolean isEKA2() {
- if (getOSVersion().getMajor() >= 9) {
- return true;
- }
- return false;
- }
-
/**
* Check to see whether or not we should support WINSCW UREL
*/
@@ -738,46 +655,24 @@
}
}
- public void setPreviouslyScanned(boolean wasScanned) {
- this.wasScanned = wasScanned;
+ private boolean setDataFromManifestXML(){
+ if (hasManifestXML()){
+
+ if (processManifest(new File(deviceEntry.getEpocroot(), MANIFEST_XML_LOCATION))){
+ return true;
+ } else {
+ return false;
+ }
+
+ } else {
+ return false;
+ }
}
- 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);
+ sdkFeatures.add(ISymbianSDKFeatures.IS_EKA2);
}
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/processes/CheckS60CustKitSupport.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/processes/CheckS60CustKitSupport.java Fri Jun 11 12:09:52 2010 -0500
@@ -21,11 +21,9 @@
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;
@@ -175,13 +173,12 @@
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 (sbsv1BuildInfo != null && sbsv1BuildInfo.getSDKVersion(sdk).getMajor() >= 5 && middleWareInclude.exists()) {
+ if (sdk.getSDKVersion().getMajor() >= 5 && middleWareInclude.exists()) {
// add symbol as at least one build config is a CustKit
S60_50_Macros_String = S60_INC_MACROS;
break;
@@ -190,7 +187,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 (sbsv1BuildInfo != null && sbsv1BuildInfo.getSDKVersion(sdk).getMajor() >= 5 && middleWareInclude.exists() && sfoPath.exists()) {
+ if (sdk.getSDKVersion().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;
@@ -198,7 +195,7 @@
// try newer middleware paths moved to app layer includes
- if (sbsv1BuildInfo != null && sbsv1BuildInfo.getSDKVersion(sdk).getMajor() >= 5 && middleWareInclude.exists()) {
+ if (sdk.getSDKVersion().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()){
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/scripting/SymbianSDKs.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/scripting/SymbianSDKs.java Fri Jun 11 12:09:52 2010 -0500
@@ -21,9 +21,7 @@
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;
@@ -41,13 +39,10 @@
ArrayList<Map<String,String>> sdkMapArray = new ArrayList<Map<String,String>>();
List<ISymbianSDK> sdkList = getSDKManager().getSDKList();
for (ISymbianSDK sdk : sdkList){
- ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
Map<String,String> mp = new HashMap<String, String>();
mp.put(KEY_SDK_ID, sdk.getUniqueId());
mp.put(KEY_SDK_EPOCROOT, sdk.getEPOCROOT());
- if (sbsv1BuildInfo != null) {
- mp.put(KEY_SDK_NAME, sbsv1BuildInfo.getName(sdk));
- }
+ mp.put(KEY_SDK_NAME, sdk.getName());
sdkMapArray.add(mp);
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/xml/DevicesLoader.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/xml/DevicesLoader.java Fri Jun 11 12:09:52 2010 -0500
@@ -21,14 +21,12 @@
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 {
@@ -106,7 +104,6 @@
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;
@@ -116,9 +113,7 @@
deviceExists = true;
currDevice.setEpocroot(sdk.getEPOCROOT());
currDevice.setId(sdk.getUniqueId());
- if (sbsv1BuildInfo != null) {
- currDevice.setName(sbsv1BuildInfo.getName(sdk));
- }
+ currDevice.setName(sdk.getName());
if (currDevice.getUserdeletetable() != null){
currDevice.setUserdeletable(currDevice.getUserdeletetable());
}
@@ -137,14 +132,8 @@
DeviceType newDeviceEntry = DevicesFactory.eINSTANCE.createDeviceType();
newDeviceEntry.setId(sdk.getUniqueId());
newDeviceEntry.setEpocroot(sdk.getEPOCROOT());
- 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.setName(sdk.getName());
+ newDeviceEntry.setDefault(DefaultType.NO_LITERAL);
newDeviceEntry.setUserdeletable("no");
newDeviceEntry.setUserdeletetable(null); // just to be sure it doens't get written out
devicesList.add(newDeviceEntry); // Add the new/modified config to the list so new data is written
@@ -174,21 +163,12 @@
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 (sbsv1BuildInfo != null && sbsv1BuildInfo.isDefaultSDK(sdk)){
- currDevice.setDefault(DefaultType.YES_LITERAL);
- } else {
- currDevice.setDefault(DefaultType.NO_LITERAL);
- }
- } else {
- currDevice.setDefault(DefaultType.NO_LITERAL);
- }
+ currDevice.setDefault(DefaultType.NO_LITERAL);
}
// write to disk
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISDKBuildInfo.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISDKBuildInfo.java Fri Jun 11 12:09:52 2010 -0500
@@ -15,6 +15,8 @@
import java.util.List;
+import org.eclipse.core.runtime.IPath;
+
/**
* Interface for build related information of a Symbian SDK.
*
@@ -22,17 +24,21 @@
public interface ISDKBuildInfo {
/**
- * Returns platform-filtered build configurations for a Symbian SDK.
- * @param sdk Symbian SDK
+ * Returns all available build configurations for a Symbian SDK.
* @return list of ISymbianBuildContext
*/
- List<ISymbianBuildContext> getFilteredBuildConfigurations(ISymbianSDK sdk);
+ List<ISymbianBuildContext> getAllBuildConfigurations();
/**
- * Returns all available build configurations for a Symbian SDK.
- * @param sdk Symbian SDK
+ * Returns platform-filtered build configurations for a Symbian SDK.
* @return list of ISymbianBuildContext
*/
- List<ISymbianBuildContext> getAllBuildConfigurations(ISymbianSDK sdk);
+ List<ISymbianBuildContext> getFilteredBuildConfigurations();
+
+ /**
+ * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
+ * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
+ */
+ public IPath getPrefixFromVariantCfg();
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISDKManager.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISDKManager.java Fri Jun 11 12:09:52 2010 -0500
@@ -99,14 +99,6 @@
public void updateCarbideSDKCache();
/**
- * Sets the default SDK attribute for the input SDK.
- * Sets all other sdks in devcies.xml to 'default=false'
- * @param sdk - ISymbianSDK object
- */
- public void setDefaultSDK(ISymbianSDK sdk);
-
-
- /**
* Get whether or not the UI has enabled BSF scanning.
* @return true if BSF scanning is enabled.
*/
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java Fri Jun 11 12:09:52 2010 -0500
@@ -12,9 +12,11 @@
*/
package com.nokia.carbide.cpp.sdk.core;
+import java.io.File;
import java.util.List;
import java.util.Set;
+import org.eclipse.core.runtime.IPath;
import org.osgi.framework.Version;
/**
@@ -38,6 +40,59 @@
ISDKBuildInfo getBuildInfo(String builderId);
/**
+ * 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 the family name of a SDK. This is parsed from the 'vendor' attribute from devices.xml.
+ */
+ String getFamily();
+
+ /**
+ * Returns an IPath for the epoc32\include directory of a SDK.
+ * @return an IPath for the epoc32\include directory, or <code>null</code>.
+ */
+ IPath getIncludePath();
+
+ /**
+ * Returns the display name of a SDK. This is the com.vendor.family identifier.
+ * @return the name of a sdk.
+ */
+ String getName();
+
+ /**
+ * 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 prefix file for a particular builder.
+ * @param builderId id string of a builder
+ * @return the File object for the prefix file, or
+ * <code>null</code> if there isn't one for the SDK.
+ */
+ File getPrefixFile(String builderId);
+
+ /**
+ * Returns an IPath for the epoc32\release directory of a SDK.
+ * @return an IPath for the epoc32\release directory, or <code>null</code>.
+ */
+ IPath getReleaseRoot();
+
+ /**
+ * 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();
+
+ /**
* Returns a set of features supported by the SDK.
* Feature IDs are defined in ISymbianSDKFeatures.
* @return set of features
@@ -46,29 +101,24 @@
Set getSupportedFeatures();
/**
- * Returns true if the SDK is configured properly, false otherwise.
- *
- * @return <code>true</code> if the SDK is configured properly, and
- * <code>false</code> otherwise
+ * Get a list of supported targettypes listed by this SDK. This routine parses the
+ * \epoc32\tools\trgttype.pm file to build it's list.
+ * @return A list of targettype names that can be used in an MMP file
*/
- boolean isValid();
+ List<String> getSupportedTargetTypes();
/**
- * Returns a list of human readable error strings desribing why the
- * SDK is not configured properly.
- *
- * @return a list of strings which may be empty.
- * @see #isValid()
+ * Returns an IPath for the epoc32\tools directory of a SDK.
+ * @return an IPath for the epoc32\tools directory, or <code>null</code>.
*/
- List<String> validationErrors();
-
+ IPath getToolsPath();
+
/**
- * Returns true if the SDK is enabled, false otherwise.
+ * Returns the unique id of this SDK. This is the devices.xml 'id' attribute.
*
- * @return <code>true</code> if the SDK is enabled, and
- * <code>false</code> otherwise
+ * @return the id string of this SDK.
*/
- boolean isEnabled();
+ String getUniqueId();
/**
* Returns a list of the macros defined in the variant.cfg file. This is NOT the macros
@@ -78,43 +128,22 @@
List<String> getVariantCFGMacros();
/**
- * Returns the unique id of this SDK. This is the devices.xml 'id' attribute.
- *
- * @return the id string of this SDK.
+ * Returns the vendor name of this SDK. This is parsed from the 'name' attribute from devices.xml.
+ * @return the vendor name of a sdk.
*/
- String getUniqueId();
-
- /**
- * 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 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();
+ String getVendor();
/**
- * Get a list of supported targettypes listed by this SDK. This routine parses the
- * \epoc32\tools\trgttype.pm file to build it's list.
- * @return A list of targettype names that can be used in an MMP file
+ * Returns true if the SDK is enabled, false otherwise.
+ *
+ * @return <code>true</code> if the SDK is enabled, and
+ * <code>false</code> otherwise
*/
- List<String> getSupportedTargetTypes();
-
- /**
- * Set the absolute path to the epoc32 directory of this SDK.
- * @param epocRoot absolute path to the epoc32 directory
- */
- void setEPOCROOT(String epocRoot);
+ boolean isEnabled();
/**
* Scans/Rescans the SDK for info such as prefix file, variant macros, manifest.xml, etc.
*/
void scanSDK();
-
+
}
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/SymbianSDKFactory.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/SymbianSDKFactory.java Fri Jun 11 12:09:52 2010 -0500
@@ -14,7 +14,6 @@
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;
@@ -41,35 +40,23 @@
String epocRoot,
String name,
Version osVersion,
- String osBranch,
- Version sdkVersion,
- boolean isDefault){
+ Version sdkVersion) {
DeviceType newDeviceEntry = DevicesFactory.eINSTANCE.createDeviceType();
newDeviceEntry.setId(id);
newDeviceEntry.setEpocroot(epocRoot);
newDeviceEntry.setName(name);
- if (isDefault){
- newDeviceEntry.setDefault(DefaultType.YES_LITERAL);
- } else {
- newDeviceEntry.setDefault(DefaultType.NO_LITERAL);
- }
+ newDeviceEntry.setDefault(DefaultType.NO_LITERAL);
SymbianSDK sdk = new SymbianSDK(newDeviceEntry); // create SDK and set the attribs found in devices.xml
// 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);
- if (sbsv1BuildInfo != null) {
- sbsv1BuildInfo.setOSSDKBranch(sdk, osBranch);
- }
}
- if (sbsv1BuildInfo != null) {
- if (sbsv1BuildInfo.getSDKVersion(sdk).getMajor() == 0){
- sbsv1BuildInfo.setSDKVersion(sdk, sdkVersion);
- }
+ if (sdk.getSDKVersion().getMajor() == 0) {
+ sdk.setSDKVersion(sdkVersion);
}
return sdk;
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/TemplateUtils.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/TemplateUtils.java Fri Jun 11 12:09:52 2010 -0500
@@ -24,7 +24,6 @@
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;
@@ -51,9 +50,8 @@
* versionRange is a minVersion and maxVersion delimited by -
*/
public static boolean sdkMatchesTemplate(ISymbianSDK symbianSDK, ITemplate template) {
- 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
+ Version sdkVersion = symbianSDK.getSDKVersion();
+ String family = symbianSDK.getFamily(); // S60, symbian... 3rd segment of devices.xml 'name' attrib
return sdkMatchesTemplate(sdkVersion, family, template);
}
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java Fri Jun 11 12:09:52 2010 -0500
@@ -56,10 +56,10 @@
for (ISymbianSDK sdk : sdkList) {
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
if (sbsv1BuildInfo != null) {
- if (sbsv1BuildInfo.isPreviouslyScanned(sdk) == false) {
+ if (sbsv1BuildInfo.isPreviouslyScanned() == false) {
oneSDKWasScanned = true;
// XML was parsed, now try to run the feature installer
- sbsv1BuildInfo.setPreviouslyScanned(sdk, true);
+ sbsv1BuildInfo.setPreviouslyScanned(true);
File featureDir = new File(sdk.getEPOCROOT() + SDK_FEATURE_SUBDIR);
try {
DynamicFeatureInstaller installer = new DynamicFeatureInstaller(featureDir, null);
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java Fri Jun 11 12:09:52 2010 -0500
@@ -174,7 +174,7 @@
@Override
protected void setValue(Object element, Object value) {
ISymbianSDK sdk = (ISymbianSDK) element;
- sdk.setEPOCROOT(value.toString());
+ ((SymbianSDK)sdk).setEPOCROOT(value.toString());
SDKCorePlugin.getSDKManager().updateSDK(sdk);
getViewer().refresh();
}
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPropertiesDialog.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPropertiesDialog.java Fri Jun 11 12:09:52 2010 -0500
@@ -31,9 +31,6 @@
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.PlatformUI;
-import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo;
-import com.nokia.carbide.cpp.sdk.core.ISDKBuildInfo;
-import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
public class SDKPropertiesDialog extends TrayDialog {
@@ -95,8 +92,7 @@
// SDK Version at Row 2.
TableItem itemSDKVersion = new TableItem(propsTable, SWT.NONE);
- ISBSv1BuildInfo buildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
- String sdkVersion = buildInfo.getSDKVersion(sdk).toString();
+ String sdkVersion = sdk.getSDKVersion().toString();
itemSDKVersion.setText(new String[] {Messages.getString("SDKPropertiesDialog.OS_Version"), sdkVersion}); //$NON-NLS-1$
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, SDKUIHelpIds.SDK_PROPERTIES_DIALOG);
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/AddSDKDialog.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/AddSDKDialog.java Fri Jun 11 12:09:52 2010 -0500
@@ -44,7 +44,6 @@
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;
@@ -183,25 +182,18 @@
// No objections raised, write the new device entry
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("5.0"); //$NON-NLS-1$
ISymbianSDK sdk = SymbianSDKFactory.createInstance(deviceIDtext.getText(),
epocRootText.getText(),
vendorName,
osVersion,
- osBranch,
- sdkVersion,
- false);
+ sdkVersion);
((SymbianSDK)sdk).setEnabled(true);
SDKCorePlugin.getSDKManager().addSDK(sdk);
List<ISymbianSDK> sdkList = SDKCorePlugin.getSDKManager().getSDKList();
if (sdkList != null){
sdkList.add(sdk);
}
- ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
- if (sbsv1BuildInfo != null) {
- sbsv1BuildInfo.setIsDefaultSDK(sdk, false);
- }
super.okPressed();
}
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetTreeNode.java Fri Jun 11 12:09:52 2010 -0500
@@ -57,7 +57,7 @@
List<ISymbianBuildContext> configurations = sbsv2Project ?
SBSv2Utils.getFilteredSBSv2BuildContexts(value) :
- value.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getFilteredBuildConfigurations(value);
+ value.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getFilteredBuildConfigurations();
TreeNode[] children = new TreeNode[configurations.size()];
int index = 0;
--- a/core/com.nokia.carbide.templatewizard.symbian.tests/src/com/nokia/carbide/templatewizard/symbian/tests/TestBuildInfo.java Fri Jun 11 11:35:13 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-package com.nokia.carbide.templatewizard.symbian.tests;
-
-import com.nokia.carbide.cpp.internal.sdk.core.model.SBSv1BuildInfo;
-import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
-
-public class TestBuildInfo extends SBSv1BuildInfo {
-
- private String family;
-
- public String getFamily(ISymbianSDK sdk) {
- return family;
- }
-
- public void setFamily(String family) {
- this.family = family;
- }
-}
--- a/core/com.nokia.carbide.templatewizard.symbian.tests/src/com/nokia/carbide/templatewizard/symbian/tests/TestSymbianSDK.java Fri Jun 11 11:35:13 2010 -0500
+++ b/core/com.nokia.carbide.templatewizard.symbian.tests/src/com/nokia/carbide/templatewizard/symbian/tests/TestSymbianSDK.java Fri Jun 11 12:09:52 2010 -0500
@@ -19,55 +19,77 @@
package com.nokia.carbide.templatewizard.symbian.tests;
-import java.util.HashMap;
-import java.util.HashSet;
+import java.io.File;
import java.util.List;
-import java.util.Map;
import java.util.Set;
+import org.eclipse.core.runtime.IPath;
import org.osgi.framework.Version;
+import com.nokia.carbide.cpp.internal.api.sdk.ISymbianSDKModifier;
import com.nokia.carbide.cpp.sdk.core.ISDKBuildInfo;
-import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
-class TestSymbianSDK implements ISymbianSDK {
+class TestSymbianSDK implements ISymbianSDK, ISymbianSDKModifier {
private String framework;
- private TestBuildInfo testBuildInfo;
- private Map<String, ISDKBuildInfo> buildInfoMap = new HashMap<String, ISDKBuildInfo>();
- private Set sdkFeatures = new HashSet();
+ private Version sdkVersion;
+ private String family;
public TestSymbianSDK(String frameWork, String sdkVersionString) {
this.framework = frameWork;
- testBuildInfo = new TestBuildInfo();
- testBuildInfo.setSDKVersion(this, Version.parseVersion(sdkVersionString));
- testBuildInfo.setFamily(framework);
- buildInfoMap.put(ISymbianBuilderID.SBSV1_BUILDER, testBuildInfo);
+ setSDKVersion(Version.parseVersion(sdkVersionString));
+ setFamily(framework);
+ }
+
+ public void addSupportedFeature(Object feature) {
}
public ISDKBuildInfo getBuildInfo(String builderId) {
- ISDKBuildInfo buildInfo = buildInfoMap.get(builderId);
- return buildInfo;
+ return null;
+ }
+
+ public String getEPOCROOT() {
+ return "C:\\";
+ }
+
+ public String getFamily() {
+ return family;
+ }
+
+ public IPath getIncludePath() {
+ return null;
+ }
+
+ public String getName() {
+ return null;
+ }
+
+ public Version getOSVersion() {
+ return null;
+ }
+
+ public File getPrefixFile(String builderId) {
+ return null;
+ }
+
+ public IPath getReleaseRoot() {
+ return null;
+ }
+
+ public Version getSDKVersion() {
+ return sdkVersion;
}
public Set getSupportedFeatures() {
- return sdkFeatures;
- }
-
- public boolean isValid() {
- return false;
- }
-
- public List<String> validationErrors() {
return null;
}
- public boolean isEnabled() {
- return false;
+ public List<String> getSupportedTargetTypes() {
+ return null;
}
- public List<String> getVariantCFGMacros() {
+ public IPath getToolsPath() {
return null;
}
@@ -75,21 +97,47 @@
return null;
}
- public String getEPOCROOT() {
- return "C:\\";
- }
-
- public Version getOSVersion() {
+ public List<String> getVariantCFGMacros() {
return null;
}
- public List<String> getSupportedTargetTypes() {
+ public String getVendor() {
return null;
}
public void setEPOCROOT(String epocRoot) {
}
+ public boolean isEnabled() {
+ return false;
+ }
+
+ public void setBuildInfo(ISDKBuildInfo buildInfo, String builderId) {
+ }
+
+ public void setEnabled(boolean enable) {
+ }
+
+ public void setFamily(String family) {
+ this.family = family;
+ }
+
+ public void setName(String name) {
+ }
+
+ public void setOSVersion(Version osVer) {
+ }
+
+ public void setPrefixFile(IPath prefixFile, String builderId) {
+ }
+
+ public void setSDKVersion(Version sdkVers) {
+ sdkVersion = sdkVers;
+ }
+
+ public void setUniqueId(String id) {
+ }
+
public void scanSDK() {
}
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/TestsPlugin.java Fri Jun 11 11:35:13 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/TestsPlugin.java Fri Jun 11 12:09:52 2010 -0500
@@ -16,16 +16,21 @@
*/
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 java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import junit.framework.TestCase;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
-import java.util.*;
-
-import junit.framework.TestCase;
+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.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;
/**
* The main plugin class to be used in the desktop.
@@ -72,17 +77,11 @@
for (ISymbianSDK sdk : SDKCorePlugin.getSDKManager().getSDKList()) {
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
- List<ISymbianBuildContext> 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));
- }
+ List<ISymbianBuildContext> contexts = new ArrayList<ISymbianBuildContext>();
+ contexts.addAll(sbsv1BuildInfo.getAllBuildConfigurations());
+ contexts.addAll(sbsv2BuildInfo.getAllBuildConfigurations());
+ if (contexts.size() > 0) {
+ return contexts.subList(0, Math.min(contexts.size(), 8));
}
}
TestCase.fail("No installed SDKs provide build configurations");
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestMMPView3.java Fri Jun 11 11:35:13 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestMMPView3.java Fri Jun 11 12:09:52 2010 -0500
@@ -57,7 +57,7 @@
sdk = null;
if (!Platform.isRunning()) {
sdk = SymbianSDKFactory.createInstance("S60_3rd", "c:\\symbian\\9.1\\S60_3rd", "com.nokia.s60",
- new Version(9,0,0), null, null, false);
+ new Version(9,0,0), new Version(0,0,0));
// add to memory for standalone test, hopefully only affecting my system
SDKCorePlugin.getSDKManager().addSDK(sdk);
} else {
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/editors/images/MultiImageEditorContextBase.java Fri Jun 11 11:35:13 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/editors/images/MultiImageEditorContextBase.java Fri Jun 11 12:09:52 2010 -0500
@@ -440,9 +440,7 @@
ISymbianSDK sdk = buildContext != null ? buildContext.getSDK() : null;
if (sdk != null) {
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
- if (sbsv1BuildInfo != null) {
- return sbsv1BuildInfo.isS60(sdk);
- }
+ return sbsv1BuildInfo.isS60();
}
return false;
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/images/CarbideImageModelFactory.java Fri Jun 11 11:35:13 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/images/CarbideImageModelFactory.java Fri Jun 11 12:09:52 2010 -0500
@@ -16,24 +16,32 @@
*/
package com.nokia.carbide.cpp.internal.project.ui.images;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
import com.nokia.carbide.cdt.builder.ImageMakefileViewPathHelper;
import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
-import com.nokia.carbide.cpp.epoc.engine.image.*;
+import com.nokia.carbide.cpp.epoc.engine.image.IImageSource;
+import com.nokia.carbide.cpp.epoc.engine.image.IImageSourceReference;
+import com.nokia.carbide.cpp.epoc.engine.image.IMultiImageSource;
+import com.nokia.carbide.cpp.epoc.engine.image.ImageFormat;
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.carbide.cpp.ui.images.IImageContainerEditorProvider;
+import com.nokia.carbide.cpp.ui.images.IImageContainerModel;
+import com.nokia.carbide.cpp.ui.images.IImageContainerModelListener;
+import com.nokia.carbide.cpp.ui.images.IImageLoader;
+import com.nokia.carbide.cpp.ui.images.IImageModel;
+import com.nokia.carbide.cpp.ui.images.ImageContainerModelBase;
+import com.nokia.carbide.cpp.ui.images.ImageModelFactory;
import com.nokia.cpp.internal.api.utils.core.ProjectUtils;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.osgi.framework.Version;
-
-import java.util.*;
-
/**
* Factory for Carbide-specific image models and containers
*
@@ -282,33 +290,8 @@
* @return flag
*/
public static boolean doesProjectSupportSVG(ICarbideProjectInfo projectInfo) {
- boolean supportsSVG = false;
- if (projectInfo == null)
- return true;
-
- List<ICarbideBuildConfiguration> buildConfigurations = projectInfo.getBuildConfigurations();
- for (ICarbideBuildConfiguration buildConfiguration : buildConfigurations) {
- ISymbianSDK sdk = buildConfiguration.getSDK();
- 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;
- }
- }
- }
- return supportsSVG;
+ // SVG supported after 2.8 on S60
+ return true;
}
/**
@@ -322,13 +305,9 @@
if (projectInfo != null) {
List<ICarbideBuildConfiguration> buildConfigurations = projectInfo.getBuildConfigurations();
for (ICarbideBuildConfiguration buildConfiguration : buildConfigurations) {
- ISymbianSDK sdk = buildConfiguration.getSDK();
- ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
- if (sbsv1BuildInfo != null) {
- if (sbsv1BuildInfo.getFamily(sdk).equals(ISBSv1BuildInfo.UIQ_FAMILY_ID)) {
- imageConverterFactory = new UIQImageConverterFactory();
- break;
- }
+ if (buildConfiguration.getSDK().getFamily().equals(ISBSv1BuildInfo.UIQ_FAMILY_ID)) {
+ imageConverterFactory = new UIQImageConverterFactory();
+ break;
}
}
}
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ImporterBuildTargetsPage.java Fri Jun 11 11:35:13 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ImporterBuildTargetsPage.java Fri Jun 11 12:09:52 2010 -0500
@@ -26,8 +26,13 @@
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.core.IBSFCatalog;
+import com.nokia.carbide.cpp.sdk.core.ISBSv1BuildContext;
+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;
import com.nokia.carbide.cpp.sdk.ui.shared.BuildTargetsPage;
public class ImporterBuildTargetsPage extends BuildTargetsPage {
@@ -74,9 +79,9 @@
ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
if (sbsv1BuildInfo != null) {
- bsfCatalog = sbsv1BuildInfo.getBSFCatalog(sdk);
+ bsfCatalog = sbsv1BuildInfo.getBSFCatalog();
} else if (sbsv2BuildInfo != null) {
- bsfCatalog = sbsv2BuildInfo.getBSFCatalog(sdk);
+ bsfCatalog = sbsv2BuildInfo.getBSFCatalog();
}
if (sdkMgr.getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){
// Check and see if any of the configs in the SDK
@@ -133,12 +138,12 @@
for (ISymbianBuildContext currContext : selectedConfigs){
ISymbianSDK sdk = currContext.getSDK();
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 (currContext instanceof ISBSv1BuildContext) {
+ ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
+ bsfCatalog = sbsv1BuildInfo.getBSFCatalog();
+ } else {
+ ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
+ bsfCatalog = sbsv2BuildInfo.getBSFCatalog();
}
if (sdkMgr.getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){
// this setting needs to be persisted.
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/views/SPNViewContentProvider.java Fri Jun 11 11:35:13 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/views/SPNViewContentProvider.java Fri Jun 11 12:09:52 2010 -0500
@@ -1657,13 +1657,7 @@
if (buildConfig != null) {
ISymbianSDK sdk = buildConfig.getSDK();
if (sdk != null) {
- 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);
- }
+ sdkEpoc32IncludeDir = sdk.getIncludePath();
}
}
}
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/scripting/ImporterScritpingUtils.java Fri Jun 11 11:35:13 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/scripting/ImporterScritpingUtils.java Fri Jun 11 12:09:52 2010 -0500
@@ -123,15 +123,11 @@
}
}
else {
+ selectedConfigs = new ArrayList<ISymbianBuildContext>();
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<ISymbianBuildContext>();
- }
+ selectedConfigs.addAll(sbsv1BuildInfo.getFilteredBuildConfigurations());
+ selectedConfigs.addAll(sbsv1BuildInfo.getFilteredBuildConfigurations());
}
return selectedConfigs;
}
--- a/qt/com.nokia.carbide.cpp.qt.core/src/com/nokia/carbide/cpp/internal/qt/core/QtFilter.java Fri Jun 11 11:35:13 2010 -0500
+++ b/qt/com.nokia.carbide.cpp.qt.core/src/com/nokia/carbide/cpp/internal/qt/core/QtFilter.java Fri Jun 11 12:09:52 2010 -0500
@@ -19,25 +19,14 @@
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");
- }
+ IPath releaseRoot = context.getSDK().getReleaseRoot();
if (context.getPlatformString().equals(ISymbianBuildContext.EMULATOR_PLATFORM)) {
return releaseRoot.append(context.getPlatformString()).
append(context.getTargetString()).append("QtCore.dll").toFile(); //$NON-NLS-1$
--- a/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/QtImporterBuildTargetsPage.java Fri Jun 11 11:35:13 2010 -0500
+++ b/qt/com.nokia.carbide.cpp.qt.ui/src/com/nokia/carbide/cpp/internal/qt/ui/wizard/QtImporterBuildTargetsPage.java Fri Jun 11 12:09:52 2010 -0500
@@ -24,6 +24,7 @@
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.ISBSv1BuildContext;
import com.nokia.carbide.cpp.sdk.core.ISDKManager;
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
@@ -64,12 +65,12 @@
for (ISymbianBuildContext currContext : selectedConfigs){
ISymbianSDK sdk = currContext.getSDK();
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 (currContext instanceof ISBSv1BuildContext) {
+ ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
+ bsfCatalog = sbsv1BuildInfo.getBSFCatalog();
+ } else {
+ ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER);
+ bsfCatalog = sbsv2BuildInfo.getBSFCatalog();
}
if (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0 || sdkMgr.getBSFScannerEnabled()){
// this setting needs to be persisted.