There are a few android-related versions that we specify in build scripts and CI:
Android NDK version. Does not affect runtime requirements. Generally should be set to latest available version because newer versions have more bug-fixes and optimizations.
Android build-tools version and CMake version. Similarly, should be set to latest available version.
Android API levels:
minSdkVersion. Defines runtime requirement of the app. The app will support only systems with this version and later. Should be set to the lowest possible version.
targetSdkVersion. Affects runtime behavior of the app. Should be set to the latest API level on which the app was tested. Android runtime will take this into account and will avoid behavior that was introduced in later versions.
compileSdkVersion. Defines compile-time version of Android SDK. Generally should be set to latest available version.
Currently, minSdkVersion is defined in android/roc-android/build.gradle, and other versions are defined in .github/workflows/build.yml and passed to gradle via environment variables.
What we need to do:
in scripts/android_docker.sh:
rename API to SDK_LEVEL (corresponds to compileSdkVersion)
the rename should be also reflected in:
scripts/android/build_roc.sh
scripts/android/start_emulator.sh
README.md
in .github/workflows/build.yml:
in all jobs:
rename API to SDK_LEVEL
in android-linux and release jobs:
explicitly define BUILD_TOOLS_VERSION and CMAKE_VERSION vars (currently they're missing and we rely on defaults)
in android-linux, android-osx, and release jobs:
bump SDK_LEVEL (compileSdkVersion) to the latest available version
bump NDK_VERSION (Android NDK version) to the latest available version
bump BUILD_TOOLS_VERSION (Android build-tools version) to the latest available version
bump CMAKE_VERSION to the latest available version
in android-linux and android-osx jobs:
in addition to bumping versions as described above, keep one step with the currently used, older, versions of sdk, ndk, build-tools, and cmake; it will allow us to keep testing compatibility with older build environments
in android-linux we'll need to add a new step for older versions; in android-osx we'll need to use the existing last step for that
in android-linux job:
introduce new step that runs scripts/android_docker.sh build without exporting any environment variables (SDK_LEVEL, NDK_VERSION, etc); this step will allow us to keep testing that defaults defined in android_docker.sh are good and the script works when no configuration is provided
In android/roc-android/build.gradle:
rename API env var to SDK_LEVEL
rename apiLevel var to sdkLevel
set compileSdkVersion and targetSdkVersion to sdkLevel (obtained from SDK_LEVEL)
There are a few android-related versions that we specify in build scripts and CI:
Android NDK version
. Does not affect runtime requirements. Generally should be set to latest available version because newer versions have more bug-fixes and optimizations.Android build-tools version
andCMake version
. Similarly, should be set to latest available version.Android API levels:
minSdkVersion
. Defines runtime requirement of the app. The app will support only systems with this version and later. Should be set to the lowest possible version.targetSdkVersion
. Affects runtime behavior of the app. Should be set to the latest API level on which the app was tested. Android runtime will take this into account and will avoid behavior that was introduced in later versions.compileSdkVersion
. Defines compile-time version of Android SDK. Generally should be set to latest available version.More info: 1, 2.
Currently,
minSdkVersion
is defined inandroid/roc-android/build.gradle
, and other versions are defined in.github/workflows/build.yml
and passed to gradle via environment variables.What we need to do:
in
scripts/android_docker.sh
:API
toSDK_LEVEL
(corresponds tocompileSdkVersion
)the rename should be also reflected in:
scripts/android/build_roc.sh
scripts/android/start_emulator.sh
README.md
in
.github/workflows/build.yml
:in all jobs:
rename
API
toSDK_LEVEL
in
android-linux
andrelease
jobs:explicitly define
BUILD_TOOLS_VERSION
andCMAKE_VERSION
vars (currently they're missing and we rely on defaults)in
android-linux
,android-osx
, andrelease
jobs:bump
SDK_LEVEL
(compileSdkVersion) to the latest available versionbump
NDK_VERSION
(Android NDK version) to the latest available versionbump
BUILD_TOOLS_VERSION
(Android build-tools version) to the latest available versionbump
CMAKE_VERSION
to the latest available versionin
android-linux
andandroid-osx
jobs:in addition to bumping versions as described above, keep one step with the currently used, older, versions of sdk, ndk, build-tools, and cmake; it will allow us to keep testing compatibility with older build environments
in
android-linux
we'll need to add a new step for older versions; inandroid-osx
we'll need to use the existing last step for thatin
android-linux
job:introduce new step that runs
scripts/android_docker.sh build
without exporting any environment variables (SDK_LEVEL, NDK_VERSION, etc); this step will allow us to keep testing that defaults defined inandroid_docker.sh
are good and the script works when no configuration is providedIn
android/roc-android/build.gradle
:API
env var toSDK_LEVEL
apiLevel
var tosdkLevel
compileSdkVersion
andtargetSdkVersion
tosdkLevel
(obtained fromSDK_LEVEL
)