diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-02-08 22:49:24 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-02-08 22:49:27 +0100 |
commit | 5f8c30fbcaad9f45c32aa58f4f995c88e917ac96 (patch) | |
tree | 193fe3009c1ecb50c9c481a346bf5bff68f0e396 /modules | |
parent | e190589f3debad7bb20f62288d13f99378a0dbe2 (diff) |
Mono: Create player script metadata when building manually
Previously this was only done when building the script for running the game. This was a problem because the user could want to build the project manually with the "Build project" button, to then run the game from the command line or similar.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mono/editor/GodotSharpTools/GodotSharpTools.csproj | 1 | ||||
-rw-r--r-- | modules/mono/editor/mono_bottom_panel.cpp | 14 |
2 files changed, 13 insertions, 2 deletions
diff --git a/modules/mono/editor/GodotSharpTools/GodotSharpTools.csproj b/modules/mono/editor/GodotSharpTools/GodotSharpTools.csproj index f9e9f41977..9a5dd24bb1 100644 --- a/modules/mono/editor/GodotSharpTools/GodotSharpTools.csproj +++ b/modules/mono/editor/GodotSharpTools/GodotSharpTools.csproj @@ -8,6 +8,7 @@ <RootNamespace>GodotSharpTools</RootNamespace> <AssemblyName>GodotSharpTools</AssemblyName> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <BaseIntermediateOutputPath>obj</BaseIntermediateOutputPath> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> diff --git a/modules/mono/editor/mono_bottom_panel.cpp b/modules/mono/editor/mono_bottom_panel.cpp index d3efa288e9..cc9822e319 100644 --- a/modules/mono/editor/mono_bottom_panel.cpp +++ b/modules/mono/editor/mono_bottom_panel.cpp @@ -156,10 +156,20 @@ 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); + 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"); + + Error metadata_err = CSharpProject::generate_scripts_metadata(GodotSharpDirs::get_project_csproj_path(), scripts_metadata_path_editor); ERR_FAIL_COND(metadata_err != OK); + if (FileAccess::exists(scripts_metadata_path_editor)) { + DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES); + Error copy_err = da->copy(scripts_metadata_path_editor, scripts_metadata_path_player); + + ERR_EXPLAIN("Failed to copy scripts metadata file"); + ERR_FAIL_COND(copy_err != OK); + } + bool build_success = GodotSharpBuilds::get_singleton()->build_project_blocking("Tools"); if (build_success) { |