瀏覽代碼

Rename page mono->dotnet, Doc build_assemblies args, Note about mono, Reviews, Fixes

RedworkDE 2 年之前
父節點
當前提交
4d78c82027

+ 1 - 0
_tools/redirects/redirects.csv

@@ -25,6 +25,7 @@ source,destination
 /content/3d/making_trees.html,/tutorials/content/making_trees.html
 /contributing/_contributing.html,/community/contributing/
 /contributing/bug_triage_guidelines.html,/community/contributing/bug_triage_guidelines.html
+/contributing/development/compiling/compiling_with_mono.html,/contributing/development/compiling/compiling_with_dotnet.html
 /contributing/development/core_and_modules/introduction_to_godot_development.html,/contributing/development/core_and_modules/index.html
 /contributing/doc_and_l10n_guidelines.html,/community/contributing/doc_and_l10n_guidelines.html
 /contributing/updating_the_class_reference.html,/community/contributing/updating_the_class_reference.html

+ 69 - 9
contributing/development/compiling/compiling_with_mono.rst → contributing/development/compiling/compiling_with_dotnet.rst

@@ -1,6 +1,6 @@
-.. _doc_compiling_with_mono:
+.. _doc_compiling_with_dotnet:
 
-Compiling with Mono
+Compiling with .NET
 ===================
 
 .. highlight:: shell
@@ -8,14 +8,22 @@ Compiling with Mono
 Requirements
 ------------
 
-- .NET SDK 6.0 or greater (generally 64 bit)
+- `.NET SDK 6.0 <https://dotnet.microsoft.com/download>`_ or greater
+  (generally 64 bit)
 
-You can use ``dotnet --version`` to check your .NET version.
+You can use ``dotnet --list-sdks`` to check if you have a compatible .NET SDK
+installed.
 
-Enable the Mono module
+Enable the .NET module
 ----------------------
 
-By default, the Mono module is disabled when building. To enable it, add the
+.. note:: C# support for Godot has historically used the
+          `Mono <https://www.mono-project.com/>`_ runtime instead of the
+          `.NET Runtime <https://github.com/dotnet/runtime>`_ and internally
+          many things are still named ``mono`` instead of ``dotnet`` or
+          otherwise referred to as ``mono``.
+
+By default, the .NET module is disabled when building. To enable it, add the
 option ``module_mono_enabled=yes`` to the SCons command line, while otherwise
 following the instructions for building the desired Godot binaries.
 
@@ -55,8 +63,8 @@ used to generate the Mono glue.
 Building the managed libraries
 ------------------------------
 
-Once you have generated the Mono glue, you can builds the managed libraries with
-the ``build_assemblies.py`` script.::
+Once you have generated the Mono glue, you can build the managed libraries with
+the ``build_assemblies.py`` script::
 
     ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin
 
@@ -76,6 +84,58 @@ proper functioning and must be distributed together with Godot.
 More details about this directory in
 :ref:`Data directory<compiling_with_mono_data_directory>`.
 
+Build Platform
+^^^^^^^^^^^^^^
+
+Provide the ``--godot-platform=<platform>`` argument to control for which
+platform specific the libraries are built. Omit this argument to build for the
+current system.
+
+This currently only controls the inclusion of the support for Visual Studio as
+an external editor, the libraries are otherwise identical.
+
+NuGet packages
+^^^^^^^^^^^^^^
+
+The API assemblies, source generators, and custom MSBuild project SDK are
+distributed as NuGet packages. This is all transparent to the user, but it can
+make things complicated during development.
+
+In order to use Godot with a development version of those packages, a local
+NuGet source must be created where MSBuild can find them. This can be done with
+the .NET CLI:
+
+::
+
+    dotnet nuget add source ~/MyLocalNugetSource --name MyLocalNugetSource
+
+The Godot NuGet packages must be added to that local source. Additionally, we
+must make sure there are no other versions of the package in the NuGet cache, as
+MSBuild may pick one of those instead.
+
+In order to simplify this process, the ``build_assemblies.py`` script provides
+the following ``--push-nupkgs-local`` option:
+
+::
+
+    ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin --push-nupkgs-local ~/MyLocalNugetSource
+
+This option ensures the packages will be added to the specified local NuGet
+source and that conflicting versions of the package are removed from the NuGet
+cache. It's recommended to always use this option when building the C# solutions
+during development to avoid mistakes.
+
+Double Precision Support (REAL_T_IS_DOUBLE)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When building Godot with double precision support, i.e. the ``precision=double``
+argument for scons, the managed libraries must be adjusted to match by passing
+the ``--precision=double`` argument:
+
+::
+
+    ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin --push-nupkgs-local ~/MyLocalNugetSource --precision=double
+
 Examples
 --------
 
@@ -129,7 +189,7 @@ The name of the data directory for the Godot editor will always be
 API assemblies and a ``Tools`` subdirectory with the tools required by the
 editor, like the ``GodotTools`` assemblies and its dependencies.
 
-On macOS, if the Godot editor is distributed as a bundle, ``GodotSharp``
+On macOS, if the Godot editor is distributed as a bundle, the ``GodotSharp``
 directory may be placed in the ``<bundle_name>.app/Contents/Resources/``
 directory inside the bundle.
 

+ 1 - 1
contributing/development/compiling/index.rst

@@ -15,6 +15,6 @@ Building from source
    cross-compiling_for_ios_on_linux
    compiling_for_uwp
    compiling_for_web
-   compiling_with_mono
+   compiling_with_dotnet
    optimizing_for_size
    compiling_with_script_encryption_key

+ 2 - 1
tutorials/scripting/c_sharp/c_sharp_basics.rst

@@ -56,7 +56,8 @@ Download and install the latest stable version of the SDK from the
     if you are using the 64-bit version of Godot.
 
 If you are building Godot from source, make sure to follow the steps to enable
-.NET support in your build as outlined in the :ref:`doc_compiling_with_mono` page.
+.NET support in your build as outlined in the :ref:`doc_compiling_with_dotnet`
+page.
 
 Configuring an external editor
 ------------------------------