Search in sources :

Example 1 with BlazeAndroidWorkspaceImporter

use of com.google.idea.blaze.android.sync.importer.BlazeAndroidWorkspaceImporter in project intellij by bazelbuild.

the class BlazeAndroidSyncPlugin method updateSyncState.

@Override
public void updateSyncState(Project project, BlazeContext context, WorkspaceRoot workspaceRoot, ProjectViewSet projectViewSet, WorkspaceLanguageSettings workspaceLanguageSettings, BlazeInfo blazeInfo, @Nullable WorkingSet workingSet, WorkspacePathResolver workspacePathResolver, ArtifactLocationDecoder artifactLocationDecoder, TargetMap targetMap, SyncState.Builder syncStateBuilder, @Nullable SyncState previousSyncState) {
    if (!isAndroidWorkspace(workspaceLanguageSettings)) {
        return;
    }
    AndroidSdkPlatform androidSdkPlatform = AndroidSdkFromProjectView.getAndroidSdkPlatform(context, projectViewSet);
    JavaSourceFilter sourceFilter = new JavaSourceFilter(project, workspaceRoot, projectViewSet, targetMap);
    BlazeAndroidWorkspaceImporter workspaceImporter = new BlazeAndroidWorkspaceImporter(project, context, workspaceRoot, projectViewSet, targetMap, sourceFilter, artifactLocationDecoder);
    BlazeAndroidImportResult importResult = Scope.push(context, (childContext) -> {
        childContext.push(new TimingScope("AndroidWorkspaceImporter", EventType.Other));
        return workspaceImporter.importWorkspace();
    });
    BlazeAndroidSyncData syncData = new BlazeAndroidSyncData(importResult, androidSdkPlatform);
    syncStateBuilder.put(BlazeAndroidSyncData.class, syncData);
}
Also used : BlazeAndroidWorkspaceImporter(com.google.idea.blaze.android.sync.importer.BlazeAndroidWorkspaceImporter) AndroidSdkPlatform(com.google.idea.blaze.android.sync.model.AndroidSdkPlatform) TimingScope(com.google.idea.blaze.base.scope.scopes.TimingScope) JavaSourceFilter(com.google.idea.blaze.java.sync.importer.JavaSourceFilter) BlazeAndroidImportResult(com.google.idea.blaze.android.sync.model.BlazeAndroidImportResult) BlazeAndroidSyncData(com.google.idea.blaze.android.sync.model.BlazeAndroidSyncData)

Aggregations

BlazeAndroidWorkspaceImporter (com.google.idea.blaze.android.sync.importer.BlazeAndroidWorkspaceImporter)1 AndroidSdkPlatform (com.google.idea.blaze.android.sync.model.AndroidSdkPlatform)1 BlazeAndroidImportResult (com.google.idea.blaze.android.sync.model.BlazeAndroidImportResult)1 BlazeAndroidSyncData (com.google.idea.blaze.android.sync.model.BlazeAndroidSyncData)1 TimingScope (com.google.idea.blaze.base.scope.scopes.TimingScope)1 JavaSourceFilter (com.google.idea.blaze.java.sync.importer.JavaSourceFilter)1