Automatically pick the Android sdk path using environment variables

This commit is contained in:
Fredia Huya-Kouadio 2023-10-31 23:01:48 -07:00 committed by Relintai
parent 6b6536ffe8
commit 7000a13bda

View File

@ -32,6 +32,7 @@
#include "export.h"
#include "export_plugin.h"
#include "core/os/os.h"
#include "editor/editor_settings.h"
@ -42,7 +43,7 @@ void register_android_exporter() {
exe_ext = "*.exe";
}
EDITOR_DEF("export/android/android_sdk_path", "");
EDITOR_DEF("export/android/android_sdk_path", OS::get_singleton()->get_environment("ANDROID_SDK_ROOT"));
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/android/android_sdk_path", PROPERTY_HINT_GLOBAL_DIR));
EDITOR_DEF("export/android/debug_keystore", "");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/android/debug_keystore", PROPERTY_HINT_GLOBAL_FILE, "*.keystore,*.jks"));