# HG changeset patch
# User timkelly
# Date 1281738950 18000
# Node ID 5f8982384793821abe3fc32bf728ca3212e0eb21
# Parent 8f3d04a21ae904a4254b922291ab4f1fea3b533e
add extension point for access 'abld build' arguments. Used to keep analyze tool extension happy while we start to deprecate abld support.
diff -r 8f3d04a21ae9 -r 5f8982384793 builder/com.nokia.carbide.cdt.builder.test/plugin.xml
--- a/builder/com.nokia.carbide.cdt.builder.test/plugin.xml Fri Aug 13 12:00:38 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder.test/plugin.xml Fri Aug 13 17:35:50 2010 -0500
@@ -1,9 +1,10 @@
+
-
+
diff -r 8f3d04a21ae9 -r 5f8982384793 builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/TestCarbideProjectSettingsModifier.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/TestCarbideProjectSettingsModifier.java Fri Aug 13 17:35:50 2010 -0500
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.carbide.cdt.builder.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.dom.IPDOMManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+
+import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
+import com.nokia.carbide.cdt.builder.extension.ICarbidePrefsModifier;
+import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
+import com.nokia.carbide.cpp.project.core.ProjectCorePlugin;
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+import com.nokia.cpp.internal.api.utils.core.Check;
+import com.nokia.cpp.internal.api.utils.core.Logging;
+
+
+public class TestCarbideProjectSettingsModifier extends TestCase {
+ static IProject project;
+ static ISymbianSDK symbianSDKS60_30;
+
+ protected static final String PROJECT_NAME = "test-prj-modifier-project";
+
+
+
+ // First thing we have to do is actually create a project in a workspace...
+ protected void setUp() throws Exception {
+ if (project == null){
+ // turn off the indexer
+ CCorePlugin.getIndexManager().setDefaultIndexerId(IPDOMManager.ID_NO_INDEXER);
+
+ project = ProjectCorePlugin.createProject(PROJECT_NAME, null);
+
+ ProjectCorePlugin.postProjectCreatedActions(project, "group/bld.inf", TestPlugin.getUsableBuildConfigs(), new ArrayList(), "Debug MMP", null, new NullProgressMonitor());
+ }
+ super.setUp();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ // Make sure the project nature is there
+ @SuppressWarnings("deprecation")
+ public void testModifier() throws Exception{
+ assertNotNull(project);
+
+ ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
+ assertNotNull(cpi);
+
+ // get registry
+
+ ICarbidePrefsModifier extProvider = checkForFeatureExtension();
+
+ assertNotNull(extProvider); // will be null when SBSv1 support is removed
+
+ String original = extProvider.getAbdlBuildArg(cpi
+ .getDefaultConfiguration().getBuildContext());
+ assertTrue(original.equals(""));
+
+ extProvider.setAbldBuildArg(cpi.getDefaultConfiguration()
+ .getBuildContext(), "FOO");
+
+ cpi.getDefaultConfiguration().saveConfiguration(false);
+
+ String test = extProvider.getAbdlBuildArg(cpi.getDefaultConfiguration()
+ .getBuildContext());
+ assertTrue(test.equals("FOO"));
+
+ extProvider.setAbldBuildArg(cpi.getDefaultConfiguration()
+ .getBuildContext(), original);
+
+ cpi.getDefaultConfiguration().saveConfiguration(false);
+ test = extProvider.getAbdlBuildArg(cpi.getDefaultConfiguration()
+ .getBuildContext());
+ assertTrue(original.equals(test));
+ }
+
+ @SuppressWarnings("deprecation")
+ public static ICarbidePrefsModifier checkForFeatureExtension() {
+
+ ICarbidePrefsModifier testExt = null;
+
+ IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
+ IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint("com.nokia.carbide.cdt.builder.carbideProjectPrefModifier"); //$NON-NLS-1$
+ IExtension[] extensions = extensionPoint.getExtensions();
+
+ for (int i = 0; i < extensions.length; i++) {
+ IExtension extension = extensions[i];
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ Check.checkContract(elements.length == 1);
+ IConfigurationElement element = elements[0];
+
+ boolean failed = false;
+ try {
+ Object extObject = element.createExecutableExtension("class"); //$NON-NLS-1$
+ if (extObject instanceof ICarbidePrefsModifier) {
+ testExt = (ICarbidePrefsModifier)extObject;
+ break;
+ } else {
+ failed = true;
+ }
+ }
+ catch (CoreException e) {
+ failed = true;
+ }
+
+ if (failed) {
+ CarbideBuilderPlugin.log(Logging.newStatus(CarbideBuilderPlugin.getDefault(),
+ IStatus.ERROR,
+ "Unable to load com.nokia.carbide.cdt.builder.carbideProjectPrefModifier extension from " + extension.getContributor().getName()));
+ }
+ }
+
+ return testExt;
+ }
+}
diff -r 8f3d04a21ae9 -r 5f8982384793 builder/com.nokia.carbide.cdt.builder/plugin.xml
--- a/builder/com.nokia.carbide.cdt.builder/plugin.xml Fri Aug 13 12:00:38 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/plugin.xml Fri Aug 13 17:35:50 2010 -0500
@@ -322,5 +322,6 @@
+
diff -r 8f3d04a21ae9 -r 5f8982384793 builder/com.nokia.carbide.cdt.builder/schema/carbideProjectPrefModifier.exsd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/builder/com.nokia.carbide.cdt.builder/schema/carbideProjectPrefModifier.exsd Fri Aug 13 17:35:50 2010 -0500
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+ Allow read/write access to some Carbide project preferences.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Enter the first release in which this extension point appears.]
+
+
+
+
+
+
+
+
+ [Enter extension point usage example here.]
+
+
+
+
+
+
+
+
+ [Enter API information here.]
+
+
+
+
+
+
+
+
+ [Enter information about supplied implementation of this extension point.]
+
+
+
+
+
diff -r 8f3d04a21ae9 -r 5f8982384793 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/extension/ICarbidePrefsModifier.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/extension/ICarbidePrefsModifier.java Fri Aug 13 17:35:50 2010 -0500
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.carbide.cdt.builder.extension;
+
+import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
+
+/**
+ * Allows those using the Carbide Preferences Modifier extension point to to read
+ * and/or modify certain project preferences
+ *
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @deprecated - abld support is deprecated
+ *
+ */
+public interface ICarbidePrefsModifier {
+
+ /**
+ * Get the abld build setting from the Carbide build config arguments preference.
+ * This only works with the SBSv1 buider and has no effect on other builders.
+ * @param newParam
+ * @return The String value. Or null if the the pref is not supported under the current context.
+ * @deprecated- abld support is deprecated
+ */
+ String getAbdlBuildArg(ISymbianBuildContext newParam);
+
+ /**
+ * Set the abld build setting from the Carbide build config arguments preference.
+ * This only works with the SBSv1 buider and has no effect on other builders.
+ * @param context
+ * @param arg
+ * @deprecated - abld support is deprecated
+ */
+ void setAbldBuildArg(ISymbianBuildContext context, String arg);
+}
diff -r 8f3d04a21ae9 -r 5f8982384793 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/CarbidePrefsModifier.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/CarbidePrefsModifier.java Fri Aug 13 17:35:50 2010 -0500
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.carbide.cdt.internal.api.builder.ui;
+
+import com.nokia.carbide.cdt.builder.extension.ICarbidePrefsModifier;
+import com.nokia.carbide.cpp.internal.api.sdk.BuildArgumentsInfo;
+import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildContext;
+import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
+
+public class CarbidePrefsModifier implements ICarbidePrefsModifier {
+
+ /**
+ * @deprecated
+ */
+ public String getAbdlBuildArg(ISymbianBuildContext context) {
+
+ if (context instanceof ISBSv1BuildContext){
+ BuildArgumentsInfo info = ((ISBSv1BuildContext)context).getBuildArgumentsInfoCopy();
+ return info.getAbldBuildArgs();
+ }
+
+ return null;
+ }
+
+ /**
+ * @deprecated
+ */
+ public void setAbldBuildArg(ISymbianBuildContext context, String arg) {
+ if (context instanceof ISBSv1BuildContext){
+ BuildArgumentsInfo info = ((ISBSv1BuildContext)context).getBuildArgumentsInfoCopy();
+ info.abldBuildArgs = arg;
+ ((ISBSv1BuildContext)context).setBuildArgumentsInfo(info);
+ }
+ }
+
+}
diff -r 8f3d04a21ae9 -r 5f8982384793 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildContext.java
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildContext.java Fri Aug 13 12:00:38 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/ISBSv1BuildContext.java Fri Aug 13 17:35:50 2010 -0500
@@ -52,7 +52,7 @@
/**
* Set the build arguments info for SBSv2 build arguments. This only sets values in memory, does
- * not write settings to disk. See
+ * not write settings to disk.
* @return IBuildArgumentsInfo instance, never null
* @deprecated
*/