Gradleのscanオプションについて

仕事ではgradleを使ったJavaアプリケーションの開発をしている。

その割には gradle についてちゃんと勉強したことがなかったので、Gradle公式のユーザガイド Building Kotlin Applications Sample を読んでいた。

この中で scan オプションが紹介されていた。

 % ./gradlew build --scan

BUILD SUCCESSFUL in 8s
8 actionable tasks: 3 executed, 5 up-to-date

Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service.
Do you accept these terms? [yes, no] yes

Gradle Terms of Service accepted.

Publishing build scan...
https://gradle.com/s/wrk56****

途中で Do you accept these terms と聞かれるので同意すると、scanの結果がgradleのwebサーバへアップロードされる。

最後に表示されたURL https://gradle.com/s/wrk56**** を開くと、メールアドレス認証があり、それを通過すると、アップロードしたscan結果を綺麗なレイアウトで見るとこができた。

f:id:nshmuras:20210418123339p:plain

Enterprise版にすればもっと便利な機能もあるらしい。 f:id:nshmuras:20210418124432p:plain

セキュリティ的な懸念は少しあるけどビルド速度の改善には使えるかもしれない。

調べてみると2017年あたりにはあった機能なのね。