本文整理匯總了Java中com.intellij.compiler.impl.javaCompiler.ModuleChunk.getLanguageLevel方法的典型用法代碼示例。如果您正苦於以下問題:Java ModuleChunk.getLanguageLevel方法的具體用法?Java ModuleChunk.getLanguageLevel怎麽用?Java ModuleChunk.getLanguageLevel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.compiler.impl.javaCompiler.ModuleChunk
的用法示例。
在下文中一共展示了ModuleChunk.getLanguageLevel方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addCommandLineOptions
import com.intellij.compiler.impl.javaCompiler.ModuleChunk; //導入方法依賴的package包/類
public static void addCommandLineOptions(@NotNull ModuleChunk chunk,
@NonNls List<String> commandLine,
@NotNull String outputPath,
@NotNull Sdk jdk,
boolean isAnnotationProcessingMode) throws IOException {
LanguageLevel languageLevel = chunk.getLanguageLevel();
CompilerUtil.addSourceCommandLineSwitch(jdk, languageLevel, commandLine);
commandLine.add("-verbose");
final String bootCp = chunk.getCompilationBootClasspath();
final String classPath = chunk.getCompilationClasspath();
commandLine.add("-bootclasspath");
addClassPathValue(commandLine, bootCp);
commandLine.add("-classpath");
addClassPathValue(commandLine, classPath);
if (isAnnotationProcessingMode) {
commandLine.add("-s");
commandLine.add(outputPath.replace('/', File.separatorChar));
final String moduleOutputPath = CompilerPaths.getModuleOutputPath(chunk.getModules()[0], false);
if (moduleOutputPath != null) {
commandLine.add("-d");
commandLine.add(moduleOutputPath.replace('/', File.separatorChar));
}
}
else {
commandLine.add("-d");
commandLine.add(outputPath.replace('/', File.separatorChar));
}
}
示例2: addCommandLineOptions
import com.intellij.compiler.impl.javaCompiler.ModuleChunk; //導入方法依賴的package包/類
public static void addCommandLineOptions(ModuleChunk chunk, @NonNls List<String> commandLine, String outputPath, Sdk jdk,
boolean version1_0,
boolean version1_1,
List<File> tempFiles, boolean addSourcePath, boolean useTempFile,
boolean isAnnotationProcessingMode) throws IOException {
LanguageLevel languageLevel = chunk.getLanguageLevel();
CompilerUtil.addSourceCommandLineSwitch(jdk, languageLevel, commandLine);
CompilerUtil.addTargetCommandLineSwitch(chunk, commandLine);
commandLine.add("-verbose");
final String cp = chunk.getCompilationClasspath();
final String bootCp = chunk.getCompilationBootClasspath();
final String classPath;
if (version1_0 || version1_1) {
classPath = bootCp + File.pathSeparator + cp;
}
else {
classPath = cp;
commandLine.add("-bootclasspath");
addClassPathValue(jdk, false, commandLine, bootCp, "javac_bootcp", tempFiles, useTempFile);
}
commandLine.add("-classpath");
addClassPathValue(jdk, version1_0, commandLine, classPath, "javac_cp", tempFiles, useTempFile);
if (!version1_1 && !version1_0 && addSourcePath) {
commandLine.add("-sourcepath");
// this way we tell the compiler that the sourcepath is "empty". However, javac thinks that sourcepath is 'new File("")'
// this may cause problems if we have java code in IDEA working directory
if (isAnnotationProcessingMode) {
final int currentSourcesMode = chunk.getSourcesFilter();
commandLine.add(chunk.getSourcePath(currentSourcesMode == ModuleChunk.TEST_SOURCES? ModuleChunk.ALL_SOURCES : currentSourcesMode));
}
else {
commandLine.add("\"\"");
}
}
if (isAnnotationProcessingMode) {
commandLine.add("-s");
commandLine.add(outputPath.replace('/', File.separatorChar));
final String moduleOutputPath = CompilerPaths.getModuleOutputPath(chunk.getModules()[0], false);
if (moduleOutputPath != null) {
commandLine.add("-d");
commandLine.add(moduleOutputPath.replace('/', File.separatorChar));
}
}
else {
commandLine.add("-d");
commandLine.add(outputPath.replace('/', File.separatorChar));
}
}