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 181027 Details for
Bug 327769
Support for directory based ant task libraries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
org.eclipse.ant.core-directory_based_ant_libraries_v2.patch
org.eclipse.ant.core-directory_based_ant_libraries_v2.patch (text/plain), 3.54 KB, created by
Michal Ruzicka
on 2010-10-15 19:45:09 EDT
(
hide
)
Description:
org.eclipse.ant.core-directory_based_ant_libraries_v2.patch
Filename:
MIME Type:
Creator:
Michal Ruzicka
Created:
2010-10-15 19:45:09 EDT
Size:
3.54 KB
patch
obsolete
>Index: src/org/eclipse/ant/core/AntCorePreferences.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java,v >retrieving revision 1.103.4.1 >diff -u -r1.103.4.1 AntCorePreferences.java >--- src/org/eclipse/ant/core/AntCorePreferences.java 4 Oct 2010 18:35:27 -0000 1.103.4.1 >+++ src/org/eclipse/ant/core/AntCorePreferences.java 15 Oct 2010 23:40:50 -0000 >@@ -595,6 +595,33 @@ > return result; > } > >+ /** >+ * Check if the path specified by the <code>library</code> parameter denotes the root of the bundle, which is >+ * defined as a string consisting of zero or more {@link IPath#SEPARATOR}s and nothing else. >+ * >+ * @param library >+ * the path to check >+ * @return <code>true</code> if the path specified by the <code>library</code> parameter denotes the root of the >+ * bundle, <code>false</code> otherwise >+ */ >+ private boolean isBundleRoot(String library) { >+ for (int i = library.length() - 1; i >= 0; --i) { >+ if(library.charAt(i) != IPath.SEPARATOR) { >+ return false; >+ } >+ } >+ return true; >+ } >+ >+ /* >+ * Create a "file:" URL for the specified File making sure the URL ends with a slash if the File denotes a directory. >+ */ >+ private URL getClasspathEntryURL(File file) throws MalformedURLException { >+ String absoluteFilePath = file.getAbsolutePath(); >+ StringBuffer urlString = new StringBuffer(absoluteFilePath.length() + 6).append("file:").append(absoluteFilePath); //$NON-NLS-1$ >+ return new URL((file.isDirectory() ? urlString.append(File.separatorChar) : urlString).toString()); >+ } >+ > private void configureAntObject(List result, IConfigurationElement element, AntObject antObject, String objectName, String errorMessage) { > String runtime = element.getAttribute(AntCorePlugin.ECLIPSE_RUNTIME); > if (runtime != null) { >@@ -617,10 +644,17 @@ > IContributor contributor= element.getContributor(); > antObject.setPluginLabel(contributor.getName()); > Bundle bundle = Platform.getBundle(contributor.getName()); >- URL url = FileLocator.toFileURL(bundle.getEntry(library)); >- File urlFile = new File(url.getPath()); >+ URL url; >+ File urlFile; >+ if(isBundleRoot(library)) { >+ urlFile = FileLocator.getBundleFile(bundle); >+ url = urlFile.toURI().toURL(); >+ } else { >+ url = FileLocator.toFileURL(bundle.getEntry(library)); >+ urlFile = new File(url.getPath()); >+ } > if (urlFile.exists()) { >- url = new URL("file:" + urlFile.getAbsolutePath()); //$NON-NLS-1$ >+ url = getClasspathEntryURL(urlFile); > addURLToExtraClasspathEntries(url, element); > result.add(antObject); > addPluginClassLoader(bundle); >@@ -657,10 +691,17 @@ > String library = element.getAttribute(AntCorePlugin.LIBRARY); > Bundle bundle = Platform.getBundle(element.getContributor().getName()); > try { >- URL url = FileLocator.toFileURL(bundle.getEntry(library)); >- File urlFile = new File(url.getPath()); >+ URL url; >+ File urlFile; >+ if(isBundleRoot(library)) { >+ urlFile = FileLocator.getBundleFile(bundle); >+ url = urlFile.toURI().toURL(); >+ } else { >+ url = FileLocator.toFileURL(bundle.getEntry(library)); >+ urlFile = new File(url.getPath()); >+ } > if (urlFile.exists()) { >- url = new URL("file:" + urlFile.getAbsolutePath()); //$NON-NLS-1$ >+ url = getClasspathEntryURL(urlFile); > addURLToExtraClasspathEntries(url, element); > addPluginClassLoader(bundle); > } else {
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 327769
:
180876
| 181027 |
182723