Search in sources :

Example 1 with JavaProvider

use of com.google.devtools.build.lib.rules.java.JavaProvider in project bazel by bazelbuild.

the class SkylarkJavaLiteProtoLibraryTest method getProvider.

private static <P extends TransitiveInfoProvider> P getProvider(Class<P> providerClass, ConfiguredTarget target) {
    SkylarkProviders skylarkProviders = target.getProvider(SkylarkProviders.class);
    JavaProvider javaProvider = (JavaProvider) skylarkProviders.getDeclaredProvider(JavaProvider.JAVA_PROVIDER.getKey());
    return javaProvider.getProvider(providerClass);
}
Also used : SkylarkProviders(com.google.devtools.build.lib.analysis.SkylarkProviders) JavaProvider(com.google.devtools.build.lib.rules.java.JavaProvider)

Aggregations

SkylarkProviders (com.google.devtools.build.lib.analysis.SkylarkProviders)1 JavaProvider (com.google.devtools.build.lib.rules.java.JavaProvider)1