GradleをMacへインストールする

Gradleが気になるので、実行できる状態を準備する。 ゆくゆくはGradleのタスクを実行するだけで、IDEコンパイル可能なプロジェクトを準備するところまで実現したい。

MacへSDKMAN!をインストールする

Groovy環境マネージャーのGVM(Groovy enVironment Manager)がSDKMAN!へ進化した様子。

SDKMAN!を参考にcurlを叩く。

$ curl -s "https://get.sdkman.io" | bash

※SDK!とAAで表示


                                                                 Now attempting installation...


Looking for a previous installation of SDKMAN...
Looking for unzip...
Looking for zip...
Looking for curl...
Looking for sed...
Installing SDKMAN scripts...
Create distribution directories...
Getting available candidates...
Prime the config file...
Download script archive...
######################################################################## 100.0%
Extract script archive...
Install scripts...
Set version to 5.5.13+272 ...
Attempt update of interactive bash profile...
Added sdkman init snippet to /Users/ユーザ名/.bashrc
Attempt update of zsh profile...
Updated existing /Users/ユーザ名/.zshrc



All done!


Please open a new terminal, or run the following in the existing one:

    source "/Users/ユーザ名/.sdkman/bin/sdkman-init.sh"

Then issue the following command:

    sdk help

Enjoy!!!
$ source "/Users/ユーザ名/.sdkman/bin/sdkman-init.sh"
$ sdk version

SDKMAN 5.5.13+272

SDKMAN!を使用してMacへGradleをインストールする

GradleのInstallationを参考に、sdkコマンドを実行する。

$ java -version
java version "1.8.0_73"

Java、古いね。

$ sdk install gradle 4.3.1

Downloading: gradle 4.3.1

In progress...

######################################################################## 100.0%

Installing: gradle 4.3.1
Done installing!


Setting gradle 4.3.1 as default.
$ gradle -v

------------------------------------------------------------
Gradle 4.3.1
------------------------------------------------------------

Build time:   2017-11-08 08:59:45 UTC
Revision:     e4f4804807ef7c2829da51877861ff06e07e006d

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_73 (Oracle Corporation 25.73-b02)
OS:           Mac OS X 10.11.6 x86_64

If your existing Gradle-based build uses the Gradle Wrapper, you can easily upgrade by running the wrapper task, specifying the desired Gradle version:

既存のGradleベースのビルドでGradle Wrapperを使用している場合は、目的のGradleバージョンを指定してラッパータスクを実行して簡単にアップグレードできます。

使用していないのでスキップする。