Bug 262746 - [jar exporter] Create a builder for jar-rsrc-loader.zip
Summary: [jar exporter] Create a builder for jar-rsrc-loader.zip
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Ferenc Hechler CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-28 08:30 EST by Markus Keller CLA
Modified: 2020-02-05 05:29 EST (History)
2 users (show)

See Also:


Attachments
Builder for jar-in-jar-loader.zip (38.68 KB, patch)
2009-02-02 16:15 EST, Ferenc Hechler CLA
no flags Details | Diff
Builder for jar-in-jar-loader.zip 20090204 (39.80 KB, patch)
2009-02-04 19:00 EST, Ferenc Hechler CLA
markus.kell.r: iplog+
Details | Diff
actually released patch (35.62 KB, patch)
2009-02-18 11:38 EST, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2009-01-28 08:30:47 EST
HEAD

We should create a builder for /org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/jar-rsrc-loader.zip and move the relevant files into a separate source folder. Look at 3.3 to see how this was done for the serial version computer.
Comment 1 Markus Keller CLA 2009-01-28 08:41:45 EST
The redistributable classes should also go into a separate package. This makes it easier to verify that they only reference code from the JRE.
Comment 2 Markus Keller CLA 2009-01-28 08:55:15 EST
Ferenc, could you provide a patch for this?
Comment 3 Ferenc Hechler CLA 2009-01-28 17:58:47 EST
Hello Markus,

could you please give me some hint where to find the serial version computer?

Currently there is an ANT build file (build_jar-rsrc-loader.xml) to create the ZIP from the following for files:

  JarRsrcLoader.java
  RsrcURLConnection.java
  RsrcUrlStreamHandler.java
  RsrcURLStreamHandlerFactory.java

Should I crete an own source-folder for theese files or should they only be placed into another package?

It should be easy to move theese files into a different package. I did not do this because of the META-INF/MANIFEST.MF which has to be patched then.

What do you mean with "builder".
Should the ZIP not be storeed as resource but created at runtime when exporting? What are the advantages?


Comment 4 Markus Keller CLA 2009-01-30 06:05:28 EST
> Should I crete an own source-folder for theese files or should they only be
> placed into another package?

A separate source folder and a different package name, e.g. org.eclipse.jdt.internal.nestedjarloader.

> could you please give me some hint where to find the serial version computer?
> What do you mean with "builder".

Check out the R3_3 tag of org.eclipse.jdt.ui. There, you see a source folder "serial support", and on Properties > Builder for the project, there's an Ant builder that automatically builds the serialsupport.jar whenever a class in that source folder is modified. The serial version computer has been rewritten for 3.4, but before, it also needed a specially-compiled Jar. See the patch at bug 169407 for the changes to remove the serial version computer.

> Should the ZIP not be storeed as resource but created at runtime when
> exporting? What are the advantages?
It should be create during auto-build. The advantage of this approach is that there's no manual build step (which is easy to forget).
Comment 5 Ferenc Hechler CLA 2009-02-02 16:15:05 EST
Created attachment 124472 [details]
Builder for jar-in-jar-loader.zip

I did my best to copy the code from the serial builder.   ;)

Renamed the file jar-rsrc-loader.zip into jar-in-jar-loader.zip.
The old file /org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/jar-rsrc-loader.zip has to be deleted manually, it is not deleted with the patch, because it is binary.

The jar-in-jar-loader.zip file is created now in the root folder of the org.eclipse.jdt.ui project automatically by the build process.

I was not able to start the scripts/exportplugin.xml ANT script, but test with runtime workspace where successfull. The jar in jar file was created correctly.

The ANT export did not create the ZIP file, but this is caused by some other reason (see bug 262766).
Comment 6 Ferenc Hechler CLA 2009-02-04 19:00:22 EST
Created attachment 124743 [details]
Builder for jar-in-jar-loader.zip 20090204

After some tries I got the plugin export running and the jar-in-jar-loader.zip file is included if the project has been built before starting the plugin export.

But does this work for the automated build process?
There is also a script/exportplugin.xml. What is this good for?

@Markus: Could you please take a look at the patch.
Comment 7 Ferenc Hechler CLA 2009-02-09 03:09:15 EST
Got the exportplugin.xml script running ("run in same jre as eclipse" has to be selected), but replacing the original jar file (in 3.5M5) with the exported plugin does not work.

Do I miss something? 
Has the JAR to be signed?
Comment 8 Ferenc Hechler CLA 2009-02-13 13:13:24 EST
finally found the problem:

in the ANT script exportplugin.xml the property "qualifier" has to be set to the correct version "v20090128-1300" instead of "zzz${DSTAMP}-${TSTAMP}".

After changing this property the generated jar file org.eclipse.jdt.ui_3.5.0.v20090128-1300.jar can be replaced successfully with the one in the Eclipse 3.5M5 plugins/ folder.

So both Test (Runtime Workbench and Plugin-Jar) where successful.   ;)


Comment 9 Markus Keller CLA 2009-02-18 11:36:17 EST
Thanks for the patch, released together with bug 262766 with a few tweaks:

- Removed org.eclipse.jdt.internal.ui.jarpackagerfat/jar-rsrc-loader.zip
- Renamed package to org.eclipse.jdt.internal.jarinjarloader
- Took a slightly different route to build the jar-in-jar-loader.zip. Unfortunately, the "source.jar-in-jar-loader = ..." in build.properties only worked in the UI, but not with PDE build (Export > Deployable...), since they don't build the Zip for us (and even if they would, the used compiler compliance would be the one from the plug-in and not the one we want in out build script).
Comment 10 Markus Keller CLA 2009-02-18 11:38:02 EST
Created attachment 126044 [details]
actually released patch