-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Android: Allow using alternative Gradle build directory #88297
Android: Allow using alternative Gradle build directory #88297
Conversation
My current thinking on the approach:
It's similar to those fields, so we should include it under the
Let's update this setting to use those options instead. So the default behavior will still be the same, but if those options are overridden, then Using your example in #88291 for reference:
|
The |
bae8664
to
4c0e356
Compare
Thanks for the review and implementation/design notes!
Ok, changed in my latest push.
Sounds good. For now, I've left them visible because it makes testing easier. But I'll make them always hidden before taking this out of draft.
Since you can have multiple export presets with different settings, we'll need a way to pick which one you're installing the build templates for. I'm working on this now... |
4c0e356
to
f20b8d1
Compare
@m4gr3d In my latest push, I think I've addressed all your notes, including the changes to |
f20b8d1
to
dd6ef49
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.
The logic looks good. I'll perform a round of testing on the PR to see what the feature looks like.
bb5aa7f
to
f197a1c
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.
@dsnopek Looks pretty good from my testing!
Here are a few feedbacks I have:
- We should print an export warning (not error) when the value in the
.build_version
file differs fromgradle_build/android_source_template
. This way, it's still the responsibility of the user to delete and recreate the build dir, but we provide some hints to the fact it's needed. - For a custom
gradle_build/android_source_template
, we should use the zip file'smd5
to ensure we can detect when the file is modified. For example, a plugin may reuse the same location for its custom source template, but update the content for every release.
Maybe we should introduce an Just a thought, no need for this to be a blocker for this PR. |
f197a1c
to
12bb588
Compare
Thanks for the feedback! I've made the requested changes in my latest push :-)
I added a I don't know that it makes sense to hide the normal custom template options, since those are the first options on every export preset - I think non-advanced users are already used to skipping over them. :-) Overall, I think we've zero'd in on the approach and implementation here, so I'm going to take this out of draft now! |
This should be a setting at the export preset level (similar to But since it's not related to this PR, this can be tackled in another PR. For now though, I'd remove the
Existing users may be familiar with them, doesn't mean it's not confusing, especially to new users :) |
12bb588
to
6b79b5b
Compare
Ok! I've reverted the |
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!
6b79b5b
to
a37ad26
Compare
|
Thanks! |
…gradle android source template Follow-up to godotengine#88297 to address the following issues: - Ensure that the custom gradle android source template is valid. Show a warning if it's not - Don't show an error when the official export templates are not installed but a custom android source template is specified
Currently, when exporting to Android using Gradle (as opposed to using the normal APK template), the build template always comes from
res://android
However, this can make exporting difficult, if you have multiple Android export presets and you want to use a custom Godot build for one of them. You need to manually wipe out the
res://android/build
directory and extract theandroid_source.zip
of your custom Godot build, and then swap back and forth between that and the normal template, when changing which preset you're exporting.The specific use case I have in mind is if you're making a VR game for, say, Pico and Meta Quest, and want to use a custom Godot build for Meta Quest because you've patched it to fix some platform-specific issue.
Anyway, this PR allows you to configure the top-level directory for the Gradle build, so you could use
res://android
for Pico andres://quest
for the Meta Quest.It puts the export setting way down at the bottom in a new "Advanced" section, because I don't want to confuse people. However, we do put the fields for the normal APK kind of custom export templates up at the top, so maybe I'm being too paranoid, and this should just go under the "Use Gradle Build" option?(BTW, you specify the top-level directory like
res://android
rather thanres://android/build
because the.build_version
file is placed inres://android
and this makes sure you have a two level path that allows that.)It doesn't update the "Project" -> "Install Android Build Template..." feature at all, that will still always extract the template intores://android/build
. This may be fine, because this is an advanced feature? It also requires you to make the.build_version
file manually, although, I considered just making Godot not check that when customizing the Gradle build dir under the assumption that a developer doing something advanced should know what they are doing?It seems to work in my testing so far, but I'm not super confident in the implementation or design, so I'm going to start with this as a DRAFT for discussion.