Skip to content

Conversation

devloglogan
Copy link
Collaborator

This PR builds on top of the work in #15

For ease of review I've kept commits separate, including a commit that runs .clang-format on all of the c++ files. Some of the updates / additions to Fredia's work:

  • Updated the export process to check the new vendor plugin project settings.
  • generatePrebuiltApks now serves as a standalone task, it won't be run when building the plugin.
    • To run generatePrebuiltApks it needs to be pointed to a godot directory with -Pgodot_dir=path/to/godot
    • This will create a meta-export-template.zip file in the project root, with the idea that we'll host them here in releases of the Godot Meta Toolkit.
    • I've removed the godot submodule since it's now longer needed.
  • Added an editor tool that downloads/installs the export the prebuilt apks.
    • Download url is created form a new base url editor setting (default pointing towards this github repo) and I've added a GODOT_META_TOOLKIT_VERSION define in a new file version.h.

@devloglogan devloglogan force-pushed the apk-export-support branch 4 times, most recently from 8198f06 to fc442f0 Compare June 30, 2025 21:08
Copy link
Collaborator

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This looks great :-)

I've only got a couple notes/questions on the code

Otherwise, the only other important thing to note here is that this will only work with Godot 4.5 (because we need EditorExportPlugin::_update_android_prebuilt_manifest()) and so merging this will make the plugin 4.5+

We'll want to consider when we want to do this, or if we want to make two builds (one that's 4.3+ and another that's 4.5+), or maybe two major versions?

If we go with two builds, we could come up with a way to have a single codebase, where we wrap the new code with #if GODOT_VERSION_PATCH >= 5, which will check if the provided extension_api.json is for Godot 4.5 or later. Then we just need CI to make two builds with two different extension_api.jsons

build.gradle Outdated
Comment on lines 259 to 261
if (godotDir == "") {
throw new GradleException("godot_dir property is required")
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably check that the directory exists as well. And since this needs to be done in a bunch of places, it probably makes sense to move this check into a function

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added checking that it exists / is a directory, and extracted it out to a verifyGodotDir() function.

return;
}

String download_url = (String)editor_settings->get_setting("xr/meta_toolkit/base_download_url") + GODOT_META_TOOLKIT_VERSION + "/meta-export-template.zip";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Godot version should be included in the filename, so that we match the editor version with the template version. So, something like:

Suggested change
String download_url = (String)editor_settings->get_setting("xr/meta_toolkit/base_download_url") + GODOT_META_TOOLKIT_VERSION + "/meta-export-template.zip";
const GDExtensionGodotVersion2 &godot_version = godot::internal::godot_version;
String filename = vformat("meta-export-template-v%d.%d.%d-%s", godot_version.major, godot_version.minor, godot_version.patch, godot_version.status);
String download_url = (String)editor_settings->get_setting("xr/meta_toolkit/base_download_url") + GODOT_META_TOOLKIT_VERSION + "/" + filename;

We may need to update godot-cpp to get GDExtensionGodotVersion2 which has the .status field

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the godot-cpp version and applied this change!

@devloglogan devloglogan force-pushed the apk-export-support branch 2 times, most recently from 1dc17a9 to cf444dd Compare July 1, 2025 18:33
@devloglogan devloglogan added the enhancement New feature or request label Jul 3, 2025
@dsnopek dsnopek added this to the 2.0.0 milestone Jul 11, 2025
m4gr3d and others added 4 commits July 28, 2025 15:31
The previous logic only uses `ANDROID_ENABLED` to gate the Platform SDK logic, which causes it to be active when the addon is loaded in the Android / XR editor.
The updated logic adds an editor specific build for the Android / XR editor which disables the Platform SDK logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants