diff options
author | elenairina <elenairina@google.com> | 2018-08-02 02:27:57 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-02 02:30:09 -0700 |
commit | 2987ba80eea24051d3834b8ee00a5397ddd262c5 (patch) | |
tree | 5f3afe62c18fc4c3570d6f104a99572a60b1be64 /src/test/java/com/google/devtools/build/lib/rules | |
parent | 932a745b662bd84546c81b99a99b4fd1a25c4377 (diff) |
Return Java providers only once
through JavaInfo, instead of returning them also through ConfiguredTarget. Since these providers can not be found in ConfiguredTarget anymore they have to be retrieved from JavaInfo instead.
RELNOTES: None.
PiperOrigin-RevId: 207068520
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/android/AndroidLibraryTest.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidLibraryTest.java index bb9d76d744..5b803e0761 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidLibraryTest.java @@ -477,8 +477,9 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase { " srcs = ['dummy4.java'])"); ConfiguredTarget target = getConfiguredTarget("//java/com/google/exports:dummy"); - List<Label> exports = ImmutableList.copyOf( - target.getProvider(JavaExportsProvider.class).getTransitiveExports()); + List<Label> exports = + ImmutableList.copyOf( + JavaInfo.getProvider(JavaExportsProvider.class, target).getTransitiveExports()); assertThat(exports) .containsExactly( Label.parseAbsolute("//java/com/google/exports:dummy2", ImmutableMap.of()), @@ -1750,11 +1751,13 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase { Iterable<String> c1Jars = ActionsTestUtil.baseArtifactNames( - c1Target.getProvider(JavaCompilationInfoProvider.class).getCompilationClasspath()); + JavaInfo.getProvider(JavaCompilationInfoProvider.class, c1Target) + .getCompilationClasspath()); Iterable<String> c2Jars = ActionsTestUtil.baseArtifactNames( - c2Target.getProvider(JavaCompilationInfoProvider.class).getCompilationClasspath()); + JavaInfo.getProvider(JavaCompilationInfoProvider.class, c2Target) + .getCompilationClasspath()); assertThat(c1Jars).containsExactly("liba-hjar.jar"); assertThat(c2Jars).containsExactly("liba-hjar.jar"); @@ -1774,10 +1777,12 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase { ImmutableList<Artifact> bClasspath = ImmutableList.copyOf( - bTarget.getProvider(JavaCompilationInfoProvider.class).getCompilationClasspath()); + JavaInfo.getProvider(JavaCompilationInfoProvider.class, bTarget) + .getCompilationClasspath()); ImmutableList<Artifact> cClasspath = ImmutableList.copyOf( - cTarget.getProvider(JavaCompilationInfoProvider.class).getCompilationClasspath()); + JavaInfo.getProvider(JavaCompilationInfoProvider.class, cTarget) + .getCompilationClasspath()); assertThat(bClasspath).isEmpty(); assertThat(cClasspath) |