use of com.facebook.buck.python.PythonLibrary in project buck by facebook.
the class MavenUberJarTest method onlyJavaDepsIncluded.
@Test
public void onlyJavaDepsIncluded() throws NoSuchBuildTargetException {
BuildTarget pythonTarget = BuildTargetFactory.newInstance("//:python");
BuildTarget javaTarget = BuildTargetFactory.newInstance("//:java");
PythonLibraryBuilder pythonLibraryBuilder = PythonLibraryBuilder.createBuilder(pythonTarget);
JavaLibraryBuilder javaLibraryBuilder = JavaLibraryBuilder.createBuilder(javaTarget).addResource(new DefaultBuildTargetSourcePath(pythonTarget));
TargetGraph targetGraph = TargetGraphFactory.newInstance(pythonLibraryBuilder.build(), javaLibraryBuilder.build());
BuildRuleResolver resolver = new BuildRuleResolver(targetGraph, new DefaultTargetNodeToBuildRuleTransformer());
PythonLibrary pythonLibrary = pythonLibraryBuilder.build(resolver, filesystem, targetGraph);
JavaLibrary javaLibrary = javaLibraryBuilder.build(resolver, filesystem, targetGraph);
MavenUberJar buildRule = MavenUberJar.create(javaLibrary, javaLibraryBuilder.createBuildRuleParams(resolver, filesystem), Optional.of("com.facebook.buck.jvm.java:java:jar:42"), Optional.empty());
assertThat(buildRule.getDeps(), Matchers.not(Matchers.hasItem(pythonLibrary)));
}
Aggregations