1
0
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:
Ignacio Etcheverry
2019-01-17 23:22:19 +01:00
parent 9c1768836f
commit 9cd24b4f6d
3 changed files with 42 additions and 34 deletions

View File

@@ -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");

View File

@@ -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)

View File

@@ -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);