use of com.intellij.openapi.module.impl.ModuleImpl in project intellij-community by JetBrains.
the class ModuleTestCase method loadAllModulesUnder.
@Nullable
protected Module loadAllModulesUnder(@NotNull VirtualFile rootDir, @Nullable final Consumer<Module> moduleConsumer) {
final Ref<Module> result = Ref.create();
VfsUtilCore.visitChildrenRecursively(rootDir, new VirtualFileVisitor() {
@Override
public boolean visitFile(@NotNull VirtualFile file) {
if (!file.isDirectory() && file.getName().endsWith(ModuleFileType.DOT_DEFAULT_EXTENSION)) {
ModuleImpl module = (ModuleImpl) loadModule(file);
if (moduleConsumer != null) {
moduleConsumer.consume(module);
}
result.setIfNull(module);
}
return true;
}
});
return result.get();
}
Aggregations