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

Bug 294502

Summary: Handling of unknown arguments/targets
Product: [Eclipse Project] Platform Reporter: Darin Wright <darin.eclipse>
Component: AntAssignee: Darin Wright <darin.eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie, natalia.bartol
Version: 3.4.2Flags: Michael_Rennie: review+
Target Milestone: 3.5.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch
none
updated patch
none
fix none

Description Darin Wright CLA 2009-11-06 13:31:35 EST
When the antRunner entry point is used, additional command line arguments may be specified (for example "-pluginCustomization <file_location>"). The InternalAntRunner attempts to remove unkown command line arguments, but seems to have a bug - it removes all arguments if a leftover argument begining with "-" is found.

Instead, it should just remove those unkown arguments, and any unknown targets (since arguments may have tailing parameters).
Comment 1 Darin Wright CLA 2009-11-06 13:33:08 EST
Created attachment 151593 [details]
patch

This patch fixes a bug in processUnrecognizedCommands(...) and additionally removes unknown targets before attempting to execute the build file.
Comment 2 Natalia Bartol CLA 2009-11-09 09:50:29 EST
I've tested patch and it solves the problem. Since all changes in ant.ui and new ant.launching plugins are released into 3.6 (Bug 264338), this should also go into 3.6 stream.
Comment 3 Michael Rennie CLA 2009-11-09 10:00:11 EST
Created attachment 151696 [details]
updated patch

Tested and updated the patch to apply to HEAD and NLS'd the error message.
Comment 4 Darin Wright CLA 2009-11-09 10:04:29 EST
Applied to 3.6/HEAD. Targetting for 3.5.2.
Comment 5 Darin Wright CLA 2009-11-09 10:54:28 EST
Released to 3.5.2, please verify, Mike.
Comment 6 Darin Wright CLA 2009-11-10 09:44:39 EST
This caused an automated test failure. When a build script has no default target an exception is thrown.
Comment 7 Darin Wright CLA 2009-11-10 11:00:55 EST
Created attachment 151837 [details]
fix

Additional fix.
Comment 8 Darin Wright CLA 2009-11-10 11:10:35 EST
Applied additional fix to 3.5.2 and 3.6. Please verify, Mike.
Comment 9 Michael Rennie CLA 2009-11-13 11:42:15 EST
looks good and the test failures have been fixed with the (last) updated patch.

verified.