godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.05k stars 65 forks source link

Android export plugin hook for settings and plugins #9633

Open theromis opened 2 weeks ago

theromis commented 2 weeks ago

Describe the project you are working on

Working on android firebase analytics integration slightly modified this plugin https://github.com/theromis/FirebaseAnalyticsGodotAndroidPlugin

Describe the problem or limitation you are having in your project

it have pretty heavy gradle build modification script https://github.com/theromis/FirebaseAnalyticsGodotAndroidPlugin/blob/main/plugin/export_scripts_template/export_plugin.gd#L78-L96

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Unfortunately I can't find ability to add plugins or change settings using EditorExportPlugin hooks.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I think can be useful to have same as

    func _get_android_dependencies(platform: EditorExportPlatform, debug: bool) -> PackedStringArray:
        return PackedStringArray([
            'platform("com.google.firebase:firebase-bom:32.8.1")',
            "com.google.firebase:firebase-analytics",
            "com.google.android.gms:play-services-measurement-api:21.6.2"
        ])

add

    func _get_android_plugins(platform: EditorExportPlatform, debug: bool) -> PackedStringArray:
        return PackedStringArray([
            "id 'com.google.gms.google-services'"
        ])

    func _get_android_plugins_root(platform: EditorExportPlatform, debug: bool) -> PackedStringArray:
        return PackedStringArray([
            "id 'com.google.gms.google-services' version '4.3.14' apply false"
        ])

If this enhancement will not be used often, can it be worked around with a few lines of script?

Other option is just rewrite build scripts

Is there a reason why this should be core and not an add-on in the asset library?

it will be useful and flexible