diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2020-10-23 09:25:16 +0200 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2020-10-23 10:54:49 +0200 |
commit | 64b5ee701070e26a90702d345a1ee3188024d7ac (patch) | |
tree | 8dbb69f9aab3f7bbf06c92fa76076df433460075 /modules/mono/editor/Godot.NET.Sdk | |
parent | d5073c6b4ce864f169e4e1ad18d411fe5928c766 (diff) |
C#: Make editor create NuGet fallback folder for Godot packages
Main benefits:
- Projects can be built offline. Previously you needed internet
access the first time building to download the packages.
- Changes to packages like Godot.NET.Sdk can be easily tested
before publishing. This was already possible but required
too many manual steps.
- First time builds are a bit faster, as the Sdk package doesn't
need to be downloaded. In practice, the package is very small
so it makes little difference.
Bumped Godot.NET.Sdk to 4.0.0-dev3 in order to enable the
recent changes regarding '.mono/' -> '.godot/mono/'.
Diffstat (limited to 'modules/mono/editor/Godot.NET.Sdk')
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk.csproj | 19 | ||||
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk_PackageVersion.txt | 1 |
2 files changed, 18 insertions, 2 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk.csproj b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk.csproj index 86a0a4393e..8304d9e321 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk.csproj +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk.csproj @@ -1,13 +1,13 @@ <Project Sdk="Microsoft.Build.NoTargets/2.0.1"> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> + <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> <Description>MSBuild .NET Sdk for Godot projects.</Description> <Authors>Godot Engine contributors</Authors> <PackageId>Godot.NET.Sdk</PackageId> <Version>4.0.0</Version> - <PackageVersion>4.0.0-dev2</PackageVersion> <PackageProjectUrl>https://github.com/godotengine/godot/tree/master/modules/mono/editor/Godot.NET.Sdk</PackageProjectUrl> <PackageType>MSBuildSdk</PackageType> <PackageTags>MSBuildSdk</PackageTags> @@ -19,7 +19,13 @@ <GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);SetNuSpecProperties</GenerateNuspecDependsOn> </PropertyGroup> - <Target Name="SetNuSpecProperties" Condition=" Exists('$(NuspecFile)') "> + <Target Name="ReadGodotNETSdkVersion" BeforeTargets="BeforeBuild;BeforeRebuild;CoreCompile"> + <PropertyGroup> + <PackageVersion>$([System.IO.File]::ReadAllText('$(ProjectDir)Godot.NET.Sdk_PackageVersion.txt').Trim())</PackageVersion> + </PropertyGroup> + </Target> + + <Target Name="SetNuSpecProperties" Condition=" Exists('$(NuspecFile)') " DependsOnTargets="ReadGodotNETSdkVersion"> <PropertyGroup> <NuspecProperties> id=$(PackageId); @@ -32,4 +38,13 @@ </NuspecProperties> </PropertyGroup> </Target> + + <Target Name="CopyNupkgToSConsOutputDir" AfterTargets="Pack"> + <PropertyGroup> + <GodotSourceRootPath>$(SolutionDir)\..\..\..\..\</GodotSourceRootPath> + <GodotOutputDataDir>$(GodotSourceRootPath)\bin\GodotSharp\</GodotOutputDataDir> + </PropertyGroup> + <Copy SourceFiles="$(OutputPath)$(PackageId).$(PackageVersion).nupkg" + DestinationFolder="$(GodotOutputDataDir)Tools\nupkgs\" /> + </Target> </Project> diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk_PackageVersion.txt b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk_PackageVersion.txt new file mode 100644 index 0000000000..34749489b9 --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk_PackageVersion.txt @@ -0,0 +1 @@ +4.0.0-dev3 |