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 151837 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]
fix
no-def.patch (text/plain), 4.17 KB, created by
Darin Wright
on 2009-11-10 11:00:55 EST
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Darin Wright
Created:
2009-11-10 11:00:55 EST
Size:
4.17 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ant.core >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.176 >diff -u -r1.176 InternalAntRunner.java >--- src_ant/org/eclipse/ant/internal/core/ant/InternalAntRunner.java 9 Nov 2009 15:06:57 -0000 1.176 >+++ src_ant/org/eclipse/ant/internal/core/ant/InternalAntRunner.java 10 Nov 2009 16:03:47 -0000 >@@ -24,13 +24,11 @@ > 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; >@@ -426,6 +424,45 @@ > processAntHome(true); > } > } >+ >+ /** >+ * Returns a list of target names in the build script. >+ * >+ * @return a list of target names >+ */ >+ private List getTargetNames() { >+ try { >+ setJavaClassPath(); >+ Project antProject; >+ >+ antProject = getProject(); >+ processAntHome(false); >+ antProject.init(); >+ setTypes(antProject); >+ processProperties(AntCoreUtil.getArrayList(extraArguments)); >+ >+ setProperties(antProject, false); >+ if (isVersionCompatible("1.5")) { //$NON-NLS-1$ >+ new InputHandlerSetter().setInputHandler(antProject, "org.eclipse.ant.internal.core.ant.NullInputHandler"); //$NON-NLS-1$ >+ } >+ parseBuildFile(antProject); >+ Enumeration projectTargets = antProject.getTargets().elements(); >+ List names = new ArrayList(); >+ Target target; >+ while (projectTargets.hasMoreElements()) { >+ target = (Target) projectTargets.nextElement(); >+ String name= target.getName(); >+ if (name.length() == 0) { >+ //"no name" implicit target of Ant 1.6 >+ continue; >+ } >+ names.add(name); >+ } >+ return names; >+ } finally { >+ processAntHome(true); >+ } >+ } > > private Project getProject() { > Project antProject; >@@ -1089,18 +1126,7 @@ > * @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)); >- } >- } >- } >+ List names = getTargetNames(); > ListIterator iterator = commands.listIterator(); > > while (iterator.hasNext()) { >#P org.eclipse.ant.tests.core >Index: tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java,v >retrieving revision 1.20 >diff -u -r1.20 FrameworkTests.java >--- tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java 3 Nov 2008 14:16:21 -0000 1.20 >+++ tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java 10 Nov 2009 16:03:48 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -126,6 +126,17 @@ > run("NoDefault.xml"); > assertSuccessful(); > } >+ >+ /** >+ * Regression test for running a specific target from a script that has no default target. >+ * Associated with bug 294502. >+ * >+ * @throws CoreException >+ */ >+ public void testSpecificTargetWithNoDefaultTarget() throws CoreException { >+ run("NoDefault.xml", new String[]{"test"}); >+ assertSuccessful(); >+ } > > /** > * Ensures that tasks like javac work when includeAntRuntime is specified
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