I recently coded up some Java classes to extend the functionality of the Task class within Ant. One of the tasks is a Perl script which allows for command line options. I created the execute() method within my task to call the Perl script. Since I am not done completely coding all the methods in the class yet, I am directly passing in the "-h" command line option to invoke help. Here is the code:
public void execute() throws BuildException { Commandline commandLine = new Commandline(); Project aProj = getProject(); int result = 0; // build the command line from what we got the format is // perl foo.pl [options...] commandLine.setExecutable(getFooCommand()); commandLine.createArgument().setValue(COMMAND_FOO); commandLine.createArgument().setValue("-h"); // Check the command line options checkOptions(commandLine); // For debugging System.out.println(commandLine.toString()); result = run(commandLine); if ( result != 0 ) { String msg = "Failed executing: " + commandLine.toString() +; throw new BuildException(msg, location); } }
When the script executes, none of the output from the Perl script is appearing on the screen. If I invoke the script from the command line:
C:\>perl foo.pl -h
it works fine and the output displays to the screen.
Does anyone know where my STDOUT went?
Thank you :)
P0w3rK!d
In reply to Ant, Perl, and where did my STDOUT go? by P0w3rK!d
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |