本文整理汇总了Java中org.apache.tools.ant.types.Commandline.addArguments方法的典型用法代码示例。如果您正苦于以下问题:Java Commandline.addArguments方法的具体用法?Java Commandline.addArguments怎么用?Java Commandline.addArguments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tools.ant.types.Commandline
的用法示例。
在下文中一共展示了Commandline.addArguments方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupKaffehCommand
import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
private Commandline setupKaffehCommand(Javah javah) {
Commandline cmd = new Commandline();
cmd.setExecutable(JavaEnvUtils.getJdkExecutable("kaffeh"));
if (javah.getDestdir() != null) {
cmd.createArgument().setValue("-d");
cmd.createArgument().setFile(javah.getDestdir());
}
if (javah.getOutputfile() != null) {
cmd.createArgument().setValue("-o");
cmd.createArgument().setFile(javah.getOutputfile());
}
Path cp = new Path(javah.getProject());
if (javah.getBootclasspath() != null) {
cp.append(javah.getBootclasspath());
}
cp = cp.concatSystemBootClasspath("ignore");
if (javah.getClasspath() != null) {
cp.append(javah.getClasspath());
}
if (cp.size() > 0) {
cmd.createArgument().setValue("-classpath");
cmd.createArgument().setPath(cp);
}
if (!javah.getOld()) {
cmd.createArgument().setValue("-jni");
}
cmd.addArguments(javah.getCurrentArgs());
javah.logAndAddFiles(cmd);
return cmd;
}
示例2: setupGcjhCommand
import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
private Commandline setupGcjhCommand(Javah javah) {
Commandline cmd = new Commandline();
cmd.setExecutable(JavaEnvUtils.getJdkExecutable("gcjh"));
if (javah.getDestdir() != null) {
cmd.createArgument().setValue("-d");
cmd.createArgument().setFile(javah.getDestdir());
}
if (javah.getOutputfile() != null) {
cmd.createArgument().setValue("-o");
cmd.createArgument().setFile(javah.getOutputfile());
}
Path cp = new Path(javah.getProject());
if (javah.getBootclasspath() != null) {
cp.append(javah.getBootclasspath());
}
cp = cp.concatSystemBootClasspath("ignore");
if (javah.getClasspath() != null) {
cp.append(javah.getClasspath());
}
if (cp.size() > 0) {
cmd.createArgument().setValue("--classpath");
cmd.createArgument().setPath(cp);
}
if (!javah.getOld()) {
cmd.createArgument().setValue("-jni");
}
cmd.addArguments(javah.getCurrentArgs());
javah.logAndAddFiles(cmd);
return cmd;
}
示例3: setupJavahCommand
import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
static Commandline setupJavahCommand(Javah javah) {
Commandline cmd = new Commandline();
if (javah.getDestdir() != null) {
cmd.createArgument().setValue("-d");
cmd.createArgument().setFile(javah.getDestdir());
}
if (javah.getOutputfile() != null) {
cmd.createArgument().setValue("-o");
cmd.createArgument().setFile(javah.getOutputfile());
}
if (javah.getClasspath() != null) {
cmd.createArgument().setValue("-classpath");
cmd.createArgument().setPath(javah.getClasspath());
}
if (javah.getVerbose()) {
cmd.createArgument().setValue("-verbose");
}
if (javah.getOld()) {
cmd.createArgument().setValue("-old");
}
if (javah.getForce()) {
cmd.createArgument().setValue("-force");
}
if (javah.getStubs() && !javah.getOld()) {
throw new BuildException(
"stubs only available in old mode.", javah.getLocation());
}
if (javah.getStubs()) {
cmd.createArgument().setValue("-stubs");
}
Path bcp = new Path(javah.getProject());
if (javah.getBootclasspath() != null) {
bcp.append(javah.getBootclasspath());
}
bcp = bcp.concatSystemBootClasspath("ignore");
if (bcp.size() > 0) {
cmd.createArgument().setValue("-bootclasspath");
cmd.createArgument().setPath(bcp);
}
cmd.addArguments(javah.getCurrentArgs());
javah.logAndAddFiles(cmd);
return cmd;
}
示例4: setupRmicCommand
import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
/**
* Setup rmic argument for rmic.
* @param options additional parameters needed by a specific
* implementation.
* @return the command line
*/
protected Commandline setupRmicCommand(String[] options) {
Commandline cmd = new Commandline();
if (options != null) {
for (int i = 0; i < options.length; i++) {
cmd.createArgument().setValue(options[i]);
}
}
Path classpath = getCompileClasspath();
cmd.createArgument().setValue("-d");
cmd.createArgument().setFile(attributes.getOutputDir());
if (attributes.getExtdirs() != null) {
cmd.createArgument().setValue("-extdirs");
cmd.createArgument().setPath(attributes.getExtdirs());
}
cmd.createArgument().setValue("-classpath");
cmd.createArgument().setPath(classpath);
String stubOption = addStubVersionOptions();
if (stubOption != null) {
//set the non-null stubOption
cmd.createArgument().setValue(stubOption);
}
if (null != attributes.getSourceBase()) {
cmd.createArgument().setValue("-keepgenerated");
}
if (attributes.getIiop()) {
attributes.log("IIOP has been turned on.", Project.MSG_INFO);
cmd.createArgument().setValue("-iiop");
if (attributes.getIiopopts() != null) {
attributes.log("IIOP Options: " + attributes.getIiopopts(),
Project.MSG_INFO);
cmd.createArgument().setValue(attributes.getIiopopts());
}
}
if (attributes.getIdl()) {
cmd.createArgument().setValue("-idl");
attributes.log("IDL has been turned on.", Project.MSG_INFO);
if (attributes.getIdlopts() != null) {
cmd.createArgument().setValue(attributes.getIdlopts());
attributes.log("IDL Options: " + attributes.getIdlopts(),
Project.MSG_INFO);
}
}
if (attributes.getDebug()) {
cmd.createArgument().setValue("-g");
}
String[] compilerArgs = attributes.getCurrentCompilerArgs();
compilerArgs = preprocessCompilerArgs(compilerArgs);
cmd.addArguments(compilerArgs);
verifyArguments(cmd);
logAndAddFilesToCompile(cmd);
return cmd;
}
示例5: setupCommand
import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
/**
* Prepare a command line that includes all parameters.
*
* @param javah is the Javah task.
* @return The prepared command line.
*/
private Commandline setupCommand(Javah javah) {
Commandline cmd = new Commandline();
// Add a destination directory if any.
if (javah.getDestdir() != null) {
cmd.createArgument().setValue("-d");
cmd.createArgument().setFile(javah.getDestdir());
}
// Add an output file if any.
if (javah.getOutputfile() != null) {
cmd.createArgument().setValue("-o");
cmd.createArgument().setFile(javah.getOutputfile());
}
// Add a class path if any.
if (javah.getClasspath() != null) {
cmd.createArgument().setValue("-classpath");
cmd.createArgument().setPath(javah.getClasspath());
}
// Add a verbose flag if any.
if (javah.getVerbose()) {
cmd.createArgument().setValue("-verbose");
}
// Add a boot class path if any.
Path bootClasspath = new Path(javah.getProject());
if (javah.getBootclasspath() != null) {
bootClasspath.append(javah.getBootclasspath());
}
if (bootClasspath.size() > 0) {
cmd.createArgument().setValue("-bootclasspath");
cmd.createArgument().setPath(bootClasspath);
}
// Add settings given as nested arg elements.
cmd.addArguments(javah.getCurrentArgs());
// Add and log the parameters and source files.
javah.logAndAddFiles(cmd);
return cmd;
}
示例6: setup
import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
/**
* Sets up the initial command line.
*
* <p>only the -encoding argument and nested arg elements get
* handled here.</p>
*
* @param cmd Command line to add to
* @param args provides the user-setting and access to Ant's
* logging system.
* @throws BuildException if there was a problem.
*/
protected void setup(Commandline cmd, Native2Ascii args)
throws BuildException {
if (args.getEncoding() != null) {
cmd.createArgument().setValue("-encoding");
cmd.createArgument().setValue(args.getEncoding());
}
cmd.addArguments(args.getCurrentArgs());
}
示例7: addCurrentCompilerArgs
import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
/**
* Adds the command line arguments specific to the current implementation.
* @param cmd the command line to use
*/
protected void addCurrentCompilerArgs(final Commandline cmd) {
cmd.addArguments(getJavac().getCurrentCompilerArgs());
}