use of com.google.idea.blaze.base.command.buildresult.RemoteOutputArtifact in project intellij by bazelbuild.
the class RemoteOutputsCacheTest method testEndingDot.
@Test
public void testEndingDot() {
RemoteOutputArtifact artifact = mock(RemoteOutputArtifact.class);
when(artifact.getKey()).thenReturn("k8-opt/foo/bar/foo.");
assertThat(RemoteOutputsCache.getCacheKey(artifact)).isEqualTo("foo_bddfde49.");
}
use of com.google.idea.blaze.base.command.buildresult.RemoteOutputArtifact in project intellij by bazelbuild.
the class RemoteOutputsCacheTest method testDoubleExtension.
@Test
public void testDoubleExtension() {
RemoteOutputArtifact artifact = mock(RemoteOutputArtifact.class);
when(artifact.getKey()).thenReturn("k8-opt/foo/bar/proto.pb.go");
assertThat(RemoteOutputsCache.getCacheKey(artifact)).isEqualTo("proto_f767ed9d.pb.go");
}
use of com.google.idea.blaze.base.command.buildresult.RemoteOutputArtifact in project intellij by bazelbuild.
the class RemoteOutputsCacheTest method testDoubleDot.
@Test
public void testDoubleDot() {
RemoteOutputArtifact artifact = mock(RemoteOutputArtifact.class);
when(artifact.getKey()).thenReturn("k8-opt/foo/bar/foo..bar");
assertThat(RemoteOutputsCache.getCacheKey(artifact)).isEqualTo("foo_f2dbf6ee..bar");
}
use of com.google.idea.blaze.base.command.buildresult.RemoteOutputArtifact in project intellij by bazelbuild.
the class UnpackedAars method getClassJar.
/**
* Returns the merged jar derived from an AAR, in the unpacked AAR directory.
*/
@Nullable
public File getClassJar(ArtifactLocationDecoder decoder, AarLibrary library) {
if (library.libraryArtifact == null) {
return null;
}
BlazeArtifact jar = decoder.resolveOutput(library.libraryArtifact.jarForIntellijLibrary());
if (aarCache.isEmpty()) {
logger.warn("Cache state is empty");
return getFallbackFile(jar);
}
BlazeArtifact aar = decoder.resolveOutput(library.aarArtifact);
File aarDir = getAarDir(decoder, library);
// check if it was actually cached
if (aarDir == null) {
// cannot find any fallback file.
if (jar instanceof RemoteOutputArtifact) {
logger.warn(String.format("Fail to look up %s from cache state for library [aarArtifact = %s, jar = %s]", aarDir, aar, jar));
logger.debug("Cache state contains the following keys: " + aarCache.getCachedKeys());
}
return getFallbackFile(jar);
}
return UnpackedAarUtils.getJarFile(aarDir);
}
Aggregations