Java Code Examples for org.apache.tools.ant.types.Commandline#Argument

The following examples show how to use org.apache.tools.ant.types.Commandline#Argument . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Groovy.java    From groovy with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
    final GroovyShell shell = new GroovyShell(new Binding());
    final Groovy groovy = new Groovy();
    for (int i = 1; i < args.length; i++) {
        final Commandline.Argument argument = groovy.createArg();
        argument.setValue(args[i]);
    }
    final AntBuilder builder = new AntBuilder();
    groovy.setProject(builder.getProject());
    groovy.parseAndRunScript(shell, null, null, null, new File(args[0]), builder);
}
 
Example 2
Source File: Groovy.java    From groovy with Apache License 2.0 5 votes vote down vote up
private void createNewArgs(String txt) throws IOException {
    final String[] args = cmdline.getCommandline();
    // Temporary file - delete on exit, create (assured unique name).
    final File tempFile = FileUtils.getFileUtils().createTempFile(PREFIX, SUFFIX, null, true, true);
    final String[] commandline = new String[args.length + 1];
    ResourceGroovyMethods.write(tempFile, txt);
    commandline[0] = tempFile.getCanonicalPath();
    System.arraycopy(args, 0, commandline, 1, args.length);
    super.clearArgs();
    for (String arg : commandline) {
        final Commandline.Argument argument = super.createArg();
        argument.setValue(arg);
    }
}
 
Example 3
Source File: StartProfiledServer.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public Commandline.Argument createJvmarg() {
    return jvmarg.createVmArgument();
}
 
Example 4
Source File: Groovy.java    From groovy with Apache License 2.0 4 votes vote down vote up
public Commandline.Argument createArg() {
    return cmdline.createArgument();
}
 
Example 5
Source File: MXJC2Task.java    From mxjc with MIT License 4 votes vote down vote up
public Commandline.Argument createArg() {
    return cmdLine.createArgument();
}