homebrew-core/Formula/bazel.rb
2016-05-17 09:00:00 -07:00

50 lines
1.4 KiB
Ruby

class Bazel < Formula
desc "Google's own build tool"
homepage "http://bazel.io/"
url "https://github.com/bazelbuild/bazel/archive/0.2.3.tar.gz"
sha256 "7e48bf3ef6da3afe619305708bfa09dde7f475ab8f1c3732faa0210a9b55c018"
head "https://github.com/bazelbuild/bazel.git"
bottle do
cellar :any_skip_relocation
sha256 "368326a55b8d01bf15ae9a8404c3e22c42d9a694d456282ce0add80dc1c539b2" => :el_capitan
sha256 "d9f1e8c2dd038cb25b7adc4c7333ca38a2499eb77b4286ac3bc40a90e75f5188" => :yosemite
end
depends_on :java => "1.8+"
depends_on :macos => :yosemite
def install
ENV["EMBED_LABEL"] = "#{version}-homebrew"
system "./compile.sh"
system "./output/bazel", "build", "scripts:bash_completion"
bin.install "output/bazel" => "bazel"
bash_completion.install "bazel-bin/scripts/bazel-complete.bash"
zsh_completion.install "scripts/zsh_completion/_bazel"
end
test do
touch testpath/"WORKSPACE"
(testpath/"ProjectRunner.java").write <<-EOS.undent
public class ProjectRunner {
public static void main(String args[]) {
System.out.println("Hi!");
}
}
EOS
(testpath/"BUILD").write <<-EOS.undent
java_binary(
name = "bazel-test",
srcs = glob(["*.java"]),
main_class = "ProjectRunner",
)
EOS
system "#{bin}/bazel", "build", "//:bazel-test"
system "bazel-bin/bazel-test"
end
end