-
-
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
Specify the path to the Java SDK used for the Android gradle build #86383
Specify the path to the Java SDK used for the Android gradle build #86383
Conversation
9cd00a6
to
1412849
Compare
1412849
to
6825eaf
Compare
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.
Looks great!
Introduce an editor setting to allow users the ability to specify the path to the Java SDK used for the Android gradle build.
6825eaf
to
85e98ef
Compare
Thanks! |
I think there's still an issue here, because the values stored in the editor settings will continue to over-ride these JAVA_HOME and ANDROID_HOME environment values if they are not reset-to-default. This is only going to help people when they make a fresh install with no preset editor settings. The most user-friendly option might be to make these boxes read-only in the UI with a tooltip that says they've been defined by the environment variables. Attached is my nix-flake that I use to make godot with some edits to the source code that force-set all these values with the following substitutions: substituteInPlace platform/android/export/export_plugin.cpp \
--replace 'String sdk_path = EDITOR_GET("export/android/android_sdk_path")' 'String sdk_path = std::getenv("tunnelvr_ANDROID_SDK")'
substituteInPlace platform/android/export/export_plugin.cpp \
--replace 'EDITOR_GET("export/android/debug_keystore")' 'std::getenv("tunnelvr_DEBUG_KEY")'
substituteInPlace platform/android/export/export_plugin.cpp \
--replace 'EDITOR_GET("export/android/java_sdk_path")' 'std::getenv("tunnelvr_JAVA_SDK_PATH")'
substituteInPlace editor/editor_paths.cpp \
--replace 'return get_data_dir().path_join(export_templates_folder)' 'return std::getenv("tunnelvr_EXPORT_TEMPLATES")'
<snip>
wrapProgram $out/bin/godot4 \
--set ANDROID_HOME "${androidenv}/share/android-sdk"\
--set JAVA_HOME "${pkgs.jdk17}/lib/openjdk"\
--set tunnelvr_ANDROID_SDK "${androidenv}/share/android-sdk"\
--set tunnelvr_JAVA_SDK_PATH "${pkgs.jdk17}/lib/openjdk"\
--set tunnelvr_EXPORT_TEMPLATES "${export-templates}/templates" \
--set tunnelvr_DEBUG_KEY "${debugKey}" \
--set GODOT_BLENDER3_PATH "${pkgs.blender}/bin/" \
--set GRADLE_OPTS "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidenv}/share/android-sdk/build-tools/34.0.0/aapt2"
|
I'm not sure I understand the issue.. Those values are meant to override the env variables so that users with multiple Java and/or Android sdks can specify which one the Godot editor should use. Making them read only defeats that purpose. |
Cherry-picked for 4.2.2. |
Introduce an editor setting to allow users the ability to specify the path to the Java SDK used for the Android gradle build.
At build time, a gradle task validates the
java
version and prints out an error if it doesn't match the target version