当前位置: 首页>>代码示例>>Java>>正文


Java ModuleChunk.getLanguageLevel方法代码示例

本文整理汇总了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));
  }
}
 
开发者ID:diy1,项目名称:error-prone-aspirator,代码行数:35,代码来源:ErrorProneIdeaCompiler.java

示例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));
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:56,代码来源:JavacCompiler.java


注:本文中的com.intellij.compiler.impl.javaCompiler.ModuleChunk.getLanguageLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。