Bug 464733 - Ignore launches from derived folders
Summary: Ignore launches from derived folders
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: consistency, helpwanted
Depends on:
Blocks:
 
Reported: 2015-04-15 14:03 EDT by Dave Dyer CLA
Modified: 2018-01-13 16:58 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Dyer CLA 2015-04-15 14:03:51 EDT
I discovered accidentally that you can embed .launch files with individual
projects, and if you do, clicking right on them presents the "debug as" and 
"run as" actions.

This is a great start, but if you use these launches, the global list of
launches becomes confused and confusing.  The per-project launches seem
to appear twice in the global launch list.

Also, opening the .launches associated with the project defaults to opening
with an XML editor, and there seems to be no way to choose the usual .launch
editor. (you can edit them by choosing one of the duplicated entries out of
the global launch list).

Please make these per-project launches into first class citizens.
Comment 1 Sarika Sinha CLA 2015-04-16 05:46:44 EDT
You can see a related enhancement which is being worked upon : Bug 461889.
Comment 2 Dave Dyer CLA 2017-03-29 14:29:52 EDT
This continues to be really annoying.   I keep .launch files
in the source hierarchy, so they are associated with the sources
and source control.  However, all of these launches appear twice
in the list of launches.   

I investigated a little more, and found that one copy is from
the original source folder, the other is from the bin folder
where the class files end up.

Worse, the bin copy is editable, but the edited copy will
be trashed by the next clean build.
Comment 3 Andrey Loskutov CLA 2017-03-30 02:26:10 EDT
(In reply to Dave Dyer from comment #2)
> I investigated a little more, and found that one copy is from
> the original source folder, the other is from the bin folder
> where the class files end up.

You should exclude .launch files to be copied in the project build settings: Java compiler -> building -> Output folder -> Filtered resources
Comment 4 Dave Dyer CLA 2017-03-30 03:28:38 EDT
that can paper over the problem, but why are .launches in
the /bin directory considered at all?  There's no sensible
way they can be used there.
Comment 5 Andrey Loskutov CLA 2017-03-30 03:57:00 EDT
(In reply to Dave Dyer from comment #4)
> that can paper over the problem, 

Right, this was a quick fix proposal for you. 

> but why are .launches in
> the /bin directory considered at all?  There's no sensible
> way they can be used there.

Therefore I would change this bug title to "Ignore launches from derived folders". Please if you have other requests, create additional tickets.
Comment 6 Eclipse Genie CLA 2017-03-30 07:28:14 EDT
New Gerrit change created: https://git.eclipse.org/r/94128
Comment 7 Andrey Loskutov CLA 2017-03-30 07:30:01 EDT
(In reply to Andrey Loskutov from comment #5)
> (In reply to Dave Dyer from comment #4)
> > but why are .launches in
> > the /bin directory considered at all?  There's no sensible
> > way they can be used there.
> 
> Therefore I would change this bug title to "Ignore launches from derived
> folders".

> New Gerrit change created: https://git.eclipse.org/r/94128

@Sarika: WDYT?
Comment 8 Sarika Sinha CLA 2017-03-31 00:37:16 EDT
(In reply to Andrey Loskutov from comment #7)
> (In reply to Andrey Loskutov from comment #5)
> > (In reply to Dave Dyer from comment #4)
> > > but why are .launches in
> > > the /bin directory considered at all?  There's no sensible
> > > way they can be used there.
> > 
> > Therefore I would change this bug title to "Ignore launches from derived
> > folders".
> 
> > New Gerrit change created: https://git.eclipse.org/r/94128
> 
> @Sarika: WDYT?

Code changes look logical, but first please help me in reproducing the problem.
I saved a launch in src/temp folder. I don't have any filter for Output folder but I don't see any launch file in bin directory ?
Comment 9 Dave Dyer CLA 2017-03-31 00:49:31 EDT
my launches are in the same folder as the .java
Comment 10 Andrey Loskutov CLA 2017-03-31 03:36:20 EDT
(In reply to Sarika Sinha from comment #8)
> (In reply to Andrey Loskutov from comment #7)
> > (In reply to Andrey Loskutov from comment #5)
> > > (In reply to Dave Dyer from comment #4)
> > > > but why are .launches in
> > > > the /bin directory considered at all?  There's no sensible
> > > > way they can be used there.
> > > 
> > > Therefore I would change this bug title to "Ignore launches from derived
> > > folders".
> > 
> > > New Gerrit change created: https://git.eclipse.org/r/94128
> > 
> > @Sarika: WDYT?
> 
> Code changes look logical, but first please help me in reproducing the
> problem.
> I saved a launch in src/temp folder. I don't have any filter for Output
> folder but I don't see any launch file in bin directory ?

You probably have excludes .launch files to be copied in the project (or workspace) build settings: Java compiler -> building -> Output folder -> Filtered resources

The only concern I have for the proposed patch: are there cases where the launch files are *generated and marked as derived*? If so, this could break someone who generates launches programmatically. If so, should we make an option "Run/Debug-> Launching -> Lanch Configuration -> Filter configurations from derived folders"?
Comment 11 Sarika Sinha CLA 2017-03-31 04:04:47 EDT
(In reply to Andrey Loskutov from comment #10)
 
> You probably have excludes .launch files to be copied in the project (or
> workspace) build settings: Java compiler -> building -> Output folder ->
> Filtered resources
 i don't have this filter.
I also have the .launch file along with .java file in a package under src.

Preference, we can add, but how to make it easily discover able? People will about this feature.
Comment 12 Andrey Loskutov CLA 2017-03-31 04:16:11 EDT
(In reply to Sarika Sinha from comment #11)
> (In reply to Andrey Loskutov from comment #10)
>  
> > You probably have excludes .launch files to be copied in the project (or
> > workspace) build settings: Java compiler -> building -> Output folder ->
> > Filtered resources
>  i don't have this filter.

I've seen that I hat to trigger a "full build" after creating a launch so that the copy of that was copied to the bin directory.

> I also have the .launch file along with .java file in a package under src.
> 
> Preference, we can add, but how to make it easily discover able? People will
> about this feature.

I'm not sure if and how often people create "derived" launches. In our lab we don't do that and I haven't seen this yet. However I've saw many times people trying to understand how to avoid launch "duplication" because they changed they default build settings. So most likely most people would not notice anything, and those who will, will need to check the prefs or ask in forum.
Comment 13 Noopur Gupta CLA 2017-05-11 06:44:32 EDT
Andrey, are you planning to fix this for 4.7?
Comment 14 Andrey Loskutov CLA 2017-05-11 07:34:34 EDT
(In reply to Noopur Gupta from comment #13)
> Andrey, are you planning to fix this for 4.7?

No, see comment 10. The patch should include a new preference to disable the new behavior, because I fear we could break some use cases where the launch files are derived *per purpose* because they could be generated by some clever tooling.
Comment 15 Andrey Loskutov CLA 2018-01-13 16:58:28 EST
The patch requires preference check, but I have no interest to spent time for this. May be someone can pick up and polish it.