diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-12-28 19:12:32 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-12-28 20:48:55 +0100 |
commit | 86274b9fc9e63c0eb6112bf4d87d67dd97fb0b86 (patch) | |
tree | 36b9c9909da20b9c7f0310a506542474bf2d1cba /modules/mono/SCsub | |
parent | 318c69351624f7794c51b5385d252af397c0404a (diff) |
Mono/C#: Re-structure API solution and GodotTools post-build target
Previously we had a placeholder solution called 'Managed' to benefit from
tooling while editing the a part of the C# API.
Later the bindings generator would create the final 'GodotSharp' solution
including these C# files as well as the auto-generated C# API.
Now we replaced the 'Managed' solution with the final 'GodotSharp' solution
which is no longer auto-generated, and the bindings generator only takes
care of the auto-generated C# API.
This has the following benefits:
- It's less confusing as there will no longer be two versions of the same file
(the original and a generated copy of it). Now there's only one.
- We no longer need placeholder for auto-generated API classes, like Node or
Resource. We used them for benefiting from tooling. Now we can just use the
auto-generated API itself.
- Simplifies the build system and bindings generator. Removed lot of code
that is not needed anymore.
Also added a post-build target to the GodotTools project to copy the output to
the data dir. This makes it easy to iterate when doing changes to GodotTools,
as SCons doesn't have to be executed anymore just to copy these new files.
Diffstat (limited to 'modules/mono/SCsub')
-rw-r--r-- | modules/mono/SCsub | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/modules/mono/SCsub b/modules/mono/SCsub index 457edfaeed..41be367f2f 100644 --- a/modules/mono/SCsub +++ b/modules/mono/SCsub @@ -8,14 +8,10 @@ Import('env_modules') env_mono = env_modules.Clone() -if env['tools']: +if env_mono['tools']: # NOTE: It is safe to generate this file here, since this is still executed serially - import build_scripts.make_cs_compressed_header as make_cs_compressed_header - make_cs_compressed_header.generate_header( - 'glue/Managed/Files', - 'glue/cs_compressed.gen.h', - 'glue/cs_glue_version.gen.h' - ) + import build_scripts.gen_cs_glue_version as gen_cs_glue_version + gen_cs_glue_version.generate_header('glue/GodotSharp', 'glue/cs_glue_version.gen.h') # Glue sources if env_mono['mono_glue']: @@ -38,24 +34,14 @@ env_mono = conf.Finish() mono_configure.configure(env, env_mono) -# Build Godot API solution - if env_mono['tools'] and env_mono['mono_glue']: + # Build Godot API solution import build_scripts.api_solution_build as api_solution_build api_sln_cmd = api_solution_build.build(env_mono) -# Build GodotTools - -if env_mono['tools']: + # Build GodotTools import build_scripts.godot_tools_build as godot_tools_build - if env_mono['mono_glue']: - godot_tools_build.build(env_mono, api_sln_cmd) - else: - # Building without the glue sources so the Godot API solution may be missing. - # GodotTools depends on the Godot API solution. As such, we will only build - # GodotTools.ProjectEditor which doesn't depend on the Godot API solution and - # is required by the bindings generator in order to be able to generated it. - godot_tools_build.build_project_editor_only(env_mono) + godot_tools_build.build(env_mono, api_sln_cmd) # Add sources |