use of com.google.devtools.build.lib.rules.android.deployinfo.AndroidDeployInfoOuterClass.Artifact in project intellij by bazelbuild.
the class BlazeApkDeployInfoProtoHelper method extractDeployInfoAndInvalidateManifests.
public BlazeAndroidDeployInfo extractDeployInfoAndInvalidateManifests(Project project, File executionRoot, AndroidDeployInfo deployInfoProto) throws GetDeployInfoException {
File mergedManifestFile = new File(executionRoot, deployInfoProto.getMergedManifest().getExecRootPath());
ParsedManifest mergedManifest = getParsedManifestSafe(project, mergedManifestFile);
ParsedManifestService.getInstance(project).invalidateCachedManifest(mergedManifestFile);
// android_test targets uses additional merged manifests field of the deploy info proto to hold
// the manifest of the test target APK.
ParsedManifest testTargetMergedManifest = null;
List<Artifact> additionalManifests = deployInfoProto.getAdditionalMergedManifestsList();
if (additionalManifests.size() == 1) {
File testTargetMergedManifestFile = new File(executionRoot, additionalManifests.get(0).getExecRootPath());
testTargetMergedManifest = getParsedManifestSafe(project, testTargetMergedManifestFile);
ParsedManifestService.getInstance(project).invalidateCachedManifest(testTargetMergedManifestFile);
}
ImmutableList<File> apksToDeploy = deployInfoProto.getApksToDeployList().stream().map(artifact -> new File(executionRoot, artifact.getExecRootPath())).collect(ImmutableList.toImmutableList());
return new BlazeAndroidDeployInfo(mergedManifest, testTargetMergedManifest, apksToDeploy);
}
use of com.google.devtools.build.lib.rules.android.deployinfo.AndroidDeployInfoOuterClass.Artifact in project intellij by bazelbuild.
the class BlazeApkDeployInfoProtoHelper method extractInstrumentationTestDeployInfoAndInvalidateManifests.
public BlazeAndroidDeployInfo extractInstrumentationTestDeployInfoAndInvalidateManifests(Project project, File executionRoot, AndroidDeployInfo instrumentorProto, AndroidDeployInfo appProto) throws GetDeployInfoException {
File instrumentorManifest = new File(executionRoot, instrumentorProto.getMergedManifest().getExecRootPath());
ParsedManifest parsedInstrumentorManifest = getParsedManifestSafe(project, instrumentorManifest);
ParsedManifestService.getInstance(project).invalidateCachedManifest(instrumentorManifest);
File appManifest = new File(executionRoot, appProto.getMergedManifest().getExecRootPath());
ParsedManifest parsedAppManifest = getParsedManifestSafe(project, appManifest);
ParsedManifestService.getInstance(project).invalidateCachedManifest(appManifest);
ImmutableList<File> apksToDeploy = Stream.concat(instrumentorProto.getApksToDeployList().stream(), appProto.getApksToDeployList().stream()).map(artifact -> new File(executionRoot, artifact.getExecRootPath())).collect(ImmutableList.toImmutableList());
return new BlazeAndroidDeployInfo(parsedInstrumentorManifest, parsedAppManifest, apksToDeploy);
}
Aggregations