Skip to content

Instantly share code, notes, and snippets.

@stepango
Created September 21, 2019 10:46
Show Gist options
  • Save stepango/05c8ba3007f4e2dbc82b6b0809d529a1 to your computer and use it in GitHub Desktop.
Save stepango/05c8ba3007f4e2dbc82b6b0809d529a1 to your computer and use it in GitHub Desktop.
Call Bazel from Gradle
apply plugin: 'java'
buildDir = "gradleBuild"
def buildBazel = tasks.register("buildBazel", Exec) {
finalizedBy(tasks.named("compileJava"))
workingDir '../'
commandLine 'bazel', 'build', '//' + project.name + ":bali"
}
tasks.register("bazelJar", Jar) {
dependsOn(buildBazel)
archiveFile file("../bazel-bin/bazel_wrapepr/libbali.jar")
}
artifacts.add("default", bazelJar)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment