homebrew-core/Formula/leakcanary-shark.rb

34 lines
1.1 KiB
Ruby

class LeakcanaryShark < Formula
desc "CLI Java memory leak explorer for LeakCanary"
homepage "https://square.github.io/leakcanary/shark/"
url "https://github.com/square/leakcanary/releases/download/v2.9.1/shark-cli-2.9.1.zip"
sha256 "19da1e43900d22a4ddea4b5362144778f952ea79e51c5983c2529da388d7adf9"
license "Apache-2.0"
bottle do
sha256 cellar: :any_skip_relocation, all: "082ec4b346edd7d873e92da70215c35fd1ece7f0ca16be77ce2f65183e3e3fe9"
end
depends_on "openjdk"
resource "sample_hprof" do
url "https://github.com/square/leakcanary/raw/v2.6/shark-android/src/test/resources/leak_asynctask_m.hprof"
sha256 "7575158108b701e0f7233bc208decc243e173c75357bf0be9231a1dcb5b212ab"
end
def install
# Remove Windows scripts
rm_f Dir["bin/*.bat"]
libexec.install Dir["*"]
(bin/"shark-cli").write_env_script libexec/"bin/shark-cli", Language::Java.overridable_java_home_env
end
test do
resource("sample_hprof").stage do
assert_match "1 APPLICATION LEAKS",
shell_output("#{bin}/shark-cli --hprof ./leak_asynctask_m.hprof analyze").strip
end
end
end