Search in sources :

Example 1 with ModuleListModel

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());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ModuleToImport(com.android.tools.idea.gradle.project.ModuleToImport) ModuleListModel(com.android.tools.idea.npw.importing.ModuleListModel) IOException(java.io.IOException)

Aggregations

ModuleToImport (com.android.tools.idea.gradle.project.ModuleToImport)1 ModuleListModel (com.android.tools.idea.npw.importing.ModuleListModel)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 IOException (java.io.IOException)1