やりたいこと
- preview版のSDKをJenkinsでビルドしたい
- 2017/11/21 現在最新のSDKのバージョンは26(Android 8.0)
- 使いたいSDKは27(Androi 8.1 preview)
通常のSDKの更新
SDKの定期的な更新とかは以下のリンクのような感じでやればとくに問題なく使えると思います。
JenkinsでAndroid SDKを更新する
しかし、preview版のSDKを使いたい場合この方法ではpreview版のSDKに更新することができず
You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 27].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
という感じでビルドに失敗してしまいます。
対処法
こういうときは自分のローカル ~/Library/Android/sdk/licenses/
以下のファイルをJenkinsの同じところにコピーして置き換えてあげる。
そうすることでJenkinsのほうでもビルドできるようになります。