2019-07-02 04:21:24 +00:00
|
|
|
class Bazelisk < Formula
|
|
|
|
desc "User-friendly launcher for Bazel"
|
|
|
|
homepage "https://github.com/bazelbuild/bazelisk/"
|
|
|
|
url "https://github.com/bazelbuild/bazelisk.git",
|
2019-12-21 02:45:03 +00:00
|
|
|
:tag => "v1.2.1",
|
|
|
|
:revision => "56a03d98104be7cfa57d4bbdc03b4c7cea29a6c9"
|
2019-07-02 04:21:24 +00:00
|
|
|
head "https://github.com/bazelbuild/bazelisk.git"
|
|
|
|
|
2019-07-18 20:00:07 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2019-12-21 06:26:20 +00:00
|
|
|
sha256 "cd510b727fea39be403be09808e2023ff7050c3c610cebe1fc1aacffe73c0f9a" => :catalina
|
|
|
|
sha256 "cd510b727fea39be403be09808e2023ff7050c3c610cebe1fc1aacffe73c0f9a" => :mojave
|
|
|
|
sha256 "cd510b727fea39be403be09808e2023ff7050c3c610cebe1fc1aacffe73c0f9a" => :high_sierra
|
2019-07-18 20:00:07 +00:00
|
|
|
end
|
|
|
|
|
2019-07-02 04:21:24 +00:00
|
|
|
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"
|
|
|
|
|
2019-10-30 01:40:52 +00:00
|
|
|
bin.install "bazel-bin/darwin_amd64_pure_stripped/bazelisk" => "bazelisk"
|
2019-07-02 04:21:24 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2019-11-26 16:05:31 +00:00
|
|
|
ENV["USE_BAZEL_VERSION"] = Formula["bazel"].version
|
2019-07-02 04:21:24 +00:00
|
|
|
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.
|
2019-10-30 01:40:52 +00:00
|
|
|
ENV["USE_BAZEL_VERSION"] = "0.28.0"
|
|
|
|
assert_match /Build label: 0.28.0/, shell_output("#{bin}/bazelisk version")
|
2019-07-02 04:21:24 +00:00
|
|
|
end
|
|
|
|
end
|