use of com.facebook.buck.jvm.java.JavaBinaryRuleBuilder in project buck by facebook.
the class GenruleTest method createSampleJavaBinaryRule.
private BuildRule createSampleJavaBinaryRule(BuildRuleResolver ruleResolver) throws NoSuchBuildTargetException {
// Create a java_binary that depends on a java_library so it is possible to create a
// java_binary rule with a classpath entry and a main class.
BuildRule javaLibrary = JavaLibraryBuilder.createBuilder(BuildTargetFactory.newInstance("//java/com/facebook/util:util")).addSrc(Paths.get("java/com/facebook/util/ManifestGenerator.java")).build(ruleResolver);
BuildTarget buildTarget = BuildTargetFactory.newInstance("//java/com/facebook/util:ManifestGenerator");
return new JavaBinaryRuleBuilder(buildTarget).setDeps(ImmutableSortedSet.of(javaLibrary.getBuildTarget())).setMainClass("com.facebook.util.ManifestGenerator").build(ruleResolver);
}
Aggregations