Search in sources :

Example 6 with BlazeAndroidSyncData

use of com.google.idea.blaze.android.sync.model.BlazeAndroidSyncData in project intellij by bazelbuild.

the class AndroidPrefetchFileSource method addFilesToPrefetch.

@Override
public void addFilesToPrefetch(Project project, ProjectViewSet projectViewSet, ImportRoots importRoots, BlazeProjectData blazeProjectData, Set<File> files) {
    BlazeAndroidSyncData syncData = blazeProjectData.syncState.get(BlazeAndroidSyncData.class);
    if (syncData == null) {
        return;
    }
    if (syncData.importResult.resourceLibrary == null) {
        return;
    }
    ArtifactLocationDecoder artifactLocationDecoder = blazeProjectData.artifactLocationDecoder;
    files.addAll(artifactLocationDecoder.decodeAll(syncData.importResult.resourceLibrary.sources));
}
Also used : ArtifactLocationDecoder(com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder) BlazeAndroidSyncData(com.google.idea.blaze.android.sync.model.BlazeAndroidSyncData)

Example 7 with BlazeAndroidSyncData

use of com.google.idea.blaze.android.sync.model.BlazeAndroidSyncData in project intellij by bazelbuild.

the class BlazeAndroidLibrarySource method getLibraries.

@Override
public List<BlazeLibrary> getLibraries() {
    BlazeAndroidSyncData syncData = blazeProjectData.syncState.get(BlazeAndroidSyncData.class);
    if (syncData == null) {
        return ImmutableList.of();
    }
    ImmutableList.Builder<BlazeLibrary> libraries = ImmutableList.builder();
    if (syncData.importResult.resourceLibrary != null) {
        libraries.add(syncData.importResult.resourceLibrary);
    }
    if (syncData.importResult.javacJar != null) {
        libraries.add(new BlazeJarLibrary(new LibraryArtifact(null, syncData.importResult.javacJar, ImmutableList.of())));
    }
    libraries.addAll(syncData.importResult.aarLibraries);
    return libraries.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) BlazeJarLibrary(com.google.idea.blaze.java.sync.model.BlazeJarLibrary) BlazeLibrary(com.google.idea.blaze.base.model.BlazeLibrary) BlazeAndroidSyncData(com.google.idea.blaze.android.sync.model.BlazeAndroidSyncData) LibraryArtifact(com.google.idea.blaze.base.ideinfo.LibraryArtifact)

Aggregations

BlazeAndroidSyncData (com.google.idea.blaze.android.sync.model.BlazeAndroidSyncData)7 AndroidSdkPlatform (com.google.idea.blaze.android.sync.model.AndroidSdkPlatform)4 AndroidResourceModule (com.google.idea.blaze.android.sync.model.AndroidResourceModule)3 TargetKey (com.google.idea.blaze.base.ideinfo.TargetKey)3 ArtifactLocationDecoder (com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder)3 File (java.io.File)3 ImmutableList (com.google.common.collect.ImmutableList)2 AndroidIdeInfo (com.google.idea.blaze.base.ideinfo.AndroidIdeInfo)2 TargetIdeInfo (com.google.idea.blaze.base.ideinfo.TargetIdeInfo)2 BlazeProjectData (com.google.idea.blaze.base.model.BlazeProjectData)2 Module (com.intellij.openapi.module.Module)2 ModifiableRootModel (com.intellij.openapi.roots.ModifiableRootModel)2 ModuleOrderEntry (com.intellij.openapi.roots.ModuleOrderEntry)2 SourceProvider (com.android.builder.model.SourceProvider)1 ModuleResourceRepository (com.android.tools.idea.res.ModuleResourceRepository)1 MultiResourceRepository (com.android.tools.idea.res.MultiResourceRepository)1 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 Sets (com.google.common.collect.Sets)1 GeneratedAndroidResourcesSection (com.google.idea.blaze.android.projectview.GeneratedAndroidResourcesSection)1