-
-
Notifications
You must be signed in to change notification settings - Fork 4
Add Meta Prebuilt APK Install Tool #18
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
base: main
Are you sure you want to change the base?
Add Meta Prebuilt APK Install Tool #18
Conversation
8198f06
to
fc442f0
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.
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.json
s
build.gradle
Outdated
if (godotDir == "") { | ||
throw new GradleException("godot_dir property is required") | ||
} |
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.
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
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.
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"; |
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 Godot version should be included in the filename, so that we match the editor version with the template version. So, something like:
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
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've updated the godot-cpp
version and applied this change!
1dc17a9
to
cf444dd
Compare
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.
cf444dd
to
104e440
Compare
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:generatePrebuiltApks
now serves as a standalone task, it won't be run when building the plugin.generatePrebuiltApks
it needs to be pointed to a godot directory with-Pgodot_dir=path/to/godot
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.GODOT_META_TOOLKIT_VERSION
define in a new fileversion.h
.