virtualx-engine/modules/mono
Ignacio Etcheverry ced77b1e9b C#: Switch games to MSBuild Sdks and .NET Standard
Godot.NET.Sdk
-------------

Godot uses its own custom MSBuild Sdk for game
projects. This new Sdk adds its own functionality
on top of 'Microsoft.NET.Sdk'.

The new Sdk is resolved from the NuGet package.

All the default boilerplate was moved from game
projects to the Sdk. The default csproj for
game project can now be as simple as:

```
<Project Sdk="Godot.NET.Sdk/4.0.0-dev2">
  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
  </PropertyGroup>
</Project>
```

Source files are included by automatically so
Godot no longer needs to keep the csproj in sync
when creating new source files.

Define constants
----------------

Godot defines a list of constants for conditional
compilation. When exporting games, this list also
included engine 'features' and platform 'bits'.
There were a few problems with that:

- The 'features' constants were only defined when
  exporting games. Not when building the game for
  running in the editor player.
- If the project was built externally by an IDE,
  the constants wouldn't be defined at all.

The new Sdk assigns default values to these
constants when not built from the Godot editor,
i.e.: when built from an IDE or from the command
line. The default define constants are determined
from the system MSBuild is running on.

However, it's not possible for MSBuild to
determine the set of supported engine features.
It's also not possible to determine if a project
is being built to run on a 32-bit or 64-bit
Godot executable.

As such the 'features' and 'bits' constants had
to be removed.
The benefit of checking those at compile time
was questionable, and they can still be checked
at runtime.

The new list of define constants includes:

- GODOT
- GODOT_<PLATFORM>
  Defaults to the platform MSBuild is running on.
- GODOT_<PC/MOBILE/WEB>
- TOOLS
  When building with the 'Debug' configuration
  (editor and editor player).
- GODOT_REAL_T_IS_DOUBLE
  Not defined by default unless $(GodotRealTIsDouble)
  is overriden to be 'true'.

.NET Standard
-------------

The target framework of game projects was changed
to 'netstandard2.1'.
2020-07-25 19:22:01 +02:00
..
build_scripts Mono/C#: Use /restore instead of /t:restore when building 2020-06-25 23:50:05 +02:00
doc_classes Document Mono-specific classes 2020-06-18 10:32:34 +02:00
editor C#: Switch games to MSBuild Sdks and .NET Standard 2020-07-25 19:22:01 +02:00
glue C#: Switch games to MSBuild Sdks and .NET Standard 2020-07-25 19:22:01 +02:00
icons Fix missing module editor icons 2020-03-08 19:32:25 +02:00
mono_gd Fix Mono PackedArray Marshalling 2020-07-05 14:54:31 -06:00
utils [macOS, Mono] Fix "Wdeprecated-declarations" build error. 2020-07-10 18:45:12 +03:00
.gitignore Make git no longer ignore solution files inside the mono module 2019-08-12 15:59:06 +02:00
__init__.py Re-write mono module editor code in C# 2019-07-05 09:38:23 +02:00
class_db_api_json.cpp Mono/C#: Fix several clang-tidy warnings and cleanup 2020-07-05 19:19:36 +02:00
class_db_api_json.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
config.py DocData: Skip language-specific ClassDoc without methods/constants 2020-06-17 15:09:07 +02:00
csharp_script.cpp C#: Switch games to MSBuild Sdks and .NET Standard 2020-07-25 19:22:01 +02:00
csharp_script.h Mono/C#: Fix several clang-tidy warnings and cleanup 2020-07-05 19:19:36 +02:00
godotsharp_defs.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
godotsharp_dirs.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
godotsharp_dirs.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
managed_callable.cpp Mono/C#: Fix several clang-tidy warnings and cleanup 2020-07-05 19:19:36 +02:00
managed_callable.h Mono/C#: Optimize the way we store GC handles for scripts 2020-03-17 21:51:05 +01:00
mono_gc_handle.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
mono_gc_handle.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
register_types.cpp Mono/C#: Fix several clang-tidy warnings and cleanup 2020-07-05 19:19:36 +02:00
register_types.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
SCsub Add SCons option to not build C# solutions 2020-05-22 17:44:33 +02:00
signal_awaiter_utils.cpp Mono/C#: Fix several clang-tidy warnings and cleanup 2020-07-05 19:19:36 +02:00
signal_awaiter_utils.h Mono/C#: Optimize the way we store GC handles for scripts 2020-03-17 21:51:05 +01:00