Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 242627

Summary: Repository created from PDE export should be compressed
Product: [Eclipse Project] PDE Reporter: Andrew Niefer <aniefer>
Component: UIAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ankur_sharma, curtis.windatt.public, euneto
Version: 3.4   
Target Milestone: 3.5 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Andrew Niefer CLA 2008-07-30 16:05:18 EDT
+++ This bug was initially created as a clone of Bug #222962 +++

The repositories created by PDE Build should be compressed (See the -compress option of the generator). Note though that we don't want to change the compression mode of the repositories we exporting into if they were already existing before.

With bug 222962, pde/build now supports the "p2.compress" property in HEAD & 3.4.1

Use IBuildPropertiesConstants.PROPERTY_P2_COMPRESS.
Comment 1 Curtis Windatt CLA 2009-01-06 16:40:32 EST
This should be looked at in M6.  Re-assigning to myself for now, though Ankur may want to take a shot at it.
Comment 2 Ankur Sharma CLA 2009-01-08 13:01:58 EST
Curtis, am bit new to P2. Help me understand how to create a repository by PDE Build? Is it same as creating an update site project and invoking "Build Site" on site.xml?
Comment 3 Curtis Windatt CLA 2009-01-08 13:19:53 EST
p2 is new to everybody :)

We create p2 repositories during all of the export operations, which include plug-in export, feature export, feature export and update site building.  Most of the operations are run by going to File > Export > PDE > ... but there are other locations where the export can be access (build button on site.xml, export link on the top right of a product definition, etc.).

Note that in the code we often refer to creating the p2 repository as generating the metadata.

The code for the export is a hierarchy of classes in pde.core with FeatureExportOperation being the base.  In those classes we are setting up all of the properties that are required, then we pass those properties to PDE Build to perform the export.

For this bug, to turn on the compression, all that has to be done is add another property.  This will be done in the setP2MetadataProperties() method, probably in multiple classes as some override this method.

The harder part of this bug is checking if we are just appending to an existing repository (perhaps when exporting multiple times in a row).  Perhaps Andrew can help you determine how best to accomplish this.
Comment 4 Curtis Windatt CLA 2009-02-03 16:22:05 EST
Fixed in HEAD.  This was easier than expected because we are always doing it and PDE Build is smart enough to do the right thing if there is an existing repo.