homebrew-core/Formula/bazel.rb
2016-02-23 15:32:29 +01:00

49 lines
1.3 KiB
Ruby

class Bazel < Formula
desc "Google's own build tool"
homepage "http://bazel.io/"
url "https://github.com/bazelbuild/bazel/archive/0.2.0.tar.gz"
sha256 "3685ce039e44224260a7ed5b80dd951155998a6e128b2bebe984ea1d85a674b3"
bottle do
cellar :any_skip_relocation
sha256 "c9390c4e57fa55597c674d184470577b1a3e1af6cdd7a4bb894500242a44574e" => :el_capitan
sha256 "458e4baa2e9a1a99903292bbdcf8d0bd855905d44b3f5cd0b3d96f2c3661928a" => :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