Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 18372 Details for
Bug 78588
Enhance PluginConverter API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed solution
PluginConverter.patch (text/plain), 14.21 KB, created by
Thomas Watson
on 2005-02-28 17:47:31 EST
(
hide
)
Description:
Proposed solution
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2005-02-28 17:47:31 EST
Size:
14.21 KB
patch
obsolete
>Index: defaultAdaptor/src/org/eclipse/osgi/framework/internal/defaultadaptor/DevClassPathHelper.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/framework/internal/defaultadaptor/DevClassPathHelper.java,v >retrieving revision 1.6 >diff -u -r1.6 DevClassPathHelper.java >--- defaultAdaptor/src/org/eclipse/osgi/framework/internal/defaultadaptor/DevClassPathHelper.java 21 Feb 2005 23:09:54 -0000 1.6 >+++ defaultAdaptor/src/org/eclipse/osgi/framework/internal/defaultadaptor/DevClassPathHelper.java 28 Feb 2005 22:43:54 -0000 >@@ -17,30 +17,30 @@ > import java.util.*; > > public class DevClassPathHelper { >- static protected boolean inDevelopmentMode = false; >- static protected String[] devDefaultClasspath; >- static protected Properties devProperties = null; >+ static protected boolean _inDevelopmentMode = false; >+ static protected String[] _devDefaultClasspath; >+ static protected Dictionary _devProperties = null; > > static { > // Check the osgi.dev property to see if dev classpath entries have been defined. > String osgiDev = System.getProperty("osgi.dev"); //$NON-NLS-1$ > if (osgiDev != null) { > try { >- inDevelopmentMode = true; >+ _inDevelopmentMode = true; > URL location = new URL(osgiDev); >- devProperties = load(location); >- if (devProperties != null) >- devDefaultClasspath = getArrayFromList(devProperties.getProperty("*")); //$NON-NLS-1$ >+ _devProperties = load(location); >+ if (_devProperties != null) >+ _devDefaultClasspath = getArrayFromList((String) _devProperties.get("*")); //$NON-NLS-1$ > } catch (MalformedURLException e) { >- devDefaultClasspath = getArrayFromList(osgiDev); >+ _devDefaultClasspath = getArrayFromList(osgiDev); > } > } > } > >- public static String[] getDevClassPath(String id) { >+ private static String[] getDevClassPath(String id, Dictionary devProperties, String[] devDefaultClasspath) { > String[] result = null; > if (id != null && devProperties != null) { >- String entry = devProperties.getProperty(id); >+ String entry = (String) devProperties.get(id); > if (entry != null) > result = getArrayFromList(entry); > } >@@ -49,6 +49,16 @@ > return result; > } > >+ public static String[] getDevClassPath(String id, Dictionary devProperties) { >+ if (devProperties == null) >+ return getDevClassPath(id, _devProperties, _devDefaultClasspath); >+ return getDevClassPath(id, devProperties, getArrayFromList((String) devProperties.get("*"))); //$NON-NLS-1$ >+ } >+ >+ public static String[] getDevClassPath(String id) { >+ return getDevClassPath(id, null); >+ } >+ > /** > * Returns the result of converting a list of comma-separated tokens into an array > * >@@ -69,7 +79,7 @@ > } > > public static boolean inDevelopmentMode() { >- return inDevelopmentMode; >+ return _inDevelopmentMode; > } > > /* >Index: eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseBundleData.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseBundleData.java,v >retrieving revision 1.54 >diff -u -r1.54 EclipseBundleData.java >--- eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseBundleData.java 23 Feb 2005 14:23:45 -0000 1.54 >+++ eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseBundleData.java 28 Feb 2005 22:43:54 -0000 >@@ -244,7 +244,7 @@ > > Dictionary generatedManifest; > try { >- generatedManifest = converter.convertManifest(getBaseFile(), true, null, true); >+ generatedManifest = converter.convertManifest(getBaseFile(), true, null, true, null); > } catch (PluginConversionException pce) { > String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_CONVERTING, getBaseFile()); //$NON-NLS-1$ > throw new BundleException(message, pce); //$NON-NLS-1$ >Index: eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/PluginConverterImpl.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/PluginConverterImpl.java,v >retrieving revision 1.75 >diff -u -r1.75 PluginConverterImpl.java >--- eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/PluginConverterImpl.java 23 Feb 2005 14:23:45 -0000 1.75 >+++ eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/PluginConverterImpl.java 28 Feb 2005 22:43:55 -0000 >@@ -43,6 +43,7 @@ > private Dictionary generatedManifest; > private byte manifestType; > private String target; >+ private Dictionary devProperties; > static final String TARGET31 = "3.1"; //$NON-NLS-1$ > private static final String MANIFEST_VERSION = "Manifest-Version"; //$NON-NLS-1$ > private static final String PLUGIN_PROPERTIES_FILENAME = "plugin"; //$NON-NLS-1$ >@@ -80,6 +81,7 @@ > generatedManifest = new Hashtable(10); > manifestType = EclipseBundleData.MANIFEST_TYPE_UNKNOWN; > target = null; >+ devProperties = null; > } > > private void fillPluginInfo(File pluginBaseLocation) throws PluginConversionException { >@@ -396,8 +398,8 @@ > return null; > > //If we are in dev mode, then add the binary folders on the list libs with the export clause set to be the cumulation of the export clause of the real libs >- if (DevClassPathHelper.inDevelopmentMode()) { >- String[] devClassPath = DevClassPathHelper.getDevClassPath(pluginInfo.getUniqueId()); >+ if (devProperties != null || DevClassPathHelper.inDevelopmentMode()) { >+ String[] devClassPath = DevClassPathHelper.getDevClassPath(pluginInfo.getUniqueId(), devProperties); > > // collect export clauses > List allExportClauses = new ArrayList(libs.size()); >@@ -421,7 +423,7 @@ > continue; > String libEntryText = (String) element.getKey(); > File libraryLocation; >- if (DevClassPathHelper.inDevelopmentMode()) { >+ if (devProperties != null || DevClassPathHelper.inDevelopmentMode()) { > // in development time, libEntries may contain absolute locations (linked folders) > File libEntryAsPath = new File(libEntryText); > libraryLocation = libEntryAsPath.isAbsolute() ? libEntryAsPath : new File(pluginManifestLocation, libEntryText); >@@ -654,31 +656,35 @@ > return result.toString(); > } > >- public synchronized Dictionary convertManifest(File pluginBaseLocation, boolean compatibility, String target, boolean analyseJars) throws PluginConversionException { >+ public synchronized Dictionary convertManifest(File pluginBaseLocation, boolean compatibility, String target, boolean analyseJars, Dictionary devProperties) throws PluginConversionException { > if (DEBUG) > System.out.println("Convert " + pluginBaseLocation); //$NON-NLS-1$ > init(); > this.target = target == null ? TARGET31 : target; >+ this.devProperties = devProperties; > fillPluginInfo(pluginBaseLocation); > fillManifest(compatibility, analyseJars); > return generatedManifest; > } > >- public synchronized File convertManifest(File pluginBaseLocation, File bundleManifestLocation, boolean compatibilityManifest, String target, boolean analyseJars) throws PluginConversionException { >- if (DEBUG) >- System.out.println("Convert " + pluginBaseLocation); //$NON-NLS-1$ >- init(); >- this.target = target == null ? TARGET31 : target; >- fillPluginInfo(pluginBaseLocation); >+ public synchronized Dictionary convertManifest(File pluginBaseLocation, boolean compatibility, String target, boolean analyseJars) throws PluginConversionException { >+ return convertManifest(pluginBaseLocation, compatibility, target, analyseJars, null); >+ } >+ >+ public synchronized File convertManifest(File pluginBaseLocation, File bundleManifestLocation, boolean compatibilityManifest, String target, boolean analyseJars, Dictionary devProperties) throws PluginConversionException { >+ convertManifest(pluginBaseLocation, compatibilityManifest, target, analyseJars, devProperties); > if (bundleManifestLocation == null) { > String cacheLocation = (String) System.getProperties().get(LocationManager.PROP_MANIFEST_CACHE); > bundleManifestLocation = new File(cacheLocation, pluginInfo.getUniqueId() + '_' + pluginInfo.getVersion() + ".MF"); //$NON-NLS-1$ > } >- fillManifest(compatibilityManifest, analyseJars); > if (upToDate(bundleManifestLocation, pluginManifestLocation, manifestType)) > return bundleManifestLocation; > writeManifest(bundleManifestLocation, generatedManifest, compatibilityManifest); > return bundleManifestLocation; >+ } >+ >+ public synchronized File convertManifest(File pluginBaseLocation, File bundleManifestLocation, boolean compatibilityManifest, String target, boolean analyseJars) throws PluginConversionException { >+ return convertManifest(pluginBaseLocation, bundleManifestLocation, compatibilityManifest, target, analyseJars, null); > } > > private String getVersionRange(String reqVersion, String matchRule) { >Index: eclipseAdaptor/src/org/eclipse/osgi/service/pluginconversion/PluginConverter.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/osgi/service/pluginconversion/PluginConverter.java,v >retrieving revision 1.13 >diff -u -r1.13 PluginConverter.java >--- eclipseAdaptor/src/org/eclipse/osgi/service/pluginconversion/PluginConverter.java 21 Feb 2005 23:09:54 -0000 1.13 >+++ eclipseAdaptor/src/org/eclipse/osgi/service/pluginconversion/PluginConverter.java 28 Feb 2005 22:43:55 -0000 >@@ -29,13 +29,33 @@ > * in backward compatibility > * @param target a string indicating the version of the runtime for which the manifest generated is targeted > * @param analyseJars a boolean indicating if the code jars of the given plugin must be analysed. When set to false the provided-package har >- * @return the generated manifest file location, if a bundle manifest was successfully >+ * @return the generated manifest file location, if a bundle manifest was successfully > * generated (or already existed), <code>null</code> otherwise. >+ * @deprecated use {@link #convertManifest(File, File, boolean, String, boolean, Dictionary)} > */ > public File convertManifest(File pluginBaseLocation, File bundleManifestLocation, boolean compatibilityManifest, String target, boolean analyseJars) throws PluginConversionException; > > /** > * Converts a plug-in/fragment manifest at the given source base location (a directory) and >+ * generates a corresponding bundle manifest at the given default target locaton (a file). >+ * >+ * @param pluginBaseLocation the base location for the plug-in/fragment manifest to be converted >+ * (a directory, e.g. the plug-in install location) >+ * @param bundleManifestLocation the location for the bundle manifest to be generated >+ * (including the file name). >+ * @param compatibilityManifest a boolean indicating if the manifest should contain headers to run >+ * in backward compatibility >+ * @param target a string indicating the version of the runtime for which the manifest generated is targeted >+ * @param analyseJars a boolean indicating if the code jars of the given plugin must be analysed. When set to false the provided-package har >+ * @param devProperties a dictionary of development time classpath properties. The dictionary contains a mapping from plugin id to development >+ * time classpath. A value of <code>null</code> indicates that the default development time classpath properties will be used. >+ * @return the generated manifest file location, if a bundle manifest was successfully >+ * generated (or already existed), <code>null</code> otherwise. >+ */ >+ public File convertManifest(File pluginBaseLocation, File bundleManifestLocation, boolean compatibilityManifest, String target, boolean analyseJars, Dictionary devProperties) throws PluginConversionException; >+ >+ /** >+ * Converts a plug-in/fragment manifest at the given source base location (a directory) and > * generates a corresponding bundle manifest returned as a dictionary. > * > * @param pluginBaseLocation the base location for the plug-in/fragment manifest to be converted >@@ -44,11 +64,28 @@ > * in backward compatibility > * @param target a string indicating the version of the runtime for which the manifest generated is targeted > * @param analyseJars a boolean indicating if the code jars of the given plugin must be analysed. When set to false the provided-package har >- * @return the generated manifest as a dictionary, if a bundle manifest was successfully >+ * @return the generated manifest as a dictionary, if a bundle manifest was successfully > * generated, <code>null</code> otherwise >+ * @deprecated use {@link #convertManifest(File, boolean, String, boolean, Dictionary)} > */ > public Dictionary convertManifest(File pluginBaseLocation, boolean compatibility, String target, boolean analyseJars) throws PluginConversionException; > >+ /** >+ * Converts a plug-in/fragment manifest at the given source base location (a directory) and >+ * generates a corresponding bundle manifest returned as a dictionary. >+ * >+ * @param pluginBaseLocation the base location for the plug-in/fragment manifest to be converted >+ * (a directory, e.g. the plug-in install location) >+ * @param compatibility a boolean indicating if the manifest should contain headers to run >+ * in backward compatibility >+ * @param target a string indicating the version of the runtime for which the manifest generated is targeted >+ * @param analyseJars a boolean indicating if the code jars of the given plugin must be analysed. When set to false the provided-package har >+ * @param devProperties a dictionary of development time classpath properties. The dictionary contains a mapping from plugin id to development >+ * time classpath. A value of <code>null</code> indicates that the default development time classpath properties will be used. >+ * @return the generated manifest as a dictionary, if a bundle manifest was successfully >+ * generated, <code>null</code> otherwise >+ */ >+ public Dictionary convertManifest(File pluginBaseLocation, boolean compatibility, String target, boolean analyseJars, Dictionary devProperties) throws PluginConversionException; > /** > * Write the dictionary into the specified location. > * @param generationLocation the location for the bundle manifest to be written
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 78588
: 18372 |
18467