Slide 1

Slide 1 text

STORES 株式会社 Gradle Build Scanを使ってビルドのことを知ろう 2023.04.26 @tomorrowkey

Slide 2

Slide 2 text

自己紹介

Slide 3

Slide 3 text

自己紹介 ● 山下智樹 / @tomorrowkey ● STORES株式会社 - STORES ブランドアプリ ● Android エンジニア (14年生) 3

Slide 4

Slide 4 text

背景

Slide 5

Slide 5 text

背景 - 春といえば、新卒入社、転職など、新しいチャレンジの季節 - 新しくチャレンジをする人も、受け入れる人も忙しい日々を送っているはず ↓ - リモートでトラブルシューティングすることが増えた!ってことはないです か? ↓ - Gradle Build Scanがそれを解決します 5

Slide 6

Slide 6 text

Build Scanってなに 6 https://docs.gradle.org/current/userguide/build_scans.html

Slide 7

Slide 7 text

Build Scanってなに 7

Slide 8

Slide 8 text

Build Scanの使い方 8 $ ./gradlew assembleDebug --scan ... BUILD SUCCESSFUL in 6m 47s 1463 actionable tasks: 1098 executed, 362 from cache, 3 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/xxxxxxxxxxxxx Configuration cache entry stored.

Slide 9

Slide 9 text

Build Scanでわかること

Slide 10

Slide 10 text

- https://scans.gradle.com/s/lg2q2hisns34u - https://scans.gradle.com/s/cjifpgmlh5ams 今日使うBuild Scanレポート 10

Slide 11

Slide 11 text

Console log 11

Slide 12

Slide 12 text

Timeline 12

Slide 13

Slide 13 text

Performance - Build 13

Slide 14

Slide 14 text

Performance - Task execution 14

Slide 15

Slide 15 text

Performance - Build cache 15

Slide 16

Slide 16 text

Performance - Network activity 16

Slide 17

Slide 17 text

Plugins 17

Slide 18

Slide 18 text

Custom values 18

Slide 19

Slide 19 text

Switches 19

Slide 20

Slide 20 text

Infrastructure 20

Slide 21

Slide 21 text

Build Scanを使ううえでの注意点

Slide 22

Slide 22 text

- Gradle.com の利用規約に同意のうえ使用しましょう。 - レポートは認証のないWebページに公開されます。 - 特にコンソールログに漏れてはいけない情報がないか確認のうえ利用しましょう。 - 安心して使いたいのであればDevelocity(Gradle Enterprise)を契約のうえ、専有の develocityインスタンスを使用しましょう。 Build Gradleを使ううえでの注意点 22

Slide 23

Slide 23 text

FAQ

Slide 24

Slide 24 text

A. Gradleの設定によって同意を宣言できます。 Q. 毎回利用規約の同意のプロンプトが表示されるの面倒 24 // settings.gradle.kts develocity { buildScan { termsOfUseUrl.set("https://gradle.com/help/legal-terms-of-use" ) termsOfUseAgree.set("yes") } }

Slide 25

Slide 25 text

A. プロファイルオプションを使えばレポートを取得できますが、Build Scanと比 較すると内容は貧弱なので代替できるものではありません。 Q. サーバにアップロードしないでレポート見れないの? 25

Slide 26

Slide 26 text

A. 一度もアクセスのないレポートは3ヶ月で削除されます。アクセスのあったレ ポートは無期限で閲覧できます。 > A Build Scan that has not been viewed within 3 months of being created will be removed. Once a Build Scan has been viewed, it will be available indefinitely. 無期限?ほんとうに? A. また、オーナーは削除できます。 Q. Build Scanのレポートはいつ削除されるの? 26

Slide 27

Slide 27 text

A. https://docs.gradle.com/enterprise/tutorials/extending-build-scans/ にテクニックが紹介されています Q. Build Scanの裏技教えて 27

Slide 28

Slide 28 text

- Build Scanを活かしてパフォーマンスチューニングやトラブルシューティング に取り組みましょう。 おわりに 28