-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Re-architect how Android plugins are packaged and handled at export time #78958
Re-architect how Android plugins are packaged and handled at export time #78958
Conversation
cc @naithar The same concept can be applied on iOS removing the need for the |
d4379fa
to
f90a1fa
Compare
…rmat See godotengine/godot#78958 for reference.
… 4.2 format See godotengine/godot#78958 for reference.
684898d
to
65590b9
Compare
Amazing work @m4gr3d, this indeed solves all the issues we were discussing in the XR meeting. For any logic we add to the core we can add the needed features and permissions to the loader for each platform (though I still hope that in that scenario we'll end up with standardised strings in due time), for any OpenXR extension we implement as a GDExtension we'll be able to handle those in that extension by adding an export plugin class to that as well. |
For the record, naithar hasn't been actively contributing to Godot lately. @bruvzg is the sole maintainer for iOS, he might be able to have a look at doing the matching changes for iOS, though any help from interested contributors would be welcome. We should aim to have both platforms refactored around the same time, to avoid a situation where 4.2 would release with a different structure for Android and iOS. |
0f76d25
to
1cf0f58
Compare
Ran into a bug with restoring the saved values of the editor export plugin options from the preset:
Given an export plugin can be added at any time, we may need to separate the platform options from the export plugins' options and store them in the preset regardless of whether the export plugin is available or not. |
1cf0f58
to
a9b81d0
Compare
f5e8002
to
1224551
Compare
1224551
to
d7f9622
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.
As mentioned before, I really like this new approach. Code wise it looks really good
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.
A couple of nitpicks, but also a couple of bigger notes worth addressing.
d7f9622
to
4bdb1a1
Compare
The previous packaging format for Godot Android plugins consisted of the plugin's `gdap` config file accompanied by binaries defined in the `gdap` file. This format is now deprecated (starting with Godot 4.2), and instead Godot Android plugins are now packaged as `EditorExportPlugin` plugins. The `EditorExportPlugin` class has been updated with the following methods to provide the necessary set of functionality: - `_supports_platform`: returns true if the plugin supports the given platform - `_get_android_dependencies`: retrieve the set of android dependencies (e.g: `org.godot.example:my-plugin:0.0.0`) provided by the plugin - `_get_android_dependencies_maven_repos`: retrieve the urls of the maven repos for the provided android dependencies - `_get_android_libraries`: retrieve the local paths of the android libraries (AAR files) provided by the plugin - `_get_android_manifest_activity_element_contents`: update the contents of the `<activity>` element in the generated Android manifest - `_get_android_manifest_application_element_contents`: update the contents of the `<application>` element in the generated Android manifest - `_get_android_manifest_element_contents`: update the contents of the `<manifest>` element in the generated Android manifest
Following on the previous commit, the XR features logic have now be moved to the Godot OpenXR loader plugin. See GodotVR/godot_openxr_vendors#38
4bdb1a1
to
b52e1be
Compare
Thanks! |
If I understand correctly, only the way Godot interacts with the plugins has changed. The way the plugin is written remains the same. Am I correct? I've checked the example repo, the package is placed inside the addons folder instead of plugins/android. Does this matter or location is irrelevant? |
The plugin logic (java code) remains the same, but the configuration for the plugin, including the folder layout, are changed to the new format which better aligns with other types of Godot plugins.
Yes the location matters. See the tutorial about making Godot plugins for reference. The documentation for the Android plugins will be updated to reflect all of these changes prior to Godot 4.2 being stable. The current version of the documentation is now obsolete. |
This is big change with respect to how plugins are handled. Can the documentation be updated earlier than beta release so that I can test it properly and if any issues than it can be fixed within 4.2 release |
It'll be done prior to the beta release, but there are a few more incoming changes / refactor so the documentation will be updated once those are landed and the full end to end plugin flow has been validated. I'll be posting examples as the refactor progress so you can use those as reference until the documentation is updated. |
@WNJH it's not possible to do so on purpose to prevent export plugins from interfering with each other. |
Similar to this #78782 (comment) build\src\debug\AndroidManifest.xml: My temporary solution is to make debug\AndroidManifest.xml read-only. |
@WNJH Only the |
@m4gr3d Thank you! I have one more small question." one-click deploy" Does it have to go directly to GodotApp? After I annotated "intent-filter", "one-click deploy" did not display the custom activity. But when I quit, and tap into the APP on my phone, the custom activity is displayed. |
@WNJH Yes it launches the |
Is there an early version of the updated documentation that I could read? Having a crash in gd_mono.cpp:431 and I believe it to be related to the GodotPlugins with a failed initialization (a blank project works fine). |
@duarteroso Early draft of the documentation update available in godotengine/godot-docs#7884 |
The previous packaging format for Godot Android plugins consisted of the plugin's
gdap
config file accompanied by binaries defined in thegdap
file.This format is now deprecated (starting with Godot 4.2), and instead Godot Android plugins are now packaged as
EditorExportPlugin
plugins.The
EditorExportPlugin
class has been updated with the following methods to provide the necessary set of functionality:_supports_platform
: returns true if the plugin supports the given platform_get_android_dependencies
: retrieve the set of android dependencies (e.g:org.godot.example:my-plugin:0.0.0
) provided by the plugin_get_android_dependencies_maven_repos
: retrieve the urls of the maven repos for the provided android dependencies_get_android_libraries
: retrieve the local paths of the android libraries (AAR files) provided by the plugin_get_android_manifest_activity_element_contents
: update the contents of the<activity>
element in the generated Android manifest_get_android_manifest_application_element_contents
: update the contents of the<application>
element in the generated Android manifest_get_android_manifest_element_contents
: update the contents of the<manifest>
element in the generated Android manifestThe last three methods allow the plugin to automatically provide changes to the app's manifest which are preserved when the editor is updated, resolving a long standing issue.
Fixes #76963
Fixes #78782
Examples: