本文整理汇总了Java中org.apache.tools.ant.types.Path.append方法的典型用法代码示例。如果您正苦于以下问题:Java Path.append方法的具体用法?Java Path.append怎么用?Java Path.append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tools.ant.types.Path
的用法示例。
在下文中一共展示了Path.append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compile
import org.apache.tools.ant.types.Path; //导入方法依赖的package包/类
private void compile() {
Javac j = new Javac();
j.setProject(getProject());
j.setTaskName("compile");
j.setSrcdir(new Path(getProject(), sources_path));
File tmp;
if (classes_path != null) {
tmp = getProject().resolveFile(classes_path);
if (!tmp.exists()) {
if (!tmp.mkdir())
throw new BuildException("Could not create temporary folder " + tmp.getAbsolutePath());
}
} else {
// Generate temporary folder
java.nio.file.Path p = mktemp();
temporary.add(p);
tmp = p.toFile();
classes_path = tmp.getAbsolutePath();
}
j.setDestdir(tmp);
// See "Setting Java Compiler Options" in User Guide
j.setDebug(true);
if (jckit.version == JC.V212) {
j.setTarget("1.1");
j.setSource("1.1");
// Always set debug to disable "contains local variables,
// but not local variable table." messages
j.setDebug(true);
} else if (jckit.version == JC.V221) {
j.setTarget("1.2");
j.setSource("1.2");
} else {
j.setTarget("1.5");
j.setSource("1.5");
}
j.setIncludeantruntime(false);
j.createCompilerArg().setValue("-Xlint");
j.createCompilerArg().setValue("-Xlint:-options");
j.createCompilerArg().setValue("-Xlint:-serial");
j.setFailonerror(true);
j.setFork(true);
// set classpath
Path cp = j.createClasspath();
String api = null;
if (jckit.version == JC.V3) {
api = Paths.get(jckit.path, "lib", "api_classic.jar").toAbsolutePath().toString();
} else if (jckit.version == JC.V212) { // V2.1.X
api = Paths.get(jckit.path, "lib", "api21.jar").toAbsolutePath().toString();
} else { // V2.2.X
api = Paths.get(jckit.path, "lib", "api.jar").toAbsolutePath().toString();
}
cp.append(new Path(getProject(), api));
for (JCImport i : raw_imports) {
// Support import clauses with only jar or exp values
if (i.jar != null) {
cp.append(new Path(getProject(), i.jar));
}
}
j.execute();
}
示例2: appendPath
import org.apache.tools.ant.types.Path; //导入方法依赖的package包/类
/**
* Append path to class path if the appened path is not empty and is not null
*
* @param cp the path to modify
* @param p the path to append
*/
private void appendPath(Path cp, final Path p) {
if (p != null && p.size() > 0) {
cp.append(p);
}
}