use of com.android.tools.idea.npw.importing.ModuleListModel in project android by JetBrains.
the class ModulesListModelTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
ApplicationManager.getApplication().runWriteAction(new ThrowableComputable<Void, IOException>() {
@Override
public Void compute() throws IOException {
myTempDir = VfsUtil.findFileByIoFile(Files.createTempDir(), true);
assert myTempDir != null;
VirtualFile module1vf = VfsUtil.createDirectoryIfMissing(myTempDir, "module1");
VirtualFile module2vf = VfsUtil.createDirectoryIfMissing(myTempDir, "module2");
assert module1vf != null && module2vf != null;
myModule1 = new ModuleToImport(module1vf.getName(), module1vf, NO_DEPS);
myModule2 = new ModuleToImport(module2vf.getName(), module2vf, Suppliers.ofInstance(ImmutableSet.of(module1vf.getName())));
VirtualFile existingModule = VfsUtil.createDirectoryIfMissing(getProject().getBaseDir(), EXISTING_MODULE);
if (existingModule == null) {
throw new IOException("Unable to create fake module directory");
}
existingModule.createChildData(this, "empty_file");
return null;
}
});
myModel = new ModuleListModel(getProject());
}
Aggregations