feat: add local NuGet development workflow
Add a local NuGet feed configuration, a Directory.Build.props template for Godot users, and automate source generator bundling into the NuGet package.
This commit is contained in:
parent
1da0ca30d3
commit
5594515a53
|
|
@ -15,6 +15,7 @@ x86/
|
|||
!**/[Pp]ackages/build/
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
nupkgs/
|
||||
|
||||
# IDE
|
||||
.vs/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
<!--
|
||||
Directory.Build.props for Godot C# projects consuming OECS.
|
||||
Godot regenerates .csproj files on certain editor actions, which can
|
||||
wipe custom <ItemGroup> entries. This file is never touched by Godot.
|
||||
|
||||
Placement: put this file in the root of your Godot project (next to
|
||||
the .sln file), or in any parent directory.
|
||||
|
||||
You also need a nuget.config next to your .sln with the local feed:
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="local-oecs" value="path/to/oecs-sharp/nupkgs" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
-->
|
||||
<Project>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OECS" Version="0.1.*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<!-- Local feed for OECS development builds.
|
||||
Run `dotnet pack src/OECS/OECS.csproj -c Release -o ./nupkgs`
|
||||
to produce the package. -->
|
||||
<add key="local-oecs" value="./nupkgs" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
|
|
@ -23,4 +23,20 @@
|
|||
<PackageReference Include="R3" Version="1.2.9" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Bundle the source generator into the NuGet package as an analyzer.
|
||||
Consumers get compile-time component discovery automatically. -->
|
||||
<ItemGroup>
|
||||
<None Include="..\OECS.SourceGen\bin\$(Configuration)\netstandard2.0\OECS.SourceGen.dll"
|
||||
Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Ensure the source generator is built before packing.
|
||||
Skipped when NoBuild property is set to true. -->
|
||||
<Target Name="BuildSourceGenerator" BeforeTargets="GenerateNuspec"
|
||||
Condition="'$(NoBuild)' != 'true'">
|
||||
<MSBuild Projects="..\OECS.SourceGen\OECS.SourceGen.csproj"
|
||||
Targets="Build"
|
||||
Properties="Configuration=$(Configuration)" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in New Issue