Search in sources :

Example 1 with BlazeKotlinImportResult

use of com.google.idea.blaze.kotlin.sync.model.BlazeKotlinImportResult in project intellij by bazelbuild.

the class BlazeKotlinSyncPlugin 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 (!workspaceLanguageSettings.isLanguageActive(LanguageClass.KOTLIN)) {
        return;
    }
    BlazeKotlinWorkspaceImporter blazeKotlinWorkspaceImporter = new BlazeKotlinWorkspaceImporter(project, workspaceRoot, projectViewSet, targetMap);
    BlazeKotlinImportResult importResult = Scope.push(context, (childContext) -> {
        childContext.push(new TimingScope("KotlinWorkspaceImporter", TimingScope.EventType.Other));
        return blazeKotlinWorkspaceImporter.importWorkspace();
    });
    BlazeKotlinSyncData syncData = new BlazeKotlinSyncData(importResult);
    syncStateBuilder.put(BlazeKotlinSyncData.class, syncData);
}
Also used : BlazeKotlinImportResult(com.google.idea.blaze.kotlin.sync.model.BlazeKotlinImportResult) TimingScope(com.google.idea.blaze.base.scope.scopes.TimingScope) BlazeKotlinSyncData(com.google.idea.blaze.kotlin.sync.model.BlazeKotlinSyncData) BlazeKotlinWorkspaceImporter(com.google.idea.blaze.kotlin.sync.importer.BlazeKotlinWorkspaceImporter)

Aggregations

TimingScope (com.google.idea.blaze.base.scope.scopes.TimingScope)1 BlazeKotlinWorkspaceImporter (com.google.idea.blaze.kotlin.sync.importer.BlazeKotlinWorkspaceImporter)1 BlazeKotlinImportResult (com.google.idea.blaze.kotlin.sync.model.BlazeKotlinImportResult)1 BlazeKotlinSyncData (com.google.idea.blaze.kotlin.sync.model.BlazeKotlinSyncData)1