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 107084 Details for
Bug 235336
[p2] cannot compile against plugins referenced via .link files
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]
Updated Fix
clipboard.txt (text/plain), 8.84 KB, created by
Curtis Windatt
on 2008-07-10 10:45:15 EDT
(
hide
)
Description:
Updated Fix
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2008-07-10 10:45:15 EDT
Size:
8.84 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/TargetWeaver.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/TargetWeaver.java,v >retrieving revision 1.2 >diff -u -r1.2 TargetWeaver.java >--- src/org/eclipse/pde/internal/core/TargetWeaver.java 24 Apr 2008 08:37:55 -0000 1.2 >+++ src/org/eclipse/pde/internal/core/TargetWeaver.java 10 Jul 2008 14:42:36 -0000 >@@ -15,10 +15,8 @@ > import java.net.URL; > import java.util.*; > import java.util.Map.Entry; >-import org.eclipse.core.runtime.Path; > import org.eclipse.core.runtime.Platform; > import org.eclipse.pde.core.plugin.IPluginModelBase; >-import org.eclipse.pde.core.plugin.TargetPlatform; > import org.osgi.framework.Constants; > > /** >@@ -40,11 +38,6 @@ > private static String fgDevPropertiesURL = null; > > /** >- * Location of configuration area >- */ >- private static String fgConfigAreaURL = null; >- >- /** > * Property file corresponding to dev.properties > */ > private static Properties fgDevProperties = null; >@@ -56,39 +49,7 @@ > fgIsDev = Platform.inDevelopmentMode(); > if (fgIsDev) { > fgDevPropertiesURL = System.getProperty("osgi.dev"); //$NON-NLS-1$ >- fgConfigAreaURL = System.getProperty("osgi.configuration.area"); //$NON-NLS-1$ >- } >- } >- >- /** >- * Returns the configuration area for the platform as a directory. The default >- * location is the 'configuration' directory in the home location but can be >- * overridden with the -configuration command line argument. >- * >- * @param platformHome absolute path in the local file system to an installation >- * @return configuration area >- */ >- public static File getConfigurationArea(String platformHome) { >- // only weave in development mode >- if (fgIsDev && fgConfigAreaURL != null) { >- if (new Path(platformHome).equals(new Path(TargetPlatform.getDefaultLocation()))) { >- // only point to dev config area for default target platform >- try { >- URL url = new URL(fgConfigAreaURL); >- String file = url.getFile(); >- if (file != null && file.length() > 0) { >- File area = new File(file); >- if (area != null && area.exists()) { >- return area; >- } >- } >- } catch (MalformedURLException e) { >- PDECore.log(e); >- } >- } > } >- // default >- return new File(platformHome, "configuration"); //$NON-NLS-1$ > } > > /** >Index: src/org/eclipse/pde/internal/core/P2Utils.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/P2Utils.java,v >retrieving revision 1.10 >diff -u -r1.10 P2Utils.java >--- src/org/eclipse/pde/internal/core/P2Utils.java 30 May 2008 14:21:35 -0000 1.10 >+++ src/org/eclipse/pde/internal/core/P2Utils.java 10 Jul 2008 14:42:36 -0000 >@@ -37,36 +37,42 @@ > /** > * Returns bundles defined by the 'bundles.info' file in the > * specified location, or <code>null</code> if none. The "bundles.info" file >- * is assumed to be at a fixed relative location to the specified file. This >- * method will also look for a "source.info". If available, any source >- * bundles found will also be added to the returned list. >+ * is assumed to be at a fixed location relative to the configuration area URL. >+ * This method will also look for a "source.info". If available, any source >+ * bundles found will also be added to the returned list. If bundle URLs found >+ * in the bundles.txt are relative, they will be appended to platformHome to >+ * make them absolute. > * > * @param platformHome absolute path in the local file system to an installation >+ * @param configurationArea url location of the configuration directory to search for bundles.info and source.info > * @return URLs of all bundles in the installation or <code>null</code> if not able > * to locate a bundles.info > */ >- public static URL[] readBundlesTxt(String platformHome) { >- >+ public static URL[] readBundlesTxt(String platformHome, URL configurationArea) { > Path basePath = new Path(platformHome); >- >- File configArea = TargetWeaver.getConfigurationArea(platformHome); >- File bundlesTxt = new File(configArea, BUNDLE_TXT_PATH); >- List bundles = getBundlesFromFile(bundlesTxt, basePath); >- >- if (bundles == null) { >+ if (configurationArea == null) { > return null; > } >+ try { >+ URL bundlesTxt = new URL(configurationArea.getProtocol(), configurationArea.getHost(), configurationArea.getFile().concat(BUNDLE_TXT_PATH)); >+ List bundles = getBundlesFromFile(bundlesTxt, basePath); >+ >+ if (bundles == null) { >+ return null; >+ } > >- File srcBundlesTxt = new File(configArea, SRC_BUNDLE_TXT_PATH); >- List srcBundles = getBundlesFromFile(srcBundlesTxt, basePath); >+ URL srcBundlesTxt = new URL(configurationArea.getProtocol(), configurationArea.getHost(), configurationArea.getFile().concat(SRC_BUNDLE_TXT_PATH)); >+ List srcBundles = getBundlesFromFile(srcBundlesTxt, basePath); > >- if (srcBundles == null) { >+ if (srcBundles != null) { >+ bundles.addAll(srcBundles); >+ } > return (URL[]) bundles.toArray(new URL[bundles.size()]); >- } >- >- bundles.addAll(srcBundles); >- return (URL[]) bundles.toArray(new URL[bundles.size()]); > >+ } catch (MalformedURLException e) { >+ PDECore.log(e); >+ return null; >+ } > } > > /** >@@ -75,23 +81,14 @@ > * Returns a list of URL locations, one for each bundle entry or <code> > * null</code> if there is a problem reading the file. > * >- * @param file the file to read >+ * @param file the URL of the file to read > * @param basePath the path describing the base location of the platform install > * @return list containing URL locations or <code>null</code> > */ >- private static List getBundlesFromFile(File file, Path basePath) { >- if (!file.exists()) { >- return null; >- } >- URL url = null; >- try { >- url = file.toURL(); >- } catch (MalformedURLException e) { >- return null; >- } >+ private static List getBundlesFromFile(URL fileURL, Path basePath) { > List bundles = new ArrayList(); > try { >- BufferedReader r = new BufferedReader(new InputStreamReader(url.openStream())); >+ BufferedReader r = new BufferedReader(new InputStreamReader(fileURL.openStream())); > > String line; > try { >@@ -156,8 +153,10 @@ > } > } > } catch (MalformedURLException e) { >+ PDECore.log(e); > return null; > } catch (IOException e) { >+ PDECore.log(e); > return null; > } > return bundles; >Index: src/org/eclipse/pde/internal/core/PluginPathFinder.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PluginPathFinder.java,v >retrieving revision 1.29 >diff -u -r1.29 PluginPathFinder.java >--- src/org/eclipse/pde/internal/core/PluginPathFinder.java 22 Apr 2008 03:46:18 -0000 1.29 >+++ src/org/eclipse/pde/internal/core/PluginPathFinder.java 10 Jul 2008 14:42:36 -0000 >@@ -17,6 +17,7 @@ > import org.eclipse.core.runtime.*; > import org.eclipse.core.variables.IStringVariableManager; > import org.eclipse.core.variables.VariablesPlugin; >+import org.eclipse.osgi.service.datalocation.Location; > import org.eclipse.pde.core.plugin.TargetPlatform; > import org.eclipse.update.configurator.ConfiguratorUtils; > import org.eclipse.update.configurator.IPlatformConfiguration; >@@ -85,14 +86,34 @@ > } > > public static URL[] getPluginPaths(String platformHome) { >+ // If we don't care about installed bundles, simply scan the location > Preferences store = PDECore.getDefault().getPluginPreferences(); > if (!store.getBoolean(ICoreConstants.TARGET_PLATFORM_REALIZATION)) > return scanLocations(getSites(platformHome, false)); > >- URL[] urls = P2Utils.readBundlesTxt(platformHome); >+ // See if we can find a bundles.info to get installed bundles from >+ URL[] urls = null; >+ if (new Path(platformHome).equals(new Path(TargetPlatform.getDefaultLocation()))) { >+ // Pointing at default install, so use the actual configuration area >+ Location configArea = Platform.getConfigurationLocation(); >+ if (configArea != null) { >+ urls = P2Utils.readBundlesTxt(platformHome, configArea.getURL()); >+ } >+ } else { >+ // Pointing at a folder, so try to guess the configuration area >+ File configurationArea = new File(platformHome, "configuration"); //$NON-NLS-1$ >+ if (configurationArea.exists()) { >+ try { >+ urls = P2Utils.readBundlesTxt(platformHome, configurationArea.toURL()); >+ } catch (MalformedURLException e) { >+ PDECore.log(e); >+ } >+ } >+ } > if (urls != null) { > return urls; > } >+ > if (new Path(platformHome).equals(new Path(TargetPlatform.getDefaultLocation())) && !isDevLaunchMode()) > return ConfiguratorUtils.getCurrentPlatformConfiguration().getPluginPath(); >
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 235336
:
104899
|
107012
|
107013
| 107084