diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/META-INF/MANIFEST.MF index b466b736a36..0ac3174a9b0 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/META-INF/MANIFEST.MF +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: GDB/MI reference application tests Bundle-SymbolicName: org.eclipse.cdt.tests.dsf.gdb;singleton:=true Bundle-Version: 2.1.0.qualifier -Bundle-Activator: org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin Bundle-Vendor: Ericsson Require-Bundle: org.eclipse.core.runtime, org.eclipse.cdt.dsf, @@ -12,9 +11,10 @@ Require-Bundle: org.eclipse.core.runtime, org.junit4, org.eclipse.debug.core, org.eclipse.swt, - org.eclipse.cdt.dsf.gdb, org.eclipse.cdt.launch;bundle-version="6.1.0", org.eclipse.cdt.gdb;bundle-version="7.0.0" Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-ClassPath: . +Fragment-Host: org.eclipse.cdt.dsf.gdb + diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/build.properties b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/build.properties index 475b3534530..5d3e3b9ad20 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/build.properties +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/build.properties @@ -10,7 +10,7 @@ # IBM Corporation ############################################################################### output.tests.jar = bin/ -bin.includes = plugin.xml,\ +bin.includes = fragment.xml,\ META-INF/,\ . source.. = src/ diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/plugin.xml b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/fragment.xml similarity index 96% rename from dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/plugin.xml rename to dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/fragment.xml index 36f07bfeb38..6b2ff607eab 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/plugin.xml +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/fragment.xml @@ -1,6 +1,6 @@ - + - \ No newline at end of file + \ No newline at end of file diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BackgroundRunner.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BackgroundRunner.java index f19d1028700..f3e75948128 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BackgroundRunner.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BackgroundRunner.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.tests.dsf.gdb.framework; -import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin; +import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.QualifiedName; @@ -31,7 +31,7 @@ public class BackgroundRunner extends BlockJUnit4ClassRunner { super(klass); } - final static QualifiedName BACKGROUND_TEST_EXECUTION_FINISHED = new QualifiedName(TestsPlugin.getDefault().getBundle().getSymbolicName(), "background_test_execution_finished"); //$NON-NLS-1$ + final static QualifiedName BACKGROUND_TEST_EXECUTION_FINISHED = new QualifiedName(GdbPlugin.getDefault().getBundle().getSymbolicName(), "background_test_execution_finished"); //$NON-NLS-1$ void invokeSuperRunImpl(RunNotifier notifier) { super.run(notifier); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java index 2a590d2a69e..893d8d726b9 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java @@ -34,6 +34,7 @@ import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; import org.eclipse.cdt.dsf.debug.service.IRunControl.StepType; import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext; import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService; +import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; import org.eclipse.cdt.dsf.mi.service.IMICommandControl; import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; import org.eclipse.cdt.dsf.mi.service.MIRunControl; @@ -504,12 +505,12 @@ public class SyncUtil { try { value = Integer.valueOf(value); if (value < 0) { - TestsPlugin.log(new Status(IStatus.ERROR, TestsPlugin.getUniqueIdentifier(), "\"" + propname + "\" property incorrectly specified. Should be an integer value or not specified at all.")); //$NON-NLS-1$ + TestsPlugin.log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "\"" + propname + "\" property incorrectly specified. Should be an integer value or not specified at all.")); //$NON-NLS-1$ value = -1; } } catch (NumberFormatException exc) { - TestsPlugin.log(new Status(IStatus.ERROR, TestsPlugin.getUniqueIdentifier(), "\"" + propname + "\" property incorrectly specified. Should be an integer value or not specified at all.")); //$NON-NLS-1$ + TestsPlugin.log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "\"" + propname + "\" property incorrectly specified. Should be an integer value or not specified at all.")); //$NON-NLS-1$ value = -1; } } diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/launching/TestsPlugin.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/launching/TestsPlugin.java index 08a55761e2e..d440d77d7a5 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/launching/TestsPlugin.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/launching/TestsPlugin.java @@ -13,23 +13,24 @@ package org.eclipse.cdt.tests.dsf.gdb.launching; import java.util.MissingResourceException; import java.util.ResourceBundle; +import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.osgi.framework.BundleContext; /** - * The main plugin class to be used in the desktop. + * This is no longer an activator class since this is no longer a plug-in. It's + * a fragment. */ -public class TestsPlugin extends Plugin { - //The shared instance. - private static TestsPlugin plugin; - //Resource bundle. +public class TestsPlugin { private ResourceBundle resourceBundle; - private static BundleContext bundleContext; - - public static final String PLUGIN_ID = "org.eclipse.cdt.tests.dsf.gdb"; //$NON-NLS-1$ + + /** + * We're no longer a plug-in, but a fragment. Make this field an alias + * to our host plugin's ID. + */ + public static final String PLUGIN_ID = GdbPlugin.PLUGIN_ID; /** Base tracing option for this plugin */ public static final boolean DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.cdt.tests.dsf.gdb/debug")); //$NON-NLS-1$//$NON-NLS-2$ @@ -39,7 +40,6 @@ public class TestsPlugin extends Plugin { */ public TestsPlugin() { super(); - plugin = this; try { resourceBundle = ResourceBundle.getBundle("org.eclipse.cdt.tests.dsf.gdb.TestsPluginResources"); //$NON-NLS-1$ } @@ -47,68 +47,28 @@ public class TestsPlugin extends Plugin { resourceBundle = null; } } + /** - * This method is called upon plug-in activation - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - bundleContext = context; - } - /** - * This method is called when the plug-in is stopped - */ - @Override - public void stop(BundleContext context) throws Exception { - super.stop(context); - } - /** - * Returns the shared instance. - */ - public static TestsPlugin getDefault() { - return plugin; - } - - /** - * Returns the string from the plugin's resource bundle, - * or 'key' if not found. - */ - public static String getResourceString(String key) { - ResourceBundle bundle = TestsPlugin.getDefault().getResourceBundle(); - try { - return (bundle != null) ? bundle.getString(key) : key; - } - catch (MissingResourceException e) { - return key; - } - } - /** - * Returns the plugin's resource bundle, + * Returns this fragment's resource bundle, */ public ResourceBundle getResourceBundle() { return resourceBundle; } /** - * Returns the plugin's bundle context, + * Returns the host plug-in's bundle context, */ public static BundleContext getBundleContext() { - return bundleContext; + return GdbPlugin.getBundleContext(); } - /** - * Convenience method which returns the unique identifier of this plugin. - */ - public static String getUniqueIdentifier() { - return getDefault().getBundle().getSymbolicName(); - } /** - * Logs the specified status with this plug-in's log. + * Logs the specified status with this host plug-in's log. * * @param status * status to log */ public static void log(IStatus status) { - getDefault().getLog().log(status); + GdbPlugin.getDefault().getLog().log(status); } /** @@ -118,7 +78,7 @@ public class TestsPlugin extends Plugin { * the exception to be logged */ public static void log( Throwable e ) { - log(new Status(IStatus.ERROR, getUniqueIdentifier(), "Internal Error", e)); //$NON-NLS-1$ + log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Internal Error", e)); //$NON-NLS-1$ } /** @@ -145,7 +105,7 @@ public class TestsPlugin extends Plugin { return (int)(timeoutMs * multiplier); } catch (NumberFormatException exc) { - log(new Status(IStatus.ERROR, getUniqueIdentifier(), "\"dsf.gdb.tests.timeout.multiplier\" property incorrectly specified. Should be a float value (e.g., \"1.5\") or not specified at all.")); //$NON-NLS-1$ + log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "\"dsf.gdb.tests.timeout.multiplier\" property incorrectly specified. Should be a float value (e.g., \"1.5\") or not specified at all.")); //$NON-NLS-1$ return timeoutMs; } }