* construct the command that we're going to execute.
*
* @return Commandline holding command to be executed
*/
public Commandline buildCommandline() {
Commandline cmdLine = getCommandLine();
cmdLine.setExecutable("NAnt.exe");
if (useLogger) {
cmdLine.createArgument().setValue("-logger:" + getLoggerClassName());
cmdLine.createArgument().setValue("-logfile:" + tempFileName);
} else {
cmdLine.createArgument().setValue("-listener:" + getLoggerClassName());
cmdLine.createArgument().setValue("-D:XmlLogger.file=" + tempFileName);
}
/*
if (useVerbose) {
cmdLine.createArgument().setValue("-verbose");
}
*/
if (useDebug) {
cmdLine.createArgument().setValue("-debug+");
} else if (useQuiet) {
cmdLine.createArgument().setValue("-quiet+");
}
if (targetFramework != null) {
cmdLine.createArgument().setValue("-t:" + targetFramework);
}
for (Iterator propertiesIter = buildProperties.entrySet().iterator(); propertiesIter.hasNext();) {
Map.Entry property = (Map.Entry) propertiesIter.next();
String value = (String) property.getValue();
if (!"".equals(value)) {
cmdLine.createArgument().setValue("-D:" + property.getKey() + "=" + value);
}
}
for (Iterator nantPropertiesIterator = nantProperties.iterator(); nantPropertiesIterator.hasNext(); ) {
Property property = (Property) nantPropertiesIterator.next();
cmdLine.createArgument().setValue("-D:" + property.getName() + "=" + property.getValue());
}
cmdLine.createArgument().setValue("-buildfile:" + buildFile);
StringTokenizer targets = new StringTokenizer(target);
while (targets.hasMoreTokens()) {
cmdLine.createArgument().setValue(targets.nextToken());
}
return cmdLine;
}