Search in sources :

Example 1 with GenericBlazeRules

use of com.google.idea.blaze.base.model.primitives.GenericBlazeRules in project intellij by bazelbuild.

the class RuleNameHeuristicTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    super.initTest(applicationServices, projectServices);
    ExtensionPointImpl<TestTargetHeuristic> ep = registerExtensionPoint(TestTargetHeuristic.EP_NAME, TestTargetHeuristic.class);
    ep.registerExtension(new TargetNameHeuristic());
    ExtensionPointImpl<Kind.Provider> kindProvider = registerExtensionPoint(Kind.Provider.EP_NAME, Kind.Provider.class);
    kindProvider.registerExtension(new GenericBlazeRules());
    applicationServices.register(Kind.ApplicationState.class, new Kind.ApplicationState());
}
Also used : Kind(com.google.idea.blaze.base.model.primitives.Kind) GenericBlazeRules(com.google.idea.blaze.base.model.primitives.GenericBlazeRules)

Example 2 with GenericBlazeRules

use of com.google.idea.blaze.base.model.primitives.GenericBlazeRules in project intellij by bazelbuild.

the class BlazeBuildTargetSharderTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    registerExtensionPoint(BuildFlagsProvider.EP_NAME, BuildFlagsProvider.class);
    registerExtensionPoint(BuildBatchingService.EP_NAME, BuildBatchingService.class).registerExtension(fakeBuildBatchingService, testDisposable);
    registerExtensionPoint(TargetShardSizeLimit.EP_NAME, TargetShardSizeLimit.class).registerExtension(OptionalInt::empty, testDisposable);
    registerExtensionPoint(BlazeSyncPlugin.EP_NAME, BlazeSyncPlugin.class).registerExtension(new FakeBlazeSyncPlugin(), testDisposable);
    registerExtensionPoint(Kind.Provider.EP_NAME, Kind.Provider.class).registerExtension(new GenericBlazeRules(), testDisposable);
    registerExtensionPoint(BlazeConsoleLineProcessorProvider.EP_NAME, BlazeConsoleLineProcessorProvider.class).registerExtension(new GeneralProvider(), testDisposable);
    applicationServices.register(ExperimentService.class, mockExperimentService);
    applicationServices.register(ExternalTaskProvider.class, fakeWildCardTargetExpanderExternalTaskProvider);
    applicationServices.register(PrefetchService.class, new FakePrefetchService());
    applicationServices.register(FileOperationProvider.class, new FakeFileOperationProvider());
    applicationServices.register(Kind.ApplicationState.class, new Kind.ApplicationState());
    projectServices.register(BlazeImportSettingsManager.class, new BlazeImportSettingsManager(getProject()));
}
Also used : BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) GenericBlazeRules(com.google.idea.blaze.base.model.primitives.GenericBlazeRules) BlazeConsoleLineProcessorProvider(com.google.idea.blaze.base.console.BlazeConsoleLineProcessorProvider) OptionalInt(java.util.OptionalInt) ExternalTaskProvider(com.google.idea.blaze.base.async.process.ExternalTaskProvider) GeneralProvider(com.google.idea.blaze.base.console.BlazeConsoleLineProcessorProvider.GeneralProvider) BuildFlagsProvider(com.google.idea.blaze.base.command.BuildFlagsProvider) BlazeConsoleLineProcessorProvider(com.google.idea.blaze.base.console.BlazeConsoleLineProcessorProvider) BuildSystemProvider(com.google.idea.blaze.base.bazel.BuildSystemProvider) FileOperationProvider(com.google.idea.blaze.base.io.FileOperationProvider) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider) Kind(com.google.idea.blaze.base.model.primitives.Kind) BlazeSyncPlugin(com.google.idea.blaze.base.sync.BlazeSyncPlugin) GeneralProvider(com.google.idea.blaze.base.console.BlazeConsoleLineProcessorProvider.GeneralProvider)

Example 3 with GenericBlazeRules

use of com.google.idea.blaze.base.model.primitives.GenericBlazeRules in project intellij by bazelbuild.

the class TransitiveDependencyMapTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    super.initTest(applicationServices, projectServices);
    ExtensionPointImpl<Kind.Provider> ep = registerExtensionPoint(Kind.Provider.EP_NAME, Kind.Provider.class);
    ep.registerExtension(new GenericBlazeRules());
    applicationServices.register(Kind.ApplicationState.class, new Kind.ApplicationState());
    targetMap = buildTargetMap();
    projectServices.register(BlazeProjectDataManager.class, new MockBlazeProjectDataManager(MockBlazeProjectDataBuilder.builder(workspaceRoot).setTargetMap(targetMap).build()));
    projectServices.register(TransitiveDependencyMap.class, new TransitiveDependencyMap(project));
    transitiveDependencyMap = TransitiveDependencyMap.getInstance(project);
}
Also used : Kind(com.google.idea.blaze.base.model.primitives.Kind) GenericBlazeRules(com.google.idea.blaze.base.model.primitives.GenericBlazeRules) MockBlazeProjectDataManager(com.google.idea.blaze.base.model.MockBlazeProjectDataManager)

Example 4 with GenericBlazeRules

use of com.google.idea.blaze.base.model.primitives.GenericBlazeRules in project intellij by bazelbuild.

the class BlazeAndroidWorkspaceImporterTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    experimentService = new MockExperimentService();
    applicationServices.register(ExperimentService.class, experimentService);
    BlazeExecutor blazeExecutor = new MockBlazeExecutor();
    applicationServices.register(BlazeExecutor.class, blazeExecutor);
    projectServices.register(BlazeImportSettingsManager.class, new BlazeImportSettingsManager(project));
    BlazeImportSettingsManager.getInstance(getProject()).setImportSettings(DUMMY_IMPORT_SETTINGS);
    MockFileOperationProvider mockFileOperationProvider = new MockFileOperationProvider();
    applicationServices.register(FileOperationProvider.class, mockFileOperationProvider);
    ExtensionPointImpl<Provider> targetKindEp = registerExtensionPoint(Provider.EP_NAME, Provider.class);
    targetKindEp.registerExtension(new AndroidBlazeRules());
    targetKindEp.registerExtension(new JavaBlazeRules());
    targetKindEp.registerExtension(new GenericBlazeRules());
    applicationServices.register(Kind.ApplicationState.class, new Kind.ApplicationState());
    retentionFilterEp = registerExtensionPoint(GeneratedResourceRetentionFilter.EP_NAME, GeneratedResourceRetentionFilter.class);
    context = BlazeContext.create();
    context.addOutputSink(IssueOutput.class, errorCollector);
    registerExtensionPoint(BlazeJavaSyncAugmenter.EP_NAME, BlazeJavaSyncAugmenter.class);
    registerExtensionPoint(EmptyLibraryFilterSettings.EP_NAME, EmptyLibraryFilterSettings.class);
    // For importJavaWorkspace.
    applicationServices.register(JavaSourcePackageReader.class, new JavaSourcePackageReader() {

        @Nullable
        @Override
        public String getDeclaredPackageOfJavaFile(BlazeContext context, ArtifactLocationDecoder artifactLocationDecoder, SourceArtifact sourceArtifact) {
            return null;
        }
    });
    applicationServices.register(PackageManifestReader.class, new PackageManifestReader());
    applicationServices.register(PrefetchService.class, new MockPrefetchService());
    registerExtensionPoint(JavaLikeLanguage.EP_NAME, JavaLikeLanguage.class).registerExtension(new JavaLikeLanguage.Java());
    applicationServices.register(RemoteArtifactPrefetcher.class, new MockRemoteArtifactPrefetcher());
}
Also used : MockExperimentService(com.google.idea.common.experiments.MockExperimentService) JavaBlazeRules(com.google.idea.blaze.java.JavaBlazeRules) GeneratedResourceRetentionFilter(com.google.idea.blaze.android.sync.importer.problems.GeneratedResourceRetentionFilter) MockBlazeExecutor(com.google.idea.blaze.base.async.executor.MockBlazeExecutor) BlazeContext(com.google.idea.blaze.base.scope.BlazeContext) MockPrefetchService(com.google.idea.blaze.base.prefetch.MockPrefetchService) MockBlazeExecutor(com.google.idea.blaze.base.async.executor.MockBlazeExecutor) BlazeExecutor(com.google.idea.blaze.base.async.executor.BlazeExecutor) Kind(com.google.idea.blaze.base.model.primitives.Kind) MockArtifactLocationDecoder(com.google.idea.blaze.base.sync.workspace.MockArtifactLocationDecoder) ArtifactLocationDecoder(com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder) JavaSourcePackageReader(com.google.idea.blaze.java.sync.source.JavaSourcePackageReader) BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) JavaLikeLanguage(com.google.idea.blaze.java.sync.source.JavaLikeLanguage) PackageManifestReader(com.google.idea.blaze.java.sync.source.PackageManifestReader) GenericBlazeRules(com.google.idea.blaze.base.model.primitives.GenericBlazeRules) MockRemoteArtifactPrefetcher(com.google.idea.blaze.base.sync.MockRemoteArtifactPrefetcher) SourceArtifact(com.google.idea.blaze.java.sync.source.SourceArtifact) BuildSystemProvider(com.google.idea.blaze.base.bazel.BuildSystemProvider) FileOperationProvider(com.google.idea.blaze.base.io.FileOperationProvider) Provider(com.google.idea.blaze.base.model.primitives.Kind.Provider) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider) AndroidBlazeRules(com.google.idea.blaze.java.AndroidBlazeRules) Nullable(javax.annotation.Nullable)

Example 5 with GenericBlazeRules

use of com.google.idea.blaze.base.model.primitives.GenericBlazeRules in project intellij by bazelbuild.

the class BuildEventProtocolOutputReaderTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    super.initTest(applicationServices, projectServices);
    ExtensionPointImpl<Kind.Provider> ep = registerExtensionPoint(Kind.Provider.EP_NAME, Kind.Provider.class);
    ep.registerExtension(new GenericBlazeRules());
    applicationServices.register(Kind.ApplicationState.class, new Kind.ApplicationState());
    ExtensionPointImpl<OutputArtifactParser> parserEp = registerExtensionPoint(OutputArtifactParser.EP_NAME, OutputArtifactParser.class);
    parserEp.registerExtension(new OutputArtifactParser.LocalFileParser());
}
Also used : Kind(com.google.idea.blaze.base.model.primitives.Kind) GenericBlazeRules(com.google.idea.blaze.base.model.primitives.GenericBlazeRules)

Aggregations

GenericBlazeRules (com.google.idea.blaze.base.model.primitives.GenericBlazeRules)12 Kind (com.google.idea.blaze.base.model.primitives.Kind)12 FileOperationProvider (com.google.idea.blaze.base.io.FileOperationProvider)5 BlazeImportSettingsManager (com.google.idea.blaze.base.settings.BlazeImportSettingsManager)5 MockExperimentService (com.google.idea.common.experiments.MockExperimentService)5 BuildSystemProvider (com.google.idea.blaze.base.bazel.BuildSystemProvider)4 JavaBlazeRules (com.google.idea.blaze.java.JavaBlazeRules)4 JavaLikeLanguage (com.google.idea.blaze.java.sync.source.JavaLikeLanguage)4 BazelBuildSystemProvider (com.google.idea.blaze.base.bazel.BazelBuildSystemProvider)3 Provider (com.google.idea.blaze.base.model.primitives.Kind.Provider)3 MockPrefetchService (com.google.idea.blaze.base.prefetch.MockPrefetchService)3 BlazeContext (com.google.idea.blaze.base.scope.BlazeContext)3 MockRemoteArtifactPrefetcher (com.google.idea.blaze.base.sync.MockRemoteArtifactPrefetcher)3 ArtifactLocationDecoder (com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder)3 MockArtifactLocationDecoder (com.google.idea.blaze.base.sync.workspace.MockArtifactLocationDecoder)3 JavaSourcePackageReader (com.google.idea.blaze.java.sync.source.JavaSourcePackageReader)3 PackageManifestReader (com.google.idea.blaze.java.sync.source.PackageManifestReader)3 SourceArtifact (com.google.idea.blaze.java.sync.source.SourceArtifact)3 Nullable (javax.annotation.Nullable)3 BlazeExecutor (com.google.idea.blaze.base.async.executor.BlazeExecutor)2