Re-architecture of the Godot Android plugin.

This commit is contained in:
fhuya 2019-10-18 12:59:04 -04:00
parent ea2e976cdd
commit c3660bb4dc
30 changed files with 2082 additions and 1077 deletions

View file

@ -560,13 +560,6 @@ Error ExportTemplateManager::install_android_template() {
// Make res://android dir (if it does not exist).
da->make_dir("android");
{
// Add an empty .gdignore file to avoid scan.
FileAccessRef f = FileAccess::open("res://android/.gdignore", FileAccess::WRITE);
ERR_FAIL_COND_V(!f, ERR_CANT_CREATE);
f->store_line("");
f->close();
}
{
// Add version, to ensure building won't work if template and Godot version don't match.
FileAccessRef f = FileAccess::open("res://android/.build_version", FileAccess::WRITE);
@ -575,9 +568,20 @@ Error ExportTemplateManager::install_android_template() {
f->close();
}
Error err = da->make_dir_recursive("android/build");
// Create the android plugins directory.
Error err = da->make_dir_recursive("android/plugins");
ERR_FAIL_COND_V(err != OK, err);
err = da->make_dir_recursive("android/build");
ERR_FAIL_COND_V(err != OK, err);
{
// Add an empty .gdignore file to avoid scan.
FileAccessRef f = FileAccess::open("res://android/build/.gdignore", FileAccess::WRITE);
ERR_FAIL_COND_V(!f, ERR_CANT_CREATE);
f->store_line("");
f->close();
}
// Uncompress source template.
const String &templates_path = EditorSettings::get_singleton()->get_templates_dir().plus_file(VERSION_FULL_CONFIG);