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 107012 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]
Fix
clipboard.txt (text/plain), 5.95 KB, created by
Curtis Windatt
on 2008-07-09 17:04:19 EDT
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2008-07-09 17:04:19 EDT
Size:
5.95 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.core >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 9 Jul 2008 21:00:02 -0000 >@@ -15,6 +15,7 @@ > import java.net.URL; > import java.util.*; > import org.eclipse.core.runtime.*; >+import org.eclipse.osgi.service.datalocation.Location; > import org.eclipse.osgi.service.resolver.BundleDescription; > import org.eclipse.pde.core.plugin.IPluginBase; > import org.eclipse.pde.core.plugin.IPluginModelBase; >@@ -46,27 +47,37 @@ > * to locate a bundles.info > */ > public static URL[] readBundlesTxt(String platformHome) { >- > 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) { >+ Location configLocation = Platform.getConfigurationLocation(); >+ if (configLocation == null) { >+ return null; >+ } >+ URL configURL = configLocation.getURL(); >+ if (configURL == null) { > return null; > } > >- File srcBundlesTxt = new File(configArea, SRC_BUNDLE_TXT_PATH); >- List srcBundles = getBundlesFromFile(srcBundlesTxt, basePath); >+ try { >+ URL bundlesTxt = new URL(configURL.getProtocol(), configURL.getHost(), configURL.getFile().concat(BUNDLE_TXT_PATH)); >+ List bundles = getBundlesFromFile(bundlesTxt, basePath); > >- if (srcBundles == null) { >- return (URL[]) bundles.toArray(new URL[bundles.size()]); >- } >+ if (bundles == null) { >+ return null; >+ } > >- bundles.addAll(srcBundles); >- return (URL[]) bundles.toArray(new URL[bundles.size()]); >+ URL srcBundlesTxt = new URL(configURL.getProtocol(), configURL.getHost(), configURL.getFile().concat(SRC_BUNDLE_TXT_PATH)); >+ List srcBundles = getBundlesFromFile(srcBundlesTxt, basePath); > >+ if (srcBundles != null) { >+ bundles.addAll(srcBundles); >+ } >+ return (URL[]) bundles.toArray(new URL[bundles.size()]); >+ >+ } catch (MalformedURLException e) { >+ PDECore.log(e); >+ return null; >+ } > } > > /** >@@ -75,23 +86,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 +158,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/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 9 Jul 2008 21:00:02 -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$ > } > > /**
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