Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 151696 Details for
Bug 294502
Handling of unknown arguments/targets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
updated patch
antrunner.patch (text/plain), 4.80 KB, created by
Michael Rennie
on 2009-11-09 10:00:11 EST
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Michael Rennie
Created:
2009-11-09 10:00:11 EST
Size:
4.80 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ant.core >Index: src_ant/org/eclipse/ant/internal/core/ant/InternalAntMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ant.core/src_ant/org/eclipse/ant/internal/core/ant/InternalAntMessages.java,v >retrieving revision 1.11 >diff -u -r1.11 InternalAntMessages.java >--- src_ant/org/eclipse/ant/internal/core/ant/InternalAntMessages.java 5 May 2009 14:40:11 -0000 1.11 >+++ src_ant/org/eclipse/ant/internal/core/ant/InternalAntMessages.java 9 Nov 2009 15:02:13 -0000 >@@ -53,6 +53,8 @@ > public static String InternalAntRunner_Error_setting_Ant_task; > public static String InternalAntRunner_Missing_Class; > public static String InternalAntRunner_157; >+ >+ public static String InternalAntRunner_unknown_target; > > public static String ProgressBuildListener_Build_cancelled; > >Index: src_ant/org/eclipse/ant/internal/core/ant/InternalAntMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ant.core/src_ant/org/eclipse/ant/internal/core/ant/InternalAntMessages.properties,v >retrieving revision 1.38 >diff -u -r1.38 InternalAntMessages.properties >--- src_ant/org/eclipse/ant/internal/core/ant/InternalAntMessages.properties 6 May 2009 15:34:03 -0000 1.38 >+++ src_ant/org/eclipse/ant/internal/core/ant/InternalAntMessages.properties 9 Nov 2009 15:02:13 -0000 >@@ -45,5 +45,6 @@ > InternalAntRunner_Error_setting_Ant_task=Error setting Ant task {0} > InternalAntRunner_Missing_Class=Could not load a class required for parsing targets > InternalAntRunner_157=-lib not supported\nConfigure the Ant runtime classpath using either the\nglobal Ant runtime classpath or the Ant runtime classpath\n for this particular build >+InternalAntRunner_unknown_target=Unknown target: {0} > ProgressBuildListener_Build_cancelled=Build cancelled. > InternalProject_could_not_create_type=Could not create type {0} due to {1} >Index: src_ant/org/eclipse/ant/internal/core/ant/InternalAntRunner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ant.core/src_ant/org/eclipse/ant/internal/core/ant/InternalAntRunner.java,v >retrieving revision 1.175 >diff -u -r1.175 InternalAntRunner.java >--- src_ant/org/eclipse/ant/internal/core/ant/InternalAntRunner.java 4 May 2009 16:11:02 -0000 1.175 >+++ src_ant/org/eclipse/ant/internal/core/ant/InternalAntRunner.java 9 Nov 2009 15:02:13 -0000 >@@ -19,15 +19,18 @@ > import java.io.InputStream; > import java.io.PrintStream; > import java.net.URL; >-import java.text.MessageFormat; // don't use ICU in ant builder >+import java.text.MessageFormat; > import java.util.ArrayList; > import java.util.Arrays; > import java.util.Enumeration; > import java.util.HashMap; >+import java.util.HashSet; > import java.util.Iterator; > import java.util.List; >+import java.util.ListIterator; > import java.util.Map; > import java.util.Properties; >+import java.util.Set; > import java.util.Vector; > > import org.apache.tools.ant.AntTypeDefinition; >@@ -1068,6 +1071,10 @@ > processUnrecognizedCommands(commands); > } > >+ if(!commands.isEmpty()) { >+ processUnrecognizedTargets(commands); >+ } >+ > if (!commands.isEmpty()) { > processTargets(commands); > } >@@ -1075,9 +1082,41 @@ > return true; > } > >+ /** >+ * Checks for unrecognized targets on the command line and >+ * removes them. >+ * >+ * @since 3.6 >+ */ >+ private void processUnrecognizedTargets(List commands) { >+ List list = getTargets(); >+ Set names = new HashSet(); >+ Iterator it = list.iterator(); >+ while (it.hasNext()) { >+ Object element = it.next(); >+ if (element instanceof List) { >+ List target = (List)element; >+ if (!target.isEmpty()) { >+ names.add(target.get(0)); >+ } >+ } >+ } >+ ListIterator iterator = commands.listIterator(); >+ >+ while (iterator.hasNext()) { >+ String target = (String) iterator.next(); >+ if (!names.contains(target)) { >+ iterator.remove(); >+ String message = MessageFormat.format(InternalAntMessages.InternalAntRunner_unknown_target, new Object[]{target}); >+ logMessage(currentProject, message, Project.MSG_WARN); >+ } >+ } >+ } >+ >+ > /* > * Checks for unrecognized arguments on the command line. >- * Since there is no syntactic way to distingush between >+ * Since there is no syntactic way to distinguish between > * ant -foo target1 target2 > * ant -foo fooarg target > * we remove everything up to the last argument that >@@ -1090,7 +1129,7 @@ > > // find the last arg that begins with '-' > for (int i = commands.size() - 1; i >= 0; i--) { >- if (((String) commands.get(0)).startsWith("-")) { //$NON-NLS-1$ >+ if (((String) commands.get(i)).startsWith("-")) { //$NON-NLS-1$ > p = i; > break; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 294502
:
151593
| 151696 |
151837