homebrew-core/Formula/bundletool.rb

34 lines
1 KiB
Ruby
Raw Normal View History

2018-09-29 14:35:49 +00:00
class Bundletool < Formula
desc "Command-line tool to manipulate Android App Bundles"
homepage "https://github.com/google/bundletool"
url "https://github.com/google/bundletool/releases/download/0.12.0/bundletool-all-0.12.0.jar"
sha256 "c143ef768dc7cd3c6ab30dca2edca71f0abad53feaf1feceed74f43043c4c8d1"
2018-09-29 14:35:49 +00:00
bottle :unneeded
depends_on :java => "1.8+"
resource "bundle" do
url "https://gist.githubusercontent.com/raw/ca85ede7ac072a44f48c658be55ff0d3/sample.aab"
sha256 "aac71ad62e1f20dd19b80eba5da5cb5e589df40922f288fb6a4b37a62eba27ef"
end
def install
libexec.install "bundletool-all-#{version}.jar"
bin.write_jar_script libexec/"bundletool-all-#{version}.jar", "bundletool"
end
test do
resource("bundle").stage do
expected = <<~EOS
App Bundle information
------------
2019-01-28 12:30:57 +00:00
Feature modules:
Feature module: base
2018-09-29 14:35:49 +00:00
File: dex/classes.dex
EOS
assert_equal expected, shell_output("#{bin}/bundletool validate --bundle sample.aab")
end
end
end