Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id("com.android.application")
}

val minSdkApi = (System.getenv("ANDROID_MIN_SDK") ?: "24").toInt()
val compileSdkApi = (System.getenv("ANDROID_COMPILE_SDK")
?: System.getenv("ANDROID_MAX_API")
?: "36").toInt()
Expand All @@ -17,7 +18,7 @@ android {

defaultConfig {
applicationId = "com.example.devbox"
minSdk = 21
minSdk = minSdkApi
targetSdk = targetSdkApi
versionCode = 1
versionName = "1.0"
Expand Down
1 change: 1 addition & 0 deletions examples/android/devbox.d/android/android.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"ANDROID_BUILD_TOOLS_VERSION": "36.1.0",
"ANDROID_CMDLINE_TOOLS_VERSION": "19.0",
"ANDROID_MIN_SDK": 24,
"ANDROID_COMPILE_SDK": 36,
"ANDROID_TARGET_SDK": 36,
"ANDROID_SYSTEM_IMAGE_TAG": "google_apis",
Expand Down
3 changes: 2 additions & 1 deletion examples/react-native/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ buildscript {
def compileSdkEnv = System.getenv("ANDROID_COMPILE_SDK") ?: System.getenv("ANDROID_MAX_API") ?: "35"
def targetSdkEnv = System.getenv("ANDROID_TARGET_SDK") ?: System.getenv("ANDROID_MAX_API") ?: "35"
buildToolsVersion = System.getenv("ANDROID_BUILD_TOOLS_VERSION") ?: "35.0.0"
minSdkVersion = 24
def minSdkEnv = System.getenv("ANDROID_MIN_SDK") ?: "24"
minSdkVersion = minSdkEnv.toInteger()
compileSdkVersion = compileSdkEnv.toInteger()
targetSdkVersion = targetSdkEnv.toInteger()
def ndkVersionEnv = System.getenv("ANDROID_NDK_VERSION")
Expand Down
1 change: 1 addition & 0 deletions examples/react-native/devbox.d/android/android.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"ANDROID_BUILD_TOOLS_VERSION": "35.0.0",
"ANDROID_CMDLINE_TOOLS_VERSION": "19.0",
"ANDROID_MIN_SDK": 24,
"ANDROID_COMPILE_SDK": 35,
"ANDROID_TARGET_SDK": 35,
"ANDROID_SYSTEM_IMAGE_TAG": "google_apis",
Expand Down
1 change: 1 addition & 0 deletions plugins/android/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"ANDROID_SCRIPTS_DIR": "{{ .Virtenv }}/scripts",
"ANDROID_RUNTIME_DIR": "{{ .Virtenv }}",
"ANDROID_LOCAL_SDK": "0",
"ANDROID_MIN_SDK": "24",
"ANDROID_COMPILE_SDK": "36",
"ANDROID_TARGET_SDK": "36",
"ANDROID_DEFAULT_DEVICE": "max",
Expand Down
1 change: 1 addition & 0 deletions plugins/android/virtenv/scripts/init/init-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ VIRTENV_DEVICES_LOCK="${VIRTENV_DIR}/devices.lock"

CONFIG_KEYS=(
"ANDROID_LOCAL_SDK"
"ANDROID_MIN_SDK"
"ANDROID_COMPILE_SDK"
"ANDROID_TARGET_SDK"
"ANDROID_DEFAULT_DEVICE"
Expand Down
1 change: 1 addition & 0 deletions plugins/android/virtenv/scripts/platform/drift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
readonly ANDROID_CONFIG_VARS=(
"ANDROID_BUILD_TOOLS_VERSION"
"ANDROID_CMDLINE_TOOLS_VERSION"
"ANDROID_MIN_SDK"
"ANDROID_COMPILE_SDK"
"ANDROID_TARGET_SDK"
"ANDROID_SYSTEM_IMAGE_TAG"
Expand Down
4 changes: 4 additions & 0 deletions plugins/android/virtenv/scripts/user/devices.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ android_generate_android_lock() {
jq -n \
--arg build_tools "${ANDROID_BUILD_TOOLS_VERSION:-36.1.0}" \
--arg cmdline_tools "${ANDROID_CMDLINE_TOOLS_VERSION:-19.0}" \
--arg min_sdk "${ANDROID_MIN_SDK:-24}" \
--arg compile_sdk "${ANDROID_COMPILE_SDK:-36}" \
--arg target_sdk "${ANDROID_TARGET_SDK:-36}" \
--arg system_image_tag "${ANDROID_SYSTEM_IMAGE_TAG:-google_apis}" \
Expand All @@ -275,6 +276,7 @@ android_generate_android_lock() {
'{
ANDROID_BUILD_TOOLS_VERSION: $build_tools,
ANDROID_CMDLINE_TOOLS_VERSION: $cmdline_tools,
ANDROID_MIN_SDK: ($min_sdk | tonumber),
ANDROID_COMPILE_SDK: ($compile_sdk | tonumber),
ANDROID_TARGET_SDK: ($target_sdk | tonumber),
ANDROID_SYSTEM_IMAGE_TAG: $system_image_tag,
Expand All @@ -288,6 +290,7 @@ android_generate_android_lock() {
jq -n \
--arg build_tools "${ANDROID_BUILD_TOOLS_VERSION:-36.1.0}" \
--arg cmdline_tools "${ANDROID_CMDLINE_TOOLS_VERSION:-19.0}" \
--arg min_sdk "${ANDROID_MIN_SDK:-24}" \
--arg compile_sdk "${ANDROID_COMPILE_SDK:-36}" \
--arg target_sdk "${ANDROID_TARGET_SDK:-36}" \
--arg system_image_tag "${ANDROID_SYSTEM_IMAGE_TAG:-google_apis}" \
Expand All @@ -299,6 +302,7 @@ android_generate_android_lock() {
'{
ANDROID_BUILD_TOOLS_VERSION: $build_tools,
ANDROID_CMDLINE_TOOLS_VERSION: $cmdline_tools,
ANDROID_MIN_SDK: ($min_sdk | tonumber),
ANDROID_COMPILE_SDK: ($compile_sdk | tonumber),
ANDROID_TARGET_SDK: ($target_sdk | tonumber),
ANDROID_SYSTEM_IMAGE_TAG: $system_image_tag,
Expand Down
Loading