34 lines
1014 B
Ruby
34 lines
1014 B
Ruby
class Gradle < Formula
|
|
desc "Open-source build automation tool based on the Groovy and Kotlin DSL"
|
|
homepage "https://www.gradle.org/"
|
|
url "https://services.gradle.org/distributions/gradle-6.7.1-all.zip"
|
|
sha256 "22449f5231796abd892c98b2a07c9ceebe4688d192cd2d6763f8e3bf8acbedeb"
|
|
license "Apache-2.0"
|
|
|
|
livecheck do
|
|
url "https://services.gradle.org/distributions/"
|
|
regex(/href=.*?gradle[._-]v?(\d+(?:\.\d+)+)-all\.(?:[tz])/i)
|
|
end
|
|
|
|
bottle :unneeded
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
rm_f Dir["bin/*.bat"]
|
|
libexec.install %w[bin docs lib src]
|
|
(bin/"gradle").write_env_script libexec/"bin/gradle", Language::Java.overridable_java_home_env
|
|
end
|
|
|
|
test do
|
|
assert_match version.to_s, shell_output("#{bin}/gradle --version")
|
|
|
|
(testpath/"settings.gradle").write ""
|
|
(testpath/"build.gradle").write <<~EOS
|
|
println "gradle works!"
|
|
EOS
|
|
gradle_output = shell_output("#{bin}/gradle build --no-daemon")
|
|
assert_includes gradle_output, "gradle works!"
|
|
end
|
|
end
|