Browse Source

Automatically pick the Android sdk path using environment variables

Fredia Huya-Kouadio 1 year ago
parent
commit
1ce2b800b5
1 changed files with 3 additions and 1 deletions
  1. 3 1
      platform/android/export/export.cpp

+ 3 - 1
platform/android/export/export.cpp

@@ -32,9 +32,11 @@
 
 
 #include "export_plugin.h"
 #include "export_plugin.h"
 
 
+#include "core/os/os.h"
+
 void register_android_exporter() {
 void register_android_exporter() {
 #ifndef ANDROID_ENABLED
 #ifndef ANDROID_ENABLED
-	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));
 	EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/android/android_sdk_path", PROPERTY_HINT_GLOBAL_DIR));
 	EDITOR_DEF("export/android/debug_keystore", "");
 	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"));
 	EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/android/debug_keystore", PROPERTY_HINT_GLOBAL_FILE, "*.keystore,*.jks"));