From d78e0a842638df9c98a8f7637b125d36e488a367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Rold=C3=A1n=20Etcheverry?= Date: Sun, 27 Feb 2022 21:57:53 +0100 Subject: C#: Make GodotSharp API a NuGet package In the past, the Godot editor distributed the API assemblies and copied them to project directories for projects to reference them. This changed with the move to .NET 5/6. Godot no longer copies the assemblies to project directories. However, the project Sdk still tried to reference them from the same location. From now on, the GodotSharp API is distributed as a NuGet package, which the Sdk can reference. Added an option to `build_assemblies.py` to copy all Godot NuGet packages to an existing local NuGet source. This will be needed during development, while packages are not published to a remote NuGet repository. This option also makes sure to remove packages of the same version installed (~/.nuget/packages). Very useful during development, when packages change, to make sure the package being used by a project is the same we just built and not one from a previous build. A local NuGet source can be created like this: ``` mkdir ~/MyLocalNuGetSource && \ dotnet nuget add source ~/MyLocalNuGetSource/ -n MyLocalNuGetSource ``` --- modules/mono/Directory.Build.targets | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 modules/mono/Directory.Build.targets (limited to 'modules/mono/Directory.Build.targets') diff --git a/modules/mono/Directory.Build.targets b/modules/mono/Directory.Build.targets new file mode 100644 index 0000000000..98410b93ae --- /dev/null +++ b/modules/mono/Directory.Build.targets @@ -0,0 +1,22 @@ + + + <_HasNuGetPackage Condition=" '$(_HasNuGetPackage)' == '' And '$(PackageId)' != '' And '$(GeneratePackageOnBuild.ToLower())' == 'true' ">true + <_HasNuGetPackage Condition=" '$(_HasNuGetPackage)' == '' ">false + + + + $(MSBuildThisFileDirectory)\..\..\ + $(GodotSourceRootPath)\bin\GodotSharp\ + + + + + + + + + + -- cgit v1.2.3