2015-11-11 09:10:32 +00:00
|
|
|
class Bazel < Formula
|
|
|
|
desc "Google's own build tool"
|
|
|
|
homepage "http://bazel.io/"
|
2016-05-17 11:04:16 +00:00
|
|
|
url "https://github.com/bazelbuild/bazel/archive/0.2.3.tar.gz"
|
|
|
|
sha256 "7e48bf3ef6da3afe619305708bfa09dde7f475ab8f1c3732faa0210a9b55c018"
|
2016-05-05 07:12:00 +00:00
|
|
|
head "https://github.com/bazelbuild/bazel.git"
|
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-05-17 15:17:59 +00:00
|
|
|
sha256 "368326a55b8d01bf15ae9a8404c3e22c42d9a694d456282ce0add80dc1c539b2" => :el_capitan
|
|
|
|
sha256 "d9f1e8c2dd038cb25b7adc4c7333ca38a2499eb77b4286ac3bc40a90e75f5188" => :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
|