コード例 #1
0
  @Nullable
  public File getAnnotationProcessorGeneratedSourcesOutputDir(
      JpsModule module, final boolean forTests, String sourceDirName) {
    if (!StringUtil.isEmpty(sourceDirName)) {
      List<String> roots = module.getContentRootsList().getUrls();
      if (roots.isEmpty()) {
        return null;
      }
      if (roots.size() > 1) {
        roots = new ArrayList<String>(roots); // sort roots to get deterministic result
        Collections.sort(
            roots,
            new Comparator<String>() {
              @Override
              public int compare(String o1, String o2) {
                return o1.compareTo(o2);
              }
            });
      }
      return new File(JpsPathUtil.urlToFile(roots.get(0)), sourceDirName);
    }

    final File outputDir = getModuleOutputDir(module, forTests);
    if (outputDir == null) {
      return null;
    }
    final File parentFile = outputDir.getParentFile();
    if (parentFile == null) {
      return null;
    }
    return new File(parentFile, outputDir.getName() + "_" + DEFAULT_GENERATED_DIR_NAME);
  }
コード例 #2
0
 @Override
 protected Set<String> getDefinedCons() {
   return Collections.emptySet();
 }