From efc7c860dc0f189faec0f93e0056008b4fe66e94 Mon Sep 17 00:00:00 2001 From: Christoph Blecker Date: Mon, 1 Jul 2019 21:21:24 -0700 Subject: [PATCH] bazelisk 0.0.8 (new formula) Closes #41541. Signed-off-by: FX Coudert --- Formula/bazelisk.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Formula/bazelisk.rb diff --git a/Formula/bazelisk.rb b/Formula/bazelisk.rb new file mode 100644 index 0000000000..0e6ae0b284 --- /dev/null +++ b/Formula/bazelisk.rb @@ -0,0 +1,29 @@ +class Bazelisk < Formula + desc "User-friendly launcher for Bazel" + homepage "https://github.com/bazelbuild/bazelisk/" + url "https://github.com/bazelbuild/bazelisk.git", + :tag => "v0.0.8", + :revision => "a843c2abd36c7a6167ef1e41d5145a4f04cf6900" + head "https://github.com/bazelbuild/bazelisk.git" + + depends_on "bazel" => :build + + def install + system "bazel", "build", "--stamp", + "--workspace_status_command=#{buildpath}/stamp.sh", + "--platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64", + "//:bazelisk" + + bin.install "bazel-bin/darwin_amd64_stripped/bazelisk" => "bazelisk" + end + + test do + assert_match /v#{version}/, shell_output("#{bin}/bazelisk version") + + # This is an older than current version, so that we can test that bazelisk + # will target an explicit version we specify. This version shouldn't need to + # be bumped. + ENV["USE_BAZEL_VERSION"] = "0.26.0" + assert_match /Build label: 0.26.0/, shell_output("#{bin}/bazelisk version") + end +end