Last active
January 13, 2022 07:41
-
-
Save tgvdinesh/2d80b26c70b473685e820f7329ee4ebb to your computer and use it in GitHub Desktop.
How to install specific Gradle Version?
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
# brew install --build-from-source ./gradle.rb | |
# All Gradle version - https://gist.github.com/l1x/d8ba66343fceb927d691 | |
# Install Gradle from local Formule - https://github.com/Homebrew/brew/issues/1468 | |
# Or you can download distribution from official site https://services.gradle.org/distributions/ | |
# When you run the above local Formule build and if the build fails with sha mismath, Replace sha256 below with the Actual sha256 returned by your run also don't forget to replace gradle version in url | |
# Below is sample Gradle class | |
class Gradle < Formula | |
desc "Build system based on the Groovy language" | |
homepage "https://www.gradle.org/" | |
url "https://services.gradle.org/distributions/gradle-2.13-all.zip" | |
sha256 "fb126ed684150f9dc39a811cbcf4daada4292fd387ed998c151ff2cf2536d94d" | |
bottle :unneeded | |
option "with-all", "Installs Javadoc, examples, and source in addition to the binaries" | |
depends_on :java => "1.7+" | |
def install | |
rm_f Dir["bin/*.bat"] | |
libexec.install %w[bin lib] | |
libexec.install %w[docs media samples src] if build.with? "all" | |
(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") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment