# HG changeset patch # User timkelly # Date 1242155858 18000 # Node ID c7e636e6e9cd4f46b325aabe923025c447be8963 # Parent 2bb08686aa3855fede7ad129fa005db2bab3b5f5 Fix message properties for new SBV parser stuff. Connect SBVPlatform hierarchy from the SBVCatalog. diff -r 2bb08686aa38 -r c7e636e6e9cd core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/messages.properties --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/messages.properties Tue May 12 12:19:40 2009 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/messages.properties Tue May 12 14:17:38 2009 -0500 @@ -2,3 +2,5 @@ BSFCatalog.BSFLoadError=Error loading/parsing BSF file: {0} BSFCatalog.MissingCustomizedPlatform=BSF platform ''{0}'' customizes platform ''{1}'' which cannot be located or parsed. +SBVCatalog.SBVLoadError=Error loading/parsing VAR file: {0} +SBVCatalog.MissingCustomizedPlatform=Variant platform ''{0}'' customizes platform ''{1}'' which cannot be located or parsed. diff -r 2bb08686aa38 -r c7e636e6e9cd core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBVCatalog.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBVCatalog.java Tue May 12 12:19:40 2009 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBVCatalog.java Tue May 12 14:17:38 2009 -0500 @@ -14,15 +14,16 @@ import java.io.File; import java.io.FilenameFilter; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; 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.ISBVPlatform; -import com.nokia.cpp.internal.api.utils.core.IMessage; +import com.nokia.carbide.cpp.internal.api.sdk.Messages; +import com.nokia.carbide.cpp.sdk.core.*; +import com.nokia.cpp.internal.api.utils.core.*; /** * This class defines the hierarchy of VAR files detected for a given SDK. @@ -58,11 +59,35 @@ } } - // TODO: Do we need to bother with a hierarchy? // now wire up the platforms - //establishPlatformHierarchy(); + establishPlatformHierarchy(); } + /** + * Iterate the platforms and connect them together + */ + private void establishPlatformHierarchy() { + List remaining = new ArrayList(platforms); + while (!remaining.isEmpty()) { + SBVPlatform current = (SBVPlatform) remaining.remove(0); + String variantPlatformName = current.getExtendedVariantName(); + if (variantPlatformName != null) { + ISBVPlatform customizedPlatform = findPlatform(variantPlatformName); + if (customizedPlatform == null) { + messages.add(new Message(IMessage.ERROR, + new MessageLocation(current.getSBVPath()), + "SBVCatalog.MissingCustomizedPlatform", //$NON-NLS-1$ + MessageFormat.format( + Messages.getString("SBVCatalog.MissingCustomizedPlatform"), //$NON-NLS-1$ + new Object[] { current.getName(), variantPlatformName }) + )); + } else { + current.setExtendedPlatform(customizedPlatform); + } + } + } + } + /* (non-Javadoc) * @see com.nokia.carbide.cpp.sdk.core.ISBVCatalog#getMessages() */ diff -r 2bb08686aa38 -r c7e636e6e9cd core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBVPlatform.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBVPlatform.java Tue May 12 12:19:40 2009 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SBVPlatform.java Tue May 12 14:17:38 2009 -0500 @@ -88,7 +88,7 @@ * Set the customized platform. * @param customized */ - void setCustomizedPlatform(ISBVPlatform customized) { + void setExtendedPlatform(ISBVPlatform customized) { Check.checkState(customized != this); this.extendedPlatform = customized; if (customized != null) { @@ -128,7 +128,7 @@ * @see com.nokia.carbide.cpp.sdk.core.ISBVPlatform#getExtendedVariant()() */ public ISBVPlatform getExtendedVariant() { - return catalog.findPlatform(getExtendedVariantName()); + return extendedPlatform; } /** diff -r 2bb08686aa38 -r c7e636e6e9cd project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/cpp/epoc/engine/messages.properties --- a/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/cpp/epoc/engine/messages.properties Tue May 12 12:19:40 2009 -0500 +++ b/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/cpp/epoc/engine/messages.properties Tue May 12 14:17:38 2009 -0500 @@ -234,6 +234,9 @@ BSFView.InvalidBSFHeader=Did not find BSF header BSFView.NoCustomizesStatement=Did not find a CUSTOMIZES statement +SBVParser.UnknownStatement=Invalid syntax for VAR statement +SBVView.NoCustomizesStatement=Did not find a EXTENDS statement + WorkspaceModelProvider.SavingModelFile.TaskLabel=Saving model file EPKGLanguage.0=Afrikaans EPKGLanguage.2=Amharic diff -r 2bb08686aa38 -r c7e636e6e9cd project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/cpp/epoc/engine/model/sbv/SBVView.java --- a/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/cpp/epoc/engine/model/sbv/SBVView.java Tue May 12 12:19:40 2009 -0500 +++ b/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/cpp/epoc/engine/model/sbv/SBVView.java Tue May 12 14:17:38 2009 -0500 @@ -52,7 +52,6 @@ private IASTSBVTranslationUnit tu; private String variantName; - private boolean sawHeaderComment; private boolean sawExtends; private boolean sawBuildHRH; private String extendsVariantStr; @@ -81,7 +80,6 @@ IDocumentParser sbvParser = ParserFactory.createSBVParser(); tu = (IASTSBVTranslationUnit) sbvParser.parse(getModel().getPath(), getModel().getDocument()); - sawHeaderComment = false; sawExtends = false; sawBuildHRH = false; @@ -189,13 +187,9 @@ @Override protected void addViewSpecificMessages(List messageList) { IPath fullPath = getModel().getPath(); - if (!sawHeaderComment) { - messageList.add(ASTFactory.createErrorMessage("SBVView.InvalidSBVHeader", - new Object[0], - new MessageLocation(fullPath))); - } + if (!sawExtends) { - messageList.add(ASTFactory.createErrorMessage("SBVView.NoCustomizesStatement", + messageList.add(ASTFactory.createErrorMessage("SBVView.NoExtendsStatement", new Object[0], new MessageLocation(fullPath))); }