You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
C#: Fix trying to build when there's no solution
This would cause errors that shouldn't happen unless there was something to build.
This commit is contained in:
@@ -381,6 +381,9 @@ bool GodotSharpBuilds::build_project_blocking(const String &p_config) {
|
||||
|
||||
bool GodotSharpBuilds::editor_build_callback() {
|
||||
|
||||
if (!FileAccess::exists(GodotSharpDirs::get_project_sln_path()))
|
||||
return true; // No solution to build
|
||||
|
||||
String scripts_metadata_path_editor = GodotSharpDirs::get_res_metadata_dir().plus_file("scripts_metadata.editor");
|
||||
String scripts_metadata_path_player = GodotSharpDirs::get_res_metadata_dir().plus_file("scripts_metadata.editor_player");
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ void GodotSharpExport::_export_begin(const Set<String> &p_features, bool p_debug
|
||||
ERR_FAIL_NULL(TOOLS_DOMAIN);
|
||||
ERR_FAIL_NULL(GDMono::get_singleton()->get_editor_tools_assembly());
|
||||
|
||||
if (FileAccess::exists(GodotSharpDirs::get_project_sln_path())) {
|
||||
String build_config = p_debug ? "Debug" : "Release";
|
||||
|
||||
String scripts_metadata_path = GodotSharpDirs::get_res_metadata_dir().plus_file("scripts_metadata." + String(p_debug ? "debug" : "release"));
|
||||
@@ -133,6 +134,7 @@ void GodotSharpExport::_export_begin(const Set<String> &p_features, bool p_debug
|
||||
String depend_dst_path = GodotSharpDirs::get_res_assemblies_dir().plus_file(depend_src_path.get_file());
|
||||
ERR_FAIL_COND(!_add_file(depend_src_path, depend_dst_path));
|
||||
}
|
||||
}
|
||||
|
||||
// Mono specific export template extras (data dir)
|
||||
|
||||
|
||||
@@ -150,6 +150,9 @@ void MonoBottomPanel::_errors_toggled(bool p_pressed) {
|
||||
|
||||
void MonoBottomPanel::_build_project_pressed() {
|
||||
|
||||
if (!FileAccess::exists(GodotSharpDirs::get_project_sln_path()))
|
||||
return; // No solution to build
|
||||
|
||||
String scripts_metadata_path = GodotSharpDirs::get_res_metadata_dir().plus_file("scripts_metadata.editor");
|
||||
Error metadata_err = CSharpProject::generate_scripts_metadata(GodotSharpDirs::get_project_csproj_path(), scripts_metadata_path);
|
||||
ERR_FAIL_COND(metadata_err != OK);
|
||||
|
||||
Reference in New Issue
Block a user