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 109283 Details for
Bug 243163
[jar exporter] export directory entries in "Runnable JAR File"
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]
patch to export directories into runnable JARs
fix_243163_20080806.txt (text/plain), 7.57 KB, created by
Ferenc Hechler
on 2008-08-06 05:50:04 EDT
(
hide
)
Description:
patch to export directories into runnable JARs
Filename:
MIME Type:
Creator:
Ferenc Hechler
Created:
2008-08-06 05:50:04 EDT
Size:
7.57 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui.tests >Index: ui/org/eclipse/jdt/ui/tests/jarexport/FatJarExportTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/jarexport/FatJarExportTests.java,v >retrieving revision 1.4 >diff -u -r1.4 FatJarExportTests.java >--- ui/org/eclipse/jdt/ui/tests/jarexport/FatJarExportTests.java 8 May 2008 15:34:48 -0000 1.4 >+++ ui/org/eclipse/jdt/ui/tests/jarexport/FatJarExportTests.java 6 Aug 2008 09:40:17 -0000 >@@ -10,6 +10,7 @@ > * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar > * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 213638 [jar exporter] create ANT build file for current settings > * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 220257 [jar application] ANT build file does not create Class-Path Entry in Manifest >+ * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 243163 [jar exporter] export directory entries in "Runnable JAR File" > *******************************************************************************/ > package org.eclipse.jdt.ui.tests.jarexport; > >@@ -207,6 +208,7 @@ > JarPackageData data= new JarPackageData(); > data.setJarBuilder(new FatJarBuilder()); > data.setOverwrite(true); >+ data.setIncludeDirectoryEntries(true); > > IPath destination= ResourcesPlugin.getWorkspace().getRoot().getLocation().append(testName + ".jar"); > data.setJarLocation(destination); >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/ui/jarpackager/JarWriter3.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter3.java,v >retrieving revision 1.25 >diff -u -r1.25 JarWriter3.java >--- ui/org/eclipse/jdt/ui/jarpackager/JarWriter3.java 14 May 2008 12:25:55 -0000 1.25 >+++ ui/org/eclipse/jdt/ui/jarpackager/JarWriter3.java 6 Aug 2008 09:40:19 -0000 >@@ -8,6 +8,7 @@ > * Contributors: > * IBM Corporation - initial API and implementation > * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar >+ * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 243163 [jar exporter] export directory entries in "Runnable JAR File" > *******************************************************************************/ > package org.eclipse.jdt.ui.jarpackager; > >@@ -117,19 +118,28 @@ > throw JarPackagerUtil.createCoreException(exception.getLocalizedMessage(), exception); > } > } >- >+ > /** >- * Creates the directory entries for the given path and writes it to the >- * current archive. >+ * Creates the directory entries for the given path and writes it to the current archive. Calls >+ * addDirectories(String). > * >- * @param destinationPath >- * the path to add >+ * @param destinationPath the path to add > * >- * @throws IOException >- * if an I/O error has occurred >+ * @throws IOException if an I/O error has occurred > */ > protected void addDirectories(IPath destinationPath) throws IOException { >- String path= destinationPath.toString().replace(File.separatorChar, '/'); >+ addDirectories(destinationPath.toString()); >+ } >+ >+ /** >+ * Creates the directory entries for the given path and writes it to the current archive. >+ * >+ * @param destPath the path to add >+ * >+ * @throws IOException if an I/O error has occurred >+ */ >+ protected void addDirectories(String destPath) throws IOException { >+ String path= destPath.replace(File.separatorChar, '/'); > int lastSlash= path.lastIndexOf('/'); > List directories= new ArrayList(2); > while (lastSlash != -1) { >Index: ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizard.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizard.java,v >retrieving revision 1.2 >diff -u -r1.2 FatJarPackageWizard.java >--- ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizard.java 22 Feb 2008 10:33:54 -0000 1.2 >+++ ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizard.java 6 Aug 2008 09:40:18 -0000 >@@ -9,6 +9,7 @@ > * IBM Corporation - initial API and implementation > * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar > * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 213638 [jar exporter] create ANT build file for current settings >+ * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 243163 [jar exporter] export directory entries in "Runnable JAR File" > *******************************************************************************/ > package org.eclipse.jdt.internal.ui.jarpackagerfat; > >@@ -167,6 +168,7 @@ > public void init(IWorkbench workbench, IStructuredSelection selection) { > fSelection= getSelectedJavaProjects(); > fJarPackage= new JarPackageData(); >+ fJarPackage.setIncludeDirectoryEntries(true); > setInitializeFromJarPackage(false); > setWindowTitle(FatJarPackagerMessages.JarPackageWizard_windowTitle); > setDefaultPageImageDescriptor(JavaPluginImages.DESC_WIZBAN_FAT_JAR_PACKAGER); >Index: ui/org/eclipse/jdt/internal/ui/jarpackagerfat/JarWriter4.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/JarWriter4.java,v >retrieving revision 1.4 >diff -u -r1.4 JarWriter4.java >--- ui/org/eclipse/jdt/internal/ui/jarpackagerfat/JarWriter4.java 8 May 2008 15:34:46 -0000 1.4 >+++ ui/org/eclipse/jdt/internal/ui/jarpackagerfat/JarWriter4.java 6 Aug 2008 09:40:19 -0000 >@@ -9,6 +9,7 @@ > * IBM Corporation - initial API and implementation > * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar > * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 220257 [jar application] ANT build file does not create Class-Path Entry in Manifest >+ * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 243163 [jar exporter] export directory entries in "Runnable JAR File" > *******************************************************************************/ > package org.eclipse.jdt.internal.ui.jarpackagerfat; > >@@ -19,7 +20,6 @@ > import java.util.zip.ZipEntry; > import java.util.zip.ZipFile; > >-import org.eclipse.core.runtime.Assert; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.Path; >@@ -48,6 +48,8 @@ > } > > public void addZipEntry(ZipEntry zipEntry, ZipFile zipFile, String path) throws IOException { >+ if (fJarPackage.areDirectoryEntriesIncluded()) >+ addDirectories(path); > JarEntry newEntry= new JarEntry(path.replace(File.separatorChar, '/')); > > if (fJarPackage.isCompressed()) >@@ -69,8 +71,6 @@ > > public void write(File file, IPath destinationPath) throws CoreException { > try { >- Assert.isLegal(!fJarPackage.areDirectoryEntriesIncluded());//Fat JAR writer does not include directory entries >- > addFile(file, destinationPath); > } catch (IOException ex) { > // Ensure full path is visible >@@ -86,6 +86,8 @@ > } > > private void addFile(File file, IPath path) throws IOException { >+ if (fJarPackage.areDirectoryEntriesIncluded()) >+ addDirectories(path); > JarEntry newEntry= new JarEntry(path.toString().replace(File.separatorChar, '/')); > > if (fJarPackage.isCompressed())
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
Flags:
daniel_megert
:
iplog+
daniel_megert
:
review+
Actions:
View
|
Diff
Attachments on
bug 243163
: 109283