Search in sources :

Example 1 with BazelBuildSystemProvider

use of com.google.idea.blaze.base.bazel.BazelBuildSystemProvider in project intellij by bazelbuild.

the class BuildTargetFinderTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    super.initTest(applicationServices, projectServices);
    applicationServices.register(FileOperationProvider.class, fileOperationProvider);
    applicationServices.register(ExperimentService.class, new MockExperimentService());
    applicationServices.register(BlazeImportSettingsManager.class, mock(BlazeImportSettingsManager.class));
    ExtensionPoint<BuildSystemProvider> extensionPoint = registerExtensionPoint(BuildSystemProvider.EP_NAME, BuildSystemProvider.class);
    extensionPoint.registerExtension(new BazelBuildSystemProvider());
}
Also used : MockExperimentService(com.google.idea.common.experiments.MockExperimentService) BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider) BuildSystemProvider(com.google.idea.blaze.base.bazel.BuildSystemProvider) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider)

Example 2 with BazelBuildSystemProvider

use of com.google.idea.blaze.base.bazel.BazelBuildSystemProvider in project intellij by bazelbuild.

the class BlazeConfigurationResolverTest 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());
    compilerVersionChecker = new MockCompilerVersionChecker("1234");
    applicationServices.register(CompilerVersionChecker.class, compilerVersionChecker);
    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(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);
}
Also used : MockExperimentService(com.google.idea.common.experiments.MockExperimentService) BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) BlazeImportSettings(com.google.idea.blaze.base.settings.BlazeImportSettings) VirtualFileManager(com.intellij.openapi.vfs.VirtualFileManager) VirtualFileSystemProvider(com.google.idea.blaze.base.io.VirtualFileSystemProvider) LocalFileSystem(com.intellij.openapi.vfs.LocalFileSystem) ProgressManagerImpl(com.intellij.openapi.progress.impl.ProgressManagerImpl) BuildSystemProvider(com.google.idea.blaze.base.bazel.BuildSystemProvider) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider) MockBlazeExecutor(com.google.idea.blaze.base.async.executor.MockBlazeExecutor)

Example 3 with BazelBuildSystemProvider

use of com.google.idea.blaze.base.bazel.BazelBuildSystemProvider 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);
}
Also used : MockExperimentService(com.google.idea.common.experiments.MockExperimentService) BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) BlazeImportSettings(com.google.idea.blaze.base.settings.BlazeImportSettings) VirtualFileManager(com.intellij.openapi.vfs.VirtualFileManager) ProgressManagerImpl(com.intellij.openapi.progress.impl.ProgressManagerImpl) BuildSystemProvider(com.google.idea.blaze.base.bazel.BuildSystemProvider) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider) MockPsiManager(com.intellij.mock.MockPsiManager) MockBlazeExecutor(com.google.idea.blaze.base.async.executor.MockBlazeExecutor) VirtualFileSystemProvider(com.google.idea.blaze.base.io.VirtualFileSystemProvider) LocalFileSystem(com.intellij.openapi.vfs.LocalFileSystem) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider)

Example 4 with BazelBuildSystemProvider

use of com.google.idea.blaze.base.bazel.BazelBuildSystemProvider in project intellij by bazelbuild.

the class BlazeKotlinSyncPluginTest method initTest.

@Override
protected void initTest(@NotNull Container applicationServices, @NotNull Container projectServices) {
    super.initTest(applicationServices, projectServices);
    ExtensionPointImpl<BuildSystemProvider> buildSystems = registerExtensionPoint(BuildSystemProvider.EP_NAME, BuildSystemProvider.class);
    buildSystems.registerExtension(new BazelBuildSystemProvider());
    ExtensionPointImpl<BlazeSyncPlugin> syncPlugins = registerExtensionPoint(BlazeSyncPlugin.EP_NAME, BlazeSyncPlugin.class);
    syncPlugins.registerExtension(new BlazeJavaSyncPlugin());
    syncPlugins.registerExtension(new BlazeKotlinSyncPlugin());
    context = new BlazeContext();
    context.addOutputSink(IssueOutput.class, errorCollector);
}
Also used : BlazeContext(com.google.idea.blaze.base.scope.BlazeContext) BlazeJavaSyncPlugin(com.google.idea.blaze.java.sync.BlazeJavaSyncPlugin) BlazeSyncPlugin(com.google.idea.blaze.base.sync.BlazeSyncPlugin) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider) BuildSystemProvider(com.google.idea.blaze.base.bazel.BuildSystemProvider) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider)

Example 5 with BazelBuildSystemProvider

use of com.google.idea.blaze.base.bazel.BazelBuildSystemProvider in project intellij by bazelbuild.

the class ExecutionRootPathResolverTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    ExtensionPoint<BuildSystemProvider> extensionPoint = registerExtensionPoint(BuildSystemProvider.EP_NAME, BuildSystemProvider.class);
    extensionPoint.registerExtension(new BazelBuildSystemProvider());
    pathResolver = new ExecutionRootPathResolver(BuildSystem.Bazel, WORKSPACE_ROOT, new File(EXECUTION_ROOT), new WorkspacePathResolverImpl(WORKSPACE_ROOT));
}
Also used : BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider) BuildSystemProvider(com.google.idea.blaze.base.bazel.BuildSystemProvider) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider) File(java.io.File)

Aggregations

BazelBuildSystemProvider (com.google.idea.blaze.base.bazel.BazelBuildSystemProvider)5 BuildSystemProvider (com.google.idea.blaze.base.bazel.BuildSystemProvider)5 BlazeImportSettingsManager (com.google.idea.blaze.base.settings.BlazeImportSettingsManager)3 MockExperimentService (com.google.idea.common.experiments.MockExperimentService)3 MockBlazeExecutor (com.google.idea.blaze.base.async.executor.MockBlazeExecutor)2 VirtualFileSystemProvider (com.google.idea.blaze.base.io.VirtualFileSystemProvider)2 BlazeImportSettings (com.google.idea.blaze.base.settings.BlazeImportSettings)2 ProgressManagerImpl (com.intellij.openapi.progress.impl.ProgressManagerImpl)2 LocalFileSystem (com.intellij.openapi.vfs.LocalFileSystem)2 VirtualFileManager (com.intellij.openapi.vfs.VirtualFileManager)2 BlazeContext (com.google.idea.blaze.base.scope.BlazeContext)1 BlazeSyncPlugin (com.google.idea.blaze.base.sync.BlazeSyncPlugin)1 BlazeJavaSyncPlugin (com.google.idea.blaze.java.sync.BlazeJavaSyncPlugin)1 MockPsiManager (com.intellij.mock.MockPsiManager)1 File (java.io.File)1