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

Bug 356044

Summary: extra packages created when "import" from target as source folders
Product: [Eclipse Project] Platform Reporter: David Williams <david_williams>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3 CC: aniefer, remy.suen
Version: 4.2   
Target Milestone: 4.2 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
package explorer showing extra packages, such as src.org.eclipse.e4.core.commands
none
patch fixing build.properties for 4 projects none

Description David Williams CLA 2011-08-29 01:57:12 EDT
Created attachment 202294 [details]
package explorer showing extra packages, such as src.org.eclipse.e4.core.commands

In experimenting with different setups, I tried to to "import" from the current runtime target (which was Eclipse SDK Juno M1) checking "as source folders". (And, I selected all). 

Nearly all the "org.eclipse.e4..." bundles had compile errors, that appears to be due do many (or, all?) of the packages being created twice, once with the correct package name, and again prefixed by the segment 'src'. I'll attach a picture to be clear what I mean.
Comment 1 Remy Suen CLA 2011-08-29 06:21:09 EDT
I've seen this before also.
Comment 2 Remy Suen CLA 2011-09-01 10:01:11 EDT
Andrew, do you think this is a PDE problem or an issue with our 4.x build?
Comment 3 David Williams CLA 2011-09-02 01:40:46 EDT
Created attachment 202650 [details]
patch fixing build.properties for 4 projects

I'm fairly sure this is at least mostly a project-setup issue. I don't recall PDE actually importing incorrectly with previous versions, when this error was made ... but, the root problem (I think) is that the build.properties files specifies src/ folder (and other extraneous files) in the "src.includes" properties. This causes the source to (basically) be exported twice, once in "correct" jar format, and another in directory format. 

I've attached a patch which corrects a few of the e4 projects, but there's many others. (I've created and attached this patch as my first against Git ... and have no idea what I'm doing :) so feedback about the patch itself would be welcome.) 

These src-include problems actually show up as warning in the build.properties file. You can set workspace or project settings to show these kind of issues as errors, instead of warnings. I recommend the "project level" settings, and will open an enhancement request for these e4 projects to adopt that setting.
Comment 4 David Williams CLA 2011-09-02 02:50:14 EDT
Moving to platform UI. I suggest the changes be made to those UI/e4 plugins. 

(To be explicit, I personally am not worried about a "regression" in pde import since a) not sure there is one, and b) the build.properties is, after all, incorrect, and suppose it could be argued pde import is doing what its told :)
Comment 5 Remy Suen CLA 2011-10-12 08:27:17 EDT
Thanks for the heads-up, David. I've fixed the problem in most of the Eclipse 4 UI bundles I saw.

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_development&id=c4ae9ebb391a9e6ff25907b0434893ef114b2c68
Comment 6 Remy Suen CLA 2011-10-26 08:27:54 EDT
Looks good to me with I20111025-2000. Thanks for the reporting the bug and for providing the solution, David!