本文整理汇总了Java中org.apache.tools.ant.types.Path.addJavaRuntime方法的典型用法代码示例。如果您正苦于以下问题:Java Path.addJavaRuntime方法的具体用法?Java Path.addJavaRuntime怎么用?Java Path.addJavaRuntime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tools.ant.types.Path
的用法示例。
在下文中一共展示了Path.addJavaRuntime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildClasspathClassLoader
import org.apache.tools.ant.types.Path; //导入方法依赖的package包/类
/**
* Create class loader based on classpath, bootclasspath, and sourcepath.
*
* @return a URL classloader
*/
private InstrumentationClassFinder buildClasspathClassLoader() {
final StringBuffer classPathBuffer = new StringBuffer();
final Project project = getProject();
final Path cp = new Path(project);
appendPath(cp, getBootclasspath());
cp.setLocation(getDestdir().getAbsoluteFile());
appendPath(cp, getClasspath());
appendPath(cp, getSourcepath());
appendPath(cp, getSrcdir());
if (getIncludeantruntime()) {
cp.addExisting(cp.concatSystemClasspath("last"));
}
boolean shouldInclude = getIncludejavaruntime();
if (!shouldInclude) {
if (project != null) {
final String propValue = project.getProperty(PROPERTY_INSTRUMENTATION_INCLUDE_JAVA_RUNTIME);
shouldInclude = !("false".equalsIgnoreCase(propValue) || "no".equalsIgnoreCase(propValue));
}
else {
shouldInclude = true;
}
}
if (shouldInclude) {
cp.addJavaRuntime();
}
cp.addExtdirs(getExtdirs());
final String[] pathElements = cp.list();
for (int i = 0; i < pathElements.length; i++) {
final String pathElement = pathElements[i];
classPathBuffer.append(File.pathSeparator);
classPathBuffer.append(pathElement);
}
final String classPath = classPathBuffer.toString();
log("classpath=" + classPath, Project.MSG_VERBOSE);
try {
return createInstrumentationClassFinder(classPath);
}
catch (MalformedURLException e) {
fireError(e.getMessage());
return null;
}
}
示例2: doForkCommandLineList
import org.apache.tools.ant.types.Path; //导入方法依赖的package包/类
private void doForkCommandLineList(List<String> commandLineList, Path classpath, String separator) {
if (!fork) return;
if (includeAntRuntime) {
classpath.addExisting((new Path(getProject())).concatSystemClasspath("last"));
}
if (includeJavaRuntime) {
classpath.addJavaRuntime();
}
if (forkedExecutable != null && !forkedExecutable.equals("")) {
commandLineList.add(forkedExecutable);
} else {
String javaHome;
if (forkJavaHome != null) {
javaHome = forkJavaHome.getPath();
} else {
javaHome = System.getProperty("java.home");
}
commandLineList.add(javaHome + separator + "bin" + separator + "java");
}
commandLineList.add("-classpath");
commandLineList.add(getClasspathRelative(classpath));
final String fileEncodingProp = System.getProperty("file.encoding");
if ((fileEncodingProp != null) && !fileEncodingProp.equals("")) {
commandLineList.add("-Dfile.encoding=" + fileEncodingProp);
}
if (targetBytecode != null) {
commandLineList.add("-Dgroovy.target.bytecode=" + targetBytecode);
}
if ((memoryInitialSize != null) && !memoryInitialSize.equals("")) {
commandLineList.add("-Xms" + memoryInitialSize);
}
if ((memoryMaximumSize != null) && !memoryMaximumSize.equals("")) {
commandLineList.add("-Xmx" + memoryMaximumSize);
}
if (!"*.groovy".equals(getScriptExtension())) {
String tmpExtension = getScriptExtension();
if (tmpExtension.startsWith("*."))
tmpExtension = tmpExtension.substring(1);
commandLineList.add("-Dgroovy.default.scriptExtension=" + tmpExtension);
}
commandLineList.add(FileSystemCompilerFacade.class.getName());
if (forceLookupUnnamedFiles) {
commandLineList.add("--forceLookupUnnamedFiles");
}
}