|
Lines 24-36
Link Here
|
| 24 |
import java.util.Arrays; |
24 |
import java.util.Arrays; |
| 25 |
import java.util.Enumeration; |
25 |
import java.util.Enumeration; |
| 26 |
import java.util.HashMap; |
26 |
import java.util.HashMap; |
| 27 |
import java.util.HashSet; |
|
|
| 28 |
import java.util.Iterator; |
27 |
import java.util.Iterator; |
| 29 |
import java.util.List; |
28 |
import java.util.List; |
| 30 |
import java.util.ListIterator; |
29 |
import java.util.ListIterator; |
| 31 |
import java.util.Map; |
30 |
import java.util.Map; |
| 32 |
import java.util.Properties; |
31 |
import java.util.Properties; |
| 33 |
import java.util.Set; |
|
|
| 34 |
import java.util.Vector; |
32 |
import java.util.Vector; |
| 35 |
|
33 |
|
| 36 |
import org.apache.tools.ant.AntTypeDefinition; |
34 |
import org.apache.tools.ant.AntTypeDefinition; |
|
Lines 426-431
Link Here
|
| 426 |
processAntHome(true); |
424 |
processAntHome(true); |
| 427 |
} |
425 |
} |
| 428 |
} |
426 |
} |
|
|
427 |
|
| 428 |
/** |
| 429 |
* Returns a list of target names in the build script. |
| 430 |
* |
| 431 |
* @return a list of target names |
| 432 |
*/ |
| 433 |
private List getTargetNames() { |
| 434 |
try { |
| 435 |
setJavaClassPath(); |
| 436 |
Project antProject; |
| 437 |
|
| 438 |
antProject = getProject(); |
| 439 |
processAntHome(false); |
| 440 |
antProject.init(); |
| 441 |
setTypes(antProject); |
| 442 |
processProperties(AntCoreUtil.getArrayList(extraArguments)); |
| 443 |
|
| 444 |
setProperties(antProject, false); |
| 445 |
if (isVersionCompatible("1.5")) { //$NON-NLS-1$ |
| 446 |
new InputHandlerSetter().setInputHandler(antProject, "org.eclipse.ant.internal.core.ant.NullInputHandler"); //$NON-NLS-1$ |
| 447 |
} |
| 448 |
parseBuildFile(antProject); |
| 449 |
Enumeration projectTargets = antProject.getTargets().elements(); |
| 450 |
List names = new ArrayList(); |
| 451 |
Target target; |
| 452 |
while (projectTargets.hasMoreElements()) { |
| 453 |
target = (Target) projectTargets.nextElement(); |
| 454 |
String name= target.getName(); |
| 455 |
if (name.length() == 0) { |
| 456 |
//"no name" implicit target of Ant 1.6 |
| 457 |
continue; |
| 458 |
} |
| 459 |
names.add(name); |
| 460 |
} |
| 461 |
return names; |
| 462 |
} finally { |
| 463 |
processAntHome(true); |
| 464 |
} |
| 465 |
} |
| 429 |
|
466 |
|
| 430 |
private Project getProject() { |
467 |
private Project getProject() { |
| 431 |
Project antProject; |
468 |
Project antProject; |
|
Lines 1089-1106
Link Here
|
| 1089 |
* @since 3.6 |
1126 |
* @since 3.6 |
| 1090 |
*/ |
1127 |
*/ |
| 1091 |
private void processUnrecognizedTargets(List commands) { |
1128 |
private void processUnrecognizedTargets(List commands) { |
| 1092 |
List list = getTargets(); |
1129 |
List names = getTargetNames(); |
| 1093 |
Set names = new HashSet(); |
|
|
| 1094 |
Iterator it = list.iterator(); |
| 1095 |
while (it.hasNext()) { |
| 1096 |
Object element = it.next(); |
| 1097 |
if (element instanceof List) { |
| 1098 |
List target = (List)element; |
| 1099 |
if (!target.isEmpty()) { |
| 1100 |
names.add(target.get(0)); |
| 1101 |
} |
| 1102 |
} |
| 1103 |
} |
| 1104 |
ListIterator iterator = commands.listIterator(); |
1130 |
ListIterator iterator = commands.listIterator(); |
| 1105 |
|
1131 |
|
| 1106 |
while (iterator.hasNext()) { |
1132 |
while (iterator.hasNext()) { |