--- 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;
}
--- 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;
}
--- 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.
--- 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
--- 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 <data_caging_paths.hrh>\n#include <domain/osextensions/platform_paths.hrh>\nMW_LAYER_SYSTEMINCLUDE";
@@ -46,6 +51,8 @@
private static final String S60_SF_FOLDER = "sf";
private static final String S60_INC_MACROS_SF = "#include <platform_paths.hrh>\n#include <data_caging_paths.hrh>\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;
+ }
+
}
--- 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<String>(), targetMMPFileName, pkgMappings, monitor);
}
}
--- 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
+
+
--- 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"
--- 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
--- 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"