-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically pick the Android SDK path using environment variables #84285
Automatically pick the Android SDK path using environment variables #84285
Conversation
@akien-mga @YuriSizov It's not a bug so I'm putting in for 4.3, but it's small enough it could be included for 4.2. Up to you to decide! |
platform/android/export/export.cpp
Outdated
void register_android_exporter_types() { | ||
GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformAndroid); | ||
} | ||
|
||
void register_android_exporter() { | ||
#ifndef ANDROID_ENABLED | ||
EDITOR_DEF("export/android/android_sdk_path", ""); | ||
EDITOR_DEF("export/android/android_sdk_path", getenv("ANDROID_SDK_ROOT")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDITOR_DEF("export/android/android_sdk_path", getenv("ANDROID_SDK_ROOT")); | |
EDITOR_DEF("export/android/android_sdk_path", OS::get_singleton()->get_environment("ANDROID_SDK_ROOT")); |
Also, won't be useful on macOS (without #81266), since editor can't access shell environment (not a big deal, but should be mentioned if it's documented to auto pick it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested on a mac laptop and it seems to work as expected and picked up the env variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should work only when running the editor from terminal but not when running as a bundled app.
93a9516
to
f86e611
Compare
Thanks! |
This has proved useful for the automation of the setup under NixOS (see attachment). If we also had environment variable settings for debug_keystore, export_templates_folder and blender3_path then I could make Godot work at startup (ie connect to all the right directories) without having to patch the source code. flake.zip](https://github.com/godotengine/godot/files/13319882/flake.zip) |
@goatchurchprime Sounds like a good idea! Can you create a proposal for it. |
3.x version