use of com.google.devtools.intellij.ideinfo.IntellijIdeInfo.LibraryArtifact in project bazel by bazelbuild.
the class AndroidStudioInfoAspect method makeAndroidIdeInfo.
private static AndroidIdeInfo makeAndroidIdeInfo(AndroidIdeInfoProvider androidIdeInfoProvider, DependenciesResult dependenciesResult, NestedSetBuilder<Artifact> ideResolveArtifacts) {
AndroidIdeInfo.Builder builder = AndroidIdeInfo.newBuilder();
if (androidIdeInfoProvider.getSignedApk() != null) {
builder.setApk(makeArtifactLocation(androidIdeInfoProvider.getSignedApk()));
}
Artifact manifest = androidIdeInfoProvider.getManifest();
if (manifest != null) {
builder.setManifest(makeArtifactLocation(manifest));
addResolveArtifact(ideResolveArtifacts, manifest);
}
for (Artifact artifact : androidIdeInfoProvider.getApksUnderTest()) {
builder.addDependencyApk(makeArtifactLocation(artifact));
}
for (SourceDirectory resourceDir : androidIdeInfoProvider.getResourceDirs()) {
ArtifactLocation artifactLocation = makeArtifactLocation(resourceDir);
builder.addResources(artifactLocation);
}
if (androidIdeInfoProvider.getJavaPackage() != null) {
builder.setJavaPackage(androidIdeInfoProvider.getJavaPackage());
}
String idlImportRoot = androidIdeInfoProvider.getIdlImportRoot();
if (idlImportRoot != null) {
builder.setIdlImportRoot(idlImportRoot);
}
boolean hasIdlSources = !androidIdeInfoProvider.getIdlSrcs().isEmpty();
builder.setHasIdlSources(hasIdlSources);
if (hasIdlSources) {
LibraryArtifact idlLibraryArtifact = makeLibraryArtifact(ideResolveArtifacts, androidIdeInfoProvider.getIdlClassJar(), null, androidIdeInfoProvider.getIdlSourceJar());
if (idlLibraryArtifact != null) {
builder.setIdlJar(idlLibraryArtifact);
}
}
builder.setGenerateResourceClass(androidIdeInfoProvider.definesAndroidResources());
if (dependenciesResult.resources != null) {
builder.setLegacyResources(dependenciesResult.resources.toString());
}
OutputJar resourceJar = androidIdeInfoProvider.getResourceJar();
if (resourceJar != null) {
LibraryArtifact resourceLibraryArtifact = makeLibraryArtifact(ideResolveArtifacts, resourceJar.getClassJar(), resourceJar.getIJar(), resourceJar.getSrcJar());
if (resourceLibraryArtifact != null) {
builder.setResourceJar(resourceLibraryArtifact);
}
}
return builder.build();
}
Aggregations