37 lines
1.1 KiB
Ruby
37 lines
1.1 KiB
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-7.3.3-all.zip"
|
|
sha256 "c9490e938b221daf0094982288e4038deed954a3f12fb54cbf270ddf4e37d879"
|
|
license "Apache-2.0"
|
|
|
|
livecheck do
|
|
url "https://services.gradle.org/distributions/"
|
|
regex(/href=.*?gradle[._-]v?(\d+(?:\.\d+)+)-all\.(?:[tz])/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "09ae079017b02f06a30fa5b2a917f299353bcf437389144f1e7ce87d1c420b03"
|
|
end
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
rm_f Dir["bin/*.bat"]
|
|
libexec.install %w[bin docs lib src]
|
|
env = Language::Java.overridable_java_home_env
|
|
(bin/"gradle").write_env_script libexec/"bin/gradle", 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
|