use of com.google.idea.blaze.base.settings.BlazeImportSettings in project intellij by bazelbuild.
the class BlazeResolveConfigurationEquivalenceTest method initTest.
@Override
protected void initTest(Container applicationServices, Container projectServices) {
super.initTest(applicationServices, projectServices);
applicationServices.register(BlazeExecutor.class, new MockBlazeExecutor());
CPPEnvironmentAdapter.registerForTest(applicationServices.getPicoContainer());
applicationServices.register(ExperimentService.class, new MockExperimentService());
applicationServices.register(CompilerVersionChecker.class, new MockCompilerVersionChecker("1234"));
applicationServices.register(ProgressManager.class, new ProgressManagerImpl());
applicationServices.register(VirtualFileManager.class, mock(VirtualFileManager.class));
mockFileSystem = mock(LocalFileSystem.class);
applicationServices.register(VirtualFileSystemProvider.class, mock(VirtualFileSystemProvider.class));
when(VirtualFileSystemProvider.getInstance().getSystem()).thenReturn(mockFileSystem);
projectServices.register(PsiManager.class, new MockPsiManager(project));
projectServices.register(BlazeImportSettingsManager.class, new BlazeImportSettingsManager());
BuildSystemProvider buildSystemProvider = new BazelBuildSystemProvider();
registerExtensionPoint(BuildSystemProvider.EP_NAME, BuildSystemProvider.class).registerExtension(buildSystemProvider);
BlazeImportSettingsManager.getInstance(getProject()).setImportSettings(new BlazeImportSettings("", "", "", "", buildSystemProvider.buildSystem()));
context.addOutputSink(IssueOutput.class, errorCollector);
resolver = new BlazeConfigurationResolver(project);
resolverResult = BlazeConfigurationResolverResult.empty(project);
}
use of com.google.idea.blaze.base.settings.BlazeImportSettings in project intellij by bazelbuild.
the class BlazeIntegrationTestCase method setUp.
@Before
public final void setUp() throws Exception {
IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();
TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = factory.createLightFixtureBuilder(LightCodeInsightFixtureTestCase.JAVA_8);
final IdeaProjectTestFixture fixture = fixtureBuilder.getFixture();
testFixture = factory.createCodeInsightFixture(fixture, new LightTempDirTestFixtureImpl(true));
testFixture.setUp();
fileSystem = new TestFileSystem(getProject(), testFixture.getTempDirFixture());
runWriteAction(() -> {
ProjectJdkTable.getInstance().addJdk(IdeaTestUtil.getMockJdk18());
VirtualFile workspaceRootVirtualFile = fileSystem.createDirectory("workspace");
workspaceRoot = new WorkspaceRoot(new File(workspaceRootVirtualFile.getPath()));
projectDataDirectory = fileSystem.createDirectory("project-data-dir");
workspace = new WorkspaceFileSystem(workspaceRoot, fileSystem);
});
BlazeImportSettingsManager.getInstance(getProject()).setImportSettings(new BlazeImportSettings(workspaceRoot.toString(), "test-project", projectDataDirectory.getPath(), workspaceRoot.fileForPath(new WorkspacePath("project-view-file")).getPath(), buildSystem()));
registerApplicationService(FileOperationProvider.class, new TestFileSystem.MockFileOperationProvider());
registerApplicationService(InputStreamProvider.class, file -> {
VirtualFile vf = fileSystem.findFile(file.getPath());
if (vf == null) {
throw new FileNotFoundException();
}
return vf.getInputStream();
});
registerApplicationService(VirtualFileSystemProvider.class, new TestFileSystem.TempVirtualFileSystemProvider());
String requiredPlugins = System.getProperty("idea.required.plugins.id");
if (requiredPlugins != null) {
VerifyRequiredPluginsEnabled.runCheck(requiredPlugins.split(","));
}
}
use of com.google.idea.blaze.base.settings.BlazeImportSettings in project intellij by bazelbuild.
the class BlazeAndroidProjectPathsTest method mockBlazeImportSettings.
private void mockBlazeImportSettings(Container projectServices) {
BlazeImportSettingsManager importSettingsManager = new BlazeImportSettingsManager();
importSettingsManager.setImportSettings(new BlazeImportSettings("", "", "", "", Blaze.BuildSystem.Blaze));
projectServices.register(BlazeImportSettingsManager.class, importSettingsManager);
}
use of com.google.idea.blaze.base.settings.BlazeImportSettings in project intellij by bazelbuild.
the class BlazeBuildSystemServiceTest method mockBlazeImportSettings.
private void mockBlazeImportSettings(Container projectServices) {
BlazeImportSettingsManager importSettingsManager = new BlazeImportSettingsManager();
importSettingsManager.setImportSettings(new BlazeImportSettings("", "", "", "", Blaze.BuildSystem.Blaze));
projectServices.register(BlazeImportSettingsManager.class, importSettingsManager);
}
use of com.google.idea.blaze.base.settings.BlazeImportSettings in project intellij by bazelbuild.
the class BlazeAndroidModelTest method initTest.
@Override
protected void initTest(Container applicationServices, Container projectServices) {
applicationServices.register(FileTypeManager.class, new MockFileTypeManager());
applicationServices.register(FileDocumentManager.class, new MockFileDocumentManagerImpl(null, null));
applicationServices.register(VirtualFileManager.class, mock(VirtualFileManager.class));
applicationServices.register(BlazeBuildService.class, new BlazeBuildService());
projectServices.register(ProjectScopeBuilder.class, new ProjectScopeBuilderImpl(project));
projectServices.register(ProjectViewManager.class, new MockProjectViewManager());
projectServices.register(BlazeProjectDataManager.class, new BlazeProjectDataManagerImpl(project));
BlazeImportSettingsManager manager = new BlazeImportSettingsManager();
manager.setImportSettings(new BlazeImportSettings("", "", "", "", BuildSystem.Blaze));
projectServices.register(BlazeImportSettingsManager.class, manager);
facade = new MockJavaPsiFacade(project, new MockPsiManager(project), ImmutableList.of("com.google.example.Modified", "com.google.example.NotModified"));
projectServices.register(JavaPsiFacade.class, facade);
module = new MockModule(() -> {
});
model = new BlazeAndroidModel(project, module, null, mock(SourceProvider.class), null, "", 0);
}
Aggregations