2015-11-11 09:10:32 +00:00
|
|
|
class Bazel < Formula
|
|
|
|
desc "Google's own build tool"
|
|
|
|
homepage "http://bazel.io/"
|
2016-02-09 20:57:36 +00:00
|
|
|
url "https://github.com/bazelbuild/bazel/archive/0.1.5.tar.gz"
|
|
|
|
sha256 "f27d5c354a5ea77e33cd9792442bff7517b4c9a0ce2c06b07f6bd76afb4c64d8"
|
2015-11-11 09:10:32 +00:00
|
|
|
|
2015-11-16 22:15:57 +00:00
|
|
|
bottle do
|
2016-01-12 08:06:14 +00:00
|
|
|
cellar :any_skip_relocation
|
2016-02-10 14:03:17 +00:00
|
|
|
sha256 "2e850a43faf41b0b87387f4302d13d758235252a7e49c711fe47cb7b82c3141a" => :el_capitan
|
|
|
|
sha256 "7d7de14b9d1e1f7693b22cf043c2b822c23a869f75bc7dd29b29f86177330b63" => :yosemite
|
2015-11-16 22:15:57 +00:00
|
|
|
end
|
|
|
|
|
2015-11-11 09:10:32 +00:00
|
|
|
depends_on :java => "1.8+"
|
2016-01-23 11:54:08 +00:00
|
|
|
depends_on :macos => :yosemite
|
2015-11-11 09:10:32 +00:00
|
|
|
|
|
|
|
def install
|
2015-11-23 09:45:20 +00:00
|
|
|
ENV["EMBED_LABEL"] = "#{version}-homebrew"
|
|
|
|
|
2015-11-11 09:10:32 +00:00
|
|
|
system "./compile.sh"
|
2016-01-18 09:17:24 +00:00
|
|
|
system "./output/bazel", "build", "scripts:bash_completion"
|
2015-11-11 09:10:32 +00:00
|
|
|
|
|
|
|
bin.install "output/bazel" => "bazel"
|
2016-01-18 09:17:24 +00:00
|
|
|
bash_completion.install "bazel-bin/scripts/bazel-complete.bash"
|
|
|
|
zsh_completion.install "scripts/zsh_completion/_bazel"
|
2015-11-11 09:10:32 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2016-01-01 13:19:40 +00:00
|
|
|
touch testpath/"WORKSPACE"
|
2015-11-11 09:10:32 +00:00
|
|
|
|
|
|
|
(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
|