homebrew-core/Formula/gradle-profiler.rb

36 lines
1.4 KiB
Ruby

class GradleProfiler < Formula
desc "Profiling and benchmarking tool for Gradle builds"
homepage "https://github.com/gradle/gradle-profiler/"
url "https://search.maven.org/remotecontent?filepath=org/gradle/profiler/gradle-profiler/0.17.0/gradle-profiler-0.17.0.zip"
sha256 "c71812c0fc79e23d8c9eafc831ba2f016bb7744935912b0aac1a98972dc30abe"
license "Apache-2.0"
livecheck do
url "https://search.maven.org/remotecontent?filepath=org/gradle/profiler/gradle-profiler/maven-metadata.xml"
regex(%r{<version>\s*v?(\d+(?:\.\d+)+)\s*</version>}i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "81650ffff52e598133f4fbbd99a954c75a2bf15381df84a5293ba7f5bfe9ffb3"
end
# gradle currently does not support Java 17 (ARM)
# gradle@6 is still default gradle-version, but does not support Java 16
# Switch to `openjdk` once above situations are no longer true
depends_on "openjdk@11"
def install
rm_f Dir["bin/*.bat"]
libexec.install %w[bin lib]
env = Language::Java.overridable_java_home_env("11")
(bin/"gradle-profiler").write_env_script libexec/"bin/gradle-profiler", env
end
test do
(testpath/"settings.gradle").write ""
(testpath/"build.gradle").write 'println "Hello"'
output = shell_output("#{bin}/gradle-profiler --gradle-version 7.0 --profile chrome-trace")
assert_includes output, "* Results written to"
end
end