# HG changeset patch # User Ed Swartz # Date 1261000133 21600 # Node ID 56780cf045d5630d3bd2f3c00ec430c9caf3cfbe # Parent d42018b25fba1b6df63f2bf7a95d429ea7eb4b00# Parent 139a9d8351fe2c492cc93af39b99fe6c691842a7 Merge commit diff -r 139a9d8351fe -r 56780cf045d5 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/error/parsers/CarbideMakeErrorParser.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/error/parsers/CarbideMakeErrorParser.java Wed Dec 16 14:58:27 2009 -0600 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/error/parsers/CarbideMakeErrorParser.java Wed Dec 16 15:48:53 2009 -0600 @@ -34,6 +34,7 @@ private static String cantLaunchProcess = "CreateProcess((null)"; private static String rvctNotInstalled = "RVCT0_0.H: No such file or directory"; + private static Pattern PERL_ERROR_PATTERNS = Pattern.compile("Can't locate .*\\.pm in.*|BEGIN failed--.*"); //$NON-NLS-1$ public boolean processLine(String line, ErrorParserManager eoParser) { @@ -116,6 +117,15 @@ return true; } + // Detect problems with Symbian build scripts, most of which use Perl + matcher = PERL_ERROR_PATTERNS.matcher(line); + if (matcher.matches()) { + msgSeverity = IMarkerGenerator.SEVERITY_ERROR_BUILD; + msgLineNumber = -1; + eoParser.generateMarker(rsrc, msgLineNumber, line, msgSeverity, null); + return true; + } + return false; } diff -r 139a9d8351fe -r 56780cf045d5 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SBSv2Utils.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SBSv2Utils.java Wed Dec 16 14:58:27 2009 -0600 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SBSv2Utils.java Wed Dec 16 15:48:53 2009 -0600 @@ -14,6 +14,7 @@ import java.io.File; import java.io.FileFilter; +import java.text.MessageFormat; import java.util.*; import javax.xml.parsers.DocumentBuilder; @@ -319,14 +320,21 @@ // do some basic checks sbsHome = System.getenv(SBS_HOME); if (sbsHome == null) { - return "Please define the SBS_HOME environment (e.g. /path/to/raptor) and add $SBS_HOME/bin to your PATH before running Carbide."; + return Messages.getString("SBSv2Utils.DefineSBS_HOMEMessage"); //$NON-NLS-1$ } - sbsPath = HostOS.findProgramOnPath(sbsScriptName, null); - if (sbsPath == null) { - return "Please add $SBS_HOME/bin to your PATH before running Carbide."; + IPath expectedPath = new Path(sbsHome).append("bin").append(sbsScriptName); + if (expectedPath.toFile().exists()) { + sbsPath = expectedPath; + } else { + sbsPath = HostOS.findProgramOnPath(sbsScriptName, null); + if (sbsPath == null) { + return MessageFormat.format( + Messages.getString("SBSv2Utils.CannotFindSBSScriptError"), //$NON-NLS-1$ + sbsScriptName); + } } - + return null; } diff -r 139a9d8351fe -r 56780cf045d5 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 Wed Dec 16 14:58:27 2009 -0600 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/messages.properties Wed Dec 16 15:48:53 2009 -0600 @@ -2,5 +2,7 @@ BSFCatalog.BSFLoadError=Error loading/parsing BSF file: {0} BSFCatalog.MissingCustomizedPlatform=BSF platform ''{0}'' customizes platform ''{1}'' which cannot be located or parsed. +SBSv2Utils.CannotFindSBSScriptError=Cannot find {0} on the PATH or under $SBS_HOME/bin. Please verify your SBSv2 installation. +SBSv2Utils.DefineSBS_HOMEMessage=Please define the SBS_HOME environment (e.g. /path/to/raptor) and add $SBS_HOME/bin to your PATH before running Carbide. SBVCatalog.SBVLoadError=Error loading/parsing VAR file: {0} SBVCatalog.MissingCustomizedPlatform=Variant platform ''{0}'' customizes platform ''{1}'' which cannot be located or parsed. diff -r 139a9d8351fe -r 56780cf045d5 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManagerRaptorOnly.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManagerRaptorOnly.java Wed Dec 16 14:58:27 2009 -0600 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManagerRaptorOnly.java Wed Dec 16 15:48:53 2009 -0600 @@ -44,7 +44,9 @@ String message = SBSv2Utils.scanSBSv2(); if (message != null) { reportError(message); - return false; + + // no good will come from checking over and over... + return true; } // TODO LINUX: real configuration diff -r 139a9d8351fe -r 56780cf045d5 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/processes/CheckS60CustKitSupport.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/processes/CheckS60CustKitSupport.java Wed Dec 16 14:58:27 2009 -0600 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/processes/CheckS60CustKitSupport.java Wed Dec 16 15:48:53 2009 -0600 @@ -19,6 +19,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.QualifiedName; import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; @@ -33,8 +34,12 @@ * Process used to fill in S60 specific include symbols for INF/MMP files */ public class CheckS60CustKitSupport extends AbstractProjectProcess { - + + // copied from ProjectCreatedTasks (YUCK) private static final String SELECTED_BUILD_CONFIGS_VALUE_KEY = "selectedBuildConfigs"; //$NON-NLS-1$ + // copied from ProjectCreatedTasks (YUCK) + private static final String SBSV2_BUILDER_ATTRIBUTE = "useSBSv2Builder"; //$NON-NLS-1$ + private static final String S60_50_BUILD_MACROS = "S60_50_CustomBuildIncludes"; private static final String S60_INC_MACROS = "#include \n#include \nMW_LAYER_SYSTEMINCLUDE"; @@ -46,6 +51,8 @@ private static final String S60_SF_FOLDER = "sf"; private static final String S60_INC_MACROS_SF = "#include \n#include \nAPP_LAYER_SYSTEMINCLUDE"; + private static final String USE_PRJ_EXTENSIONS_VALUE = "usePrjExtensionsValue"; + private static final String BUILD_HELP_PREFIX = "buildHelpPrefix"; private static final String BUILD_HELP_SIS_PREFIX = "buildHelpSISPrefix"; private static final String DISABLE_HELP_STRING = "//"; @@ -83,6 +90,9 @@ template.getTemplateValues().put(BUILD_HELP_PREFIX, enableHelpString); template.getTemplateValues().put(BUILD_HELP_SIS_PREFIX, enableHelpSISString); template.getTemplateValues().put(HELP_SUPPORT_MACRO, helpSupportString); + + String usePrjExtensionsValue = usePrjExtensionsRequired(template) ? "1" : "0"; + template.getTemplateValues().put(USE_PRJ_EXTENSIONS_VALUE, usePrjExtensionsValue); } @Override @@ -116,7 +126,7 @@ // TODO: the infrastructure for the techview/bldhelp.mk is a total mess // currently, and it also appears that help is obsolete in recent devkits, // so just drop this - if (!SBSv2Utils.enableSBSv1Support()) + if (!SBSv2Utils.enableSBSv1Support() && isSBSv2Project(template)) return null; helpCompilerNames = new String[] { HELP_COMPILER_PERL }; @@ -182,4 +192,57 @@ return S60_50_Macros_String; } + /** + * Tell whether we should use PRJ_EXTENSIONS in bld.inf. Raptor doesn't + * officially support [n|gnu]makefile statements in PRJ_MMPFILES anymore, + * and actively ignores them on Linux. + * @param template + * @return + */ + private boolean usePrjExtensionsRequired(ITemplate template) { + + // look for the directory housing the extension templates; + // if this doesn't exist, then PRJ_EXTENSIONS won't work + boolean makefileTemplatesAlwaysAvailable = true; + + for (ISymbianBuildContext symbianBuildContext : getBuildContexts(template)) { + ISymbianSDK sdk = symbianBuildContext.getSDK(); + if (sdk != null) { + File makefileTemplateDir = new File(sdk.getEPOCROOT(), "epoc32/tools/makefile_templates"); //$NON-NLS-1$ + if (!makefileTemplateDir.exists()) { + // old location + makefileTemplateDir = new File(sdk.getEPOCROOT(), "s60/tools/makefile_templates"); //$NON-NLS-1$ + if (!makefileTemplateDir.exists()) { + makefileTemplatesAlwaysAvailable = false; + break; + } + } + } + } + + if (!makefileTemplatesAlwaysAvailable) + return false; + + // Ok, now, even if we DO find the templates, they may be suboptimal. + // PRJ_EXTENSIONS mifconv builds causes really messy output + // (tons of spurious warnings), and we don't want to use it unless it's + // absolutely necessary. + // + // If it seems at all likely that gnumakefiles will still work, just use them. + if (!isSBSv2Project(template)) + return false; + + return true; + } + + /** + * Tell whether the project was created for SBSv2. + * @param template + * @return + */ + private boolean isSBSv2Project(ITemplate template) { + Object value = template.getTemplateValues().get(SBSV2_BUILDER_ATTRIBUTE); + return value != null && value == Boolean.TRUE; + } + } diff -r 139a9d8351fe -r 56780cf045d5 project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/project/ui/processes/ProjectCreatedTasks.java --- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/project/ui/processes/ProjectCreatedTasks.java Wed Dec 16 14:58:27 2009 -0600 +++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/project/ui/processes/ProjectCreatedTasks.java Wed Dec 16 15:48:53 2009 -0600 @@ -85,7 +85,7 @@ } project.setSessionProperty(CarbideBuilderPlugin.SBSV2_PROJECT, Boolean.valueOf(useSBSv2Builder)); - + ProjectCorePlugin.postProjectCreatedActions(project, bldInfPath, buildConfigs, new ArrayList(), targetMMPFileName, pkgMappings, monitor); } } diff -r 139a9d8351fe -r 56780cf045d5 templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-PlatsecApp/group/bld.inf --- a/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-PlatsecApp/group/bld.inf Wed Dec 16 14:58:27 2009 -0600 +++ b/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-PlatsecApp/group/bld.inf Wed Dec 16 15:48:53 2009 -0600 @@ -8,15 +8,44 @@ ============================================================================ */ +// When building with Raptor, "gnumakefile" builds are no longer recommended. +// But, the extensions referenced here are not available in SDKs, only devkits. +#define USE_PRJ_EXTENSIONS $(usePrjExtensionsValue) PRJ_PLATFORMS WINSCW ARMV5 GCCE PRJ_MMPFILES -gnumakefile icons_scalable_dc.mk +#if !USE_PRJ_EXTENSIONS + + gnumakefile icons_scalable_dc.mk -$(buildHelpPrefix)gnumakefile ../$(helpDir)/build_help.mk + // help compiler is not always available; see similar comment in *.pkg file + $(buildHelpPrefix)gnumakefile ../$(helpDir)/build_help.mk + +#endif $(baseName).mmp + +#if USE_PRJ_EXTENSIONS + + PRJ_EXTENSIONS + + START EXTENSION s60/mifconv + OPTION TARGETFILE $(baseName$lower)_$(uid3).mif + OPTION HEADERFILE $(baseName$lower)_$(uid3).mbg + OPTION SOURCEDIR ../gfx + OPTION SOURCES -c32 qgn_menu_$(baseName) + END + + // help compiler is not always available; see similar comment in *.pkg file + $(buildHelpPrefix)START EXTENSION techview/bldhelp + $(buildHelpPrefix)OPTION HELPPROJECTFILE $(baseName).cshlp + $(buildHelpPrefix)OPTION HELPTOOLTARGETNAME $(baseName$lower)_$(uid3).hlp + $(buildHelpPrefix)END + +#endif + + diff -r 139a9d8351fe -r 56780cf045d5 templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-PlatsecApp/sis/baseName.pkg --- a/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-PlatsecApp/sis/baseName.pkg Wed Dec 16 14:58:27 2009 -0600 +++ b/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-PlatsecApp/sis/baseName.pkg Wed Dec 16 15:48:53 2009 -0600 @@ -27,8 +27,8 @@ "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\$(baseName)_$(uid3).exe" -"!:\sys\bin\$(baseName)_$(uid3).exe" "$(EPOCROOT)epoc32\data\z\resource\apps\$(baseName$lower)_$(uid3).rsc" -"!:\resource\apps\$(baseName)_$(uid3).rsc" "$(EPOCROOT)epoc32\data\z\private\10003a3f\apps\$(baseName$lower)_$(uid3)_reg.rsc" -"!:\private\10003a3f\import\apps\$(baseName)_$(uid3)_reg.rsc" -"$(EPOCROOT)epoc32\data\z\resource\apps\$(baseName)_$(uid3).mif" -"!:\resource\apps\$(baseName)_$(uid3).mif" -$(buildHelpSISPrefix)"..\$(helpDir)\$(baseName)_$(uid3).hlp" -"!:\resource\help\$(baseName)_$(uid3).hlp" +"$(EPOCROOT)epoc32\data\z\resource\apps\$(baseName$lower)_$(uid3).mif" -"!:\resource\apps\$(baseName)_$(uid3).mif" +$(buildHelpSISPrefix)"..\$(helpDir)\$(baseName$lower)_$(uid3).hlp" -"!:\resource\help\$(baseName)_$(uid3).hlp" ; Add any installation notes if applicable ;"$(baseName).txt" -"!:\private\$(uid3-WITHOUT_0X)\$(baseName).txt" diff -r 139a9d8351fe -r 56780cf045d5 templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-TouchUIApplication/group/bld.inf --- a/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-TouchUIApplication/group/bld.inf Wed Dec 16 14:58:27 2009 -0600 +++ b/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-TouchUIApplication/group/bld.inf Wed Dec 16 15:48:53 2009 -0600 @@ -8,15 +8,43 @@ ============================================================================ */ +// When building with Raptor, "gnumakefile" builds are no longer recommended. +// But, the extensions referenced here are not available in SDKs, only devkits. +#define USE_PRJ_EXTENSIONS $(usePrjExtensionsValue) + PRJ_PLATFORMS WINSCW ARMV5 GCCE PRJ_MMPFILES -gnumakefile icons_scalable_dc.mk +#if !USE_PRJ_EXTENSIONS + + gnumakefile icons_scalable_dc.mk -$(buildHelpPrefix)gnumakefile ../$(helpDir)/build_help.mk + // help compiler is not always available; see similar comment in *.pkg file + $(buildHelpPrefix)gnumakefile ../$(helpDir)/build_help.mk + +#endif $(baseName).mmp + +#if USE_PRJ_EXTENSIONS + + PRJ_EXTENSIONS + + START EXTENSION s60/mifconv + OPTION TARGETFILE $(baseName$lower)_$(uid3).mif + OPTION HEADERFILE $(baseName$lower)_$(uid3).mbg + OPTION SOURCEDIR ../gfx + OPTION SOURCES -c32 qgn_menu_$(baseName) + END + + // help compiler is not always available; see similar comment in *.pkg file + $(buildHelpPrefix)START EXTENSION techview/bldhelp + $(buildHelpPrefix)OPTION HELPPROJECTFILE $(baseName).cshlp + $(buildHelpPrefix)OPTION HELPTOOLTARGETNAME $(baseName$lower)_$(uid3).hlp + $(buildHelpPrefix)END + +#endif diff -r 139a9d8351fe -r 56780cf045d5 templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-TouchUIApplication/sis/baseName.pkg --- a/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-TouchUIApplication/sis/baseName.pkg Wed Dec 16 14:58:27 2009 -0600 +++ b/templates/com.nokia.carbide.cpp.templates/templates/projecttemplates/S60-TouchUIApplication/sis/baseName.pkg Wed Dec 16 15:48:53 2009 -0600 @@ -27,8 +27,8 @@ "$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\$(baseName)_$(uid3).exe" -"!:\sys\bin\$(baseName)_$(uid3).exe" "$(EPOCROOT)epoc32\data\z\resource\apps\$(baseName$lower)_$(uid3).rsc" -"!:\resource\apps\$(baseName)_$(uid3).rsc" "$(EPOCROOT)epoc32\data\z\private\10003a3f\apps\$(baseName$lower)_$(uid3)_reg.rsc" -"!:\private\10003a3f\import\apps\$(baseName)_$(uid3)_reg.rsc" -"$(EPOCROOT)epoc32\data\z\resource\apps\$(baseName)_$(uid3).mif" -"!:\resource\apps\$(baseName)_$(uid3).mif" -$(buildHelpSISPrefix)"..\$(helpDir)\$(baseName)_$(uid3).hlp" -"!:\resource\help\$(baseName)_$(uid3).hlp" +"$(EPOCROOT)epoc32\data\z\resource\apps\$(baseName$lower)_$(uid3).mif" -"!:\resource\apps\$(baseName)_$(uid3).mif" +$(buildHelpSISPrefix)"..\$(helpDir)\$(baseName$lower)_$(uid3).hlp" -"!:\resource\help\$(baseName)_$(uid3).hlp" ; Add any installation notes if applicable ;"$(baseName).txt" -"!:\private\$(uid3-WITHOUT_0X)\$(baseName).txt"