firebelley/godot-export

Add command-line option to install android template

Opened this issue · 4 comments

Currently Godot has no command-line option for installing the Android Build Template other than launching the editor and manually triggering the project menu item; however there have been numerous pull requests (e.g. godotengine/godot#50264, godotengine/godot#63389, and godotengine/godot#63408) to add the option.

The current documented workaround is to manually extract android_source.zip (embedded in the export_templates.tpz) into the projects /android/build folder - this is the only thing the "Install Android Build Template..." menu item actually performs.

Eventually when one of these pull requests goes in (I believe now scheduled for 4.1) the godot-export action will need a command-line option to trigger the installation; however it's possible to implement it now using the same workaround of manually extracting the android sources.

Hello! Thanks for opening this issue. If I understand correctly, it should be possible to do the workaround as a step in your GitHub workflow before running this action. Is that correct?

I plan on testing the workaround (downloading the same tpz file, then extracting the android_source.zip, then extracting it to the projects android/build folder) as an experiment this evening.

I'm working on GodotVR/godot-xr-template#13 which is adding CI building to the standard VR template project - so that everyone starting from the template gets CI building in their pipeline.

It's not quite as simple as extracting the android_source.zip. There are a few other activities performed by godot, including:

  • adding an android/build/.gdignore file to avoid scanning
  • adding an android/.build_version containing the version of godot used to extract the source

The first file isn't overly important, but may prevent bundling unnecessary files in the installer.
The second file is used to verify the template and godot versions match. If it's not there then the build fails.

Hi @Malcolmnixon, do you have a working prototype for the automation of the export template installation ?
I'm working on the ARCore extension and just lost half a day because I just forgot to update the template that is in the project's android folder...

I have a script that automates all the process in Godot's repository but nothing to update my demo project yet...

But currently you have to:

  • build the godot android template
  • copy them into the \AppData\Roaming\Godot\export_templates\4.2.stable or similar
  • delete the content of your projects' android folder
  • re-open Godot with your project
  • install the android export template