Skip to content

Update build.sh to allow upgrading sdk-manager version with $ANDROID_SDK_MANAGER_PARAMETERS variable

Allows to use a Gitlab CI/CD variable $ANDROID_SDK_MANAGER_PARAMETERS to execute the android sdk-manager before the build. The android-sdk is not executed if this variable doesn't exist, so this patch shouldn't modify behaviour of existing projects.

The update is based on the build.sh code from the game-ci github project: https://github.com/game-ci/unity-builder/blob/7afabe74da5227a9ecd537f5260b398258c3eb3b/dist/platforms/ubuntu/steps/build.sh#L65-L84

Example use-case:

The current version of the docker image for gitlab is unityci/editor:2022.3.12f1-android-2 If trying to make an Android build with TargetSDK 33, I get an error that Android SDK 33 is not installed.

With this MR you can create a Gitlab CI/CD variable named ANDROID_SDK_MANAGER_PARAMETERS with the value platforms;android-33, and the Android SDK will update accordingly and the Android build with TargetSDK 33 succeeds.

Merge request reports