You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Update the filtering logic to properly handle directories with .gdignore files.
This commit is contained in:
@@ -507,6 +507,11 @@ void EditorExportPlatform::_edit_files_with_filter(DirAccess *da, const Vector<S
|
|||||||
if (dir.begins_with(".")) {
|
if (dir.begins_with(".")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (EditorFileSystem::_should_skip_directory(cur_dir + dir)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
da->change_dir(dir);
|
da->change_dir(dir);
|
||||||
_edit_files_with_filter(da, p_filters, r_list, exclude);
|
_edit_files_with_filter(da, p_filters, r_list, exclude);
|
||||||
da->change_dir("..");
|
da->change_dir("..");
|
||||||
|
|||||||
@@ -669,10 +669,7 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FileAccess::exists(cd.plus_file(f).plus_file("project.godot"))) { // skip if another project inside this
|
if (_should_skip_directory(cd.plus_file(f))) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (FileAccess::exists(cd.plus_file(f).plus_file(".gdignore"))) { // skip if another project inside this
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -874,10 +871,7 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const
|
|||||||
|
|
||||||
int idx = p_dir->find_dir_index(f);
|
int idx = p_dir->find_dir_index(f);
|
||||||
if (idx == -1) {
|
if (idx == -1) {
|
||||||
if (FileAccess::exists(cd.plus_file(f).plus_file("project.godot"))) { // skip if another project inside this
|
if (_should_skip_directory(cd.plus_file(f))) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (FileAccess::exists(cd.plus_file(f).plus_file(".gdignore"))) { // skip if another project inside this
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1979,6 +1973,20 @@ Error EditorFileSystem::_resource_import(const String &p_path) {
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EditorFileSystem::_should_skip_directory(const String &p_path) {
|
||||||
|
if (FileAccess::exists(p_path.plus_file("project.godot"))) {
|
||||||
|
// skip if another project inside this
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FileAccess::exists(p_path.plus_file(".gdignore"))) {
|
||||||
|
// skip if a `.gdignore` file is inside this
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool EditorFileSystem::is_group_file(const String &p_path) const {
|
bool EditorFileSystem::is_group_file(const String &p_path) const {
|
||||||
return group_file_cache.has(p_path);
|
return group_file_cache.has(p_path);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,6 +262,8 @@ public:
|
|||||||
bool is_group_file(const String &p_path) const;
|
bool is_group_file(const String &p_path) const;
|
||||||
void move_group_file(const String &p_path, const String &p_new_path);
|
void move_group_file(const String &p_path, const String &p_new_path);
|
||||||
|
|
||||||
|
static bool _should_skip_directory(const String &p_path);
|
||||||
|
|
||||||
EditorFileSystem();
|
EditorFileSystem();
|
||||||
~EditorFileSystem();
|
~EditorFileSystem();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2414,6 +2414,9 @@ public:
|
|||||||
print_verbose("- custom build enabled: " + bool_to_string(use_custom_build));
|
print_verbose("- custom build enabled: " + bool_to_string(use_custom_build));
|
||||||
print_verbose("- apk expansion enabled: " + bool_to_string(apk_expansion));
|
print_verbose("- apk expansion enabled: " + bool_to_string(apk_expansion));
|
||||||
print_verbose("- enabled abis: " + String(",").join(enabled_abis));
|
print_verbose("- enabled abis: " + String(",").join(enabled_abis));
|
||||||
|
print_verbose("- export filter: " + itos(p_preset->get_export_filter()));
|
||||||
|
print_verbose("- include filter: " + p_preset->get_include_filter());
|
||||||
|
print_verbose("- exclude filter: " + p_preset->get_exclude_filter());
|
||||||
|
|
||||||
Ref<Image> splash_image;
|
Ref<Image> splash_image;
|
||||||
Ref<Image> splash_bg_color_image;
|
Ref<Image> splash_bg_color_image;
|
||||||
|
|||||||
Reference in New Issue
Block a user