Created
October 14, 2021 07:26
-
-
Save gamma/a7de9913608e4491a6f9c3acd6058ace to your computer and use it in GitHub Desktop.
gradle@6.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cat > /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gradle@6.rb | |
class GradleAT6 < 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.9.1-all.zip" | |
sha256 "b13f5d97f08000996bf12d9dd70af3f2c6b694c2c663ab1b545e9695562ad1ee" | |
license "Apache-2.0" | |
bottle do | |
sha256 cellar: :any_skip_relocation, x86_64_linux: "fd167292281521adf832093bbc0485f5a03e82c9962039f54f12e59d0d2dce1b" | |
sha256 cellar: :any_skip_relocation, all: "32c1d054414d080476d5486e45826643e65cc6e2aaa463f1bb806cf6de89ad5c" | |
end | |
keg_only :versioned_formula | |
# gradle@6 does not support Java 16 | |
depends_on "openjdk@11" | |
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("11") | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment