LoginSignup
1
0

More than 5 years have passed since last update.

fastlaneのビルドを数秒短縮できるかもしれないtips

Posted at

タイトルで全部説明出来そうだったので、思わせぶりなタイトルになってしまった。

対象

  • CarthageやCocoapodsを使っている
  • fastlaneでbadgeプラグインを使っている

上記に当てはまらない方は関係ないです。

不要なバッジ処理

アイコンにバージョンバッジを付けたい場合Fastfileで以下のように書くことが多いと思う。

add_badge(shield: "#{@version_number}-#{@commit_hash}-white")

が、このような書き方で実行すると、

\[13:50:07]: Start adding badges...
\[13:50:07]: '../App/Carthage/Module/Assets/Assets.xcassets/AppIcon.appiconset/Icon-App-iTunes.png'
\[13:50:08]: '../App/Carthage/ModuleB/Assets/Assets.xcassets/AppIcon.appiconset/Icon-App-iTunes.png'
...

のような感じで、CarthageやCococaPodsでCheckoutしたExampleプロジェクト内のアイコンにも処理が行われることがある。(これが十数秒かかったりする)
なので、

add_badge(shield: "#{@version_number}-#{@commit_hash}-white", glob: "/App/Core/Assets/Assets.xcassets/AppIcon.appiconset/*.{png,PNG}")

といった感じでglobでメインのアプリだけを指定してあげれば、この無駄な処理が省ける。
globは内部でcurrent_pathと連結されるので/から始める点に注意。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0