Skip to content

Declutter export_files in export_presets.cfg #12760

Open
@Cykyrios

Description

@Cykyrios

Describe the project you are working on

Not related to a specific project.

Describe the problem or limitation you are having in your project

When you filter exported resources in an export preset (export selected scenes, export selected resources, or export all except selected resources), the selected files are all listed in export_files=[...], however, this can result in a massive amount of files, causing a single line to reach into the tens of thousands of characters, which isn't exactly diff-friendly (I have a situation where this line is 35k+ characters, and the diff takes 5-10s because of the multiple export presets).

This can happen if you want to exclude some addons from the export, while keeping others (for instance, I don't want to export the unit test addon).

From a user experience point of view, there is also an issue with selecting folders to include/exclude, as any file added to that folder after creating/updating the preset will not be selected in that preset, which means you have to manually go over every preset to make sure they are still properly configured.

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

export_files should be able to handle globbing, and write export_files="res://some_folder/*" (or export_files="res://some_folder/"), instead of export_files="res://some_folder/a_file.gd", "res://some_folder/another_file.gd", [...], if the entire some_folder directory is selected.

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

The following is one of my export presets:

Image

I would expect its entry in export_presets.cfg to include the following:

export_filter="exclude"
export_files=PackedStringArray("res://addons/gdscript_xml_converter/", "res://addons/gdUnit4/", "res://addons/godot_insim/demo/", "res://addons/godot_insim/test/", "res://docs_generator/", "res://modules/")

This likely involves EditorExportPreset::get_files_to_export(), which is called in EditorExport::_save(), and currently returns the entire list of individual files:

if (save_files) {
	Vector<String> export_files = preset->get_files_to_export();
	config->set_value(section, "export_files", export_files);
}

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

It cannot be worked around at all, as export presets are, to my knowledge, mandatory for export, both from the editor and from the CLI.

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

This is about export presets and the generated export_presets.cfg file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions