use of org.jetbrains.jps.model.JpsProject in project intellij-community by JetBrains.
the class ResourceRootDescriptor method createFileFilter.
@NotNull
@Override
public FileFilter createFileFilter() {
final JpsProject project = getTarget().getModule().getProject();
final JpsCompilerExcludes excludes = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(project).getCompilerExcludes();
return file -> !excludes.isExcluded(file);
}
use of org.jetbrains.jps.model.JpsProject in project intellij-elixir by KronicDeth.
the class ElixirBuilder method build.
@Override
public void build(@NotNull ElixirTarget target, @NotNull DirtyFilesHolder<ElixirSourceRootDescriptor, ElixirTarget> holder, @NotNull BuildOutputConsumer outputConsumer, @NotNull CompileContext context) throws ProjectBuildException, IOException {
LOG.info(target.getPresentableName());
final Set<File> filesToCompile = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
holder.processDirtyFiles(new FileProcessor<ElixirSourceRootDescriptor, ElixirTarget>() {
@Override
public boolean apply(ElixirTarget target, File file, ElixirSourceRootDescriptor root) throws IOException {
boolean isAcceptFile = target.isTests() ? ELIXIR_TEST_SOURCE_FILTER.accept(file) : ELIXIR_SOURCE_FILTER.accept(file);
if (isAcceptFile && ourCompilableModuleTypes.contains(target.getModule().getModuleType())) {
filesToCompile.add(file);
}
return true;
}
});
if (filesToCompile.isEmpty() && !holder.hasRemovedFiles())
return;
JpsModule module = target.getModule();
JpsProject project = module.getProject();
ElixirCompilerOptions compilerOptions = JpsElixirCompilerOptionsExtension.getOrCreateExtension(project).getOptions();
if (compilerOptions.myUseMixCompiler) {
doBuildWithMix(target, context, module, compilerOptions);
} else {
// elixirc can not compile tests now.
if (!target.isTests()) {
doBuildWithElixirc(target, context, module, compilerOptions, filesToCompile);
}
}
}
Aggregations