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

Bug 311394

Summary: Download source bundles together with binaries
Product: z_Archived Reporter: Carsten Reckord <reckord>
Component: BuckminsterAssignee: buckminster.core-inbox <buckminster.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: thomas
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 312582    
Attachments:
Description Flags
add source dependencies to bundles thomas: iplog+

Description Carsten Reckord CLA 2010-05-03 13:02:13 EDT
Buckminster should support an option akin to maven's downloadSources that causes the resolution to include the matching source bundles for binary p2 bundles.

Currently, a buckminster provisioned target platform is not much use outside of an automated build process, because the lack of sources makes debugging etc rather painful. 

Running an additional query to get the appropriate source bundles also doesn't seem to be an option, because 
a) needing an additional query is rather unattractive, 
b) it's hard to guarantee that the source and binary bundle versions match when we have to run 2 separate materializations and 
c) in bucky 3.6 neither the source="true" provider option nor the deprecated ?importType=source seem to cause buckminster to download source packages from a p2 repository and install them into the target platform (which probably deserves its own ticket?).

I would suggest adding an optional synthetic dependency from each bundle (e.g. org.example.bundle#1.2.3.v201005031833) to its corresponding source bundle (org.example.bundle.source#1.2.3.v201005031833) and controlling their download with an additional filter expression on property buckminster.include.sources=true.
Comment 1 Carsten Reckord CLA 2010-05-03 13:13:08 EDT
Created attachment 166810 [details]
add source dependencies to bundles

First shot at an implementation.

I would've liked to only add the dependency if the property is set, but the CspecBuilder doesn't seem to have access to the properties.

Maybe it would also be nice to add the source bundle as bundle.source.jar to the materialized component's CSpec in CSpecFromBinary, but I have no idea how to check with the TP if the source bundle exists there.
Comment 2 Thomas Hallgren CLA 2010-05-06 07:58:01 EDT
This looks very interesting. I'm ready to commit it. Is it OK if I add this to the copyright notice?

 * Contributors:
 * - Cloudsmith Inc - initial API and implementation.
 * - Carsten Reckord, Yatta Solutions GmbH - Synthetic source bundle dependencies
Comment 3 Carsten Reckord CLA 2010-05-07 09:19:12 EDT
Hi Thomas,

That's great. Sure, go ahead. I'd have happily given my okay without attribution, but I won't say no to that either ;)
Comment 4 Thomas Hallgren CLA 2010-05-12 06:00:07 EDT
Comment on attachment 166810 [details]
add source dependencies to bundles

Released to trunk, revision 11426.
Comment 5 Thomas Hallgren CLA 2010-05-12 06:54:25 EDT
.