2015-11-11 09:10:32 +00:00
|
|
|
class Bazel < Formula
|
|
|
|
desc "Google's own build tool"
|
2016-11-04 10:57:24 +00:00
|
|
|
homepage "https://bazel.build/"
|
2017-02-01 21:13:08 +00:00
|
|
|
url "https://github.com/bazelbuild/bazel/releases/download/0.4.4/bazel-0.4.4-dist.zip"
|
|
|
|
sha256 "d52a21dda271ae645711ce99c70cf44c5d3a809138e656bbff00998827548ebb"
|
2016-09-26 23:11:18 +00:00
|
|
|
|
2015-11-16 22:15:57 +00:00
|
|
|
bottle do
|
2016-01-12 08:06:14 +00:00
|
|
|
cellar :any_skip_relocation
|
2017-02-02 01:17:09 +00:00
|
|
|
sha256 "4a2bb741eddd2540f1084b735cdf0d762e41c337622a46b3d0bdb7d6d3709c22" => :sierra
|
|
|
|
sha256 "02672b9dea0bd0ec21c6b6ce6fbee99891349536524324af09ba2ef515dd456f" => :el_capitan
|
|
|
|
sha256 "a9de0e30e9c023a2c6c62535b79f2967c26168b70f7b62d674307cd20289283b" => :yosemite
|
2015-11-16 22:15:57 +00:00
|
|
|
end
|
|
|
|
|
2016-09-24 15:45:48 +00:00
|
|
|
depends_on :java => "1.8+"
|
|
|
|
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"
|
2016-07-29 10:17:50 +00:00
|
|
|
# Force Bazel ./compile.sh to put its temporary files in the buildpath
|
|
|
|
ENV["BAZEL_WRKDIR"] = buildpath/"work"
|
2015-11-23 09:45:20 +00:00
|
|
|
|
2015-11-11 09:10:32 +00:00
|
|
|
system "./compile.sh"
|
2016-07-29 10:17:50 +00:00
|
|
|
system "./output/bazel", "--output_user_root", buildpath/"output_user_root",
|
|
|
|
"build", "scripts:bash_completion"
|
2015-11-11 09:10:32 +00:00
|
|
|
|
2016-07-29 10:17:50 +00:00
|
|
|
bin.install "scripts/packages/bazel.sh" => "bazel"
|
|
|
|
bin.install "output/bazel" => "bazel-real"
|
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
|
|
|
|
|
2016-07-29 10:17:50 +00:00
|
|
|
system bin/"bazel", "build", "//:bazel-test"
|
2015-11-11 09:10:32 +00:00
|
|
|
system "bazel-bin/bazel-test"
|
|
|
|
end
|
|
|
|
end
|