Skip to content

Commit 4f2fa52

Browse files
committed
Update metadata for NuGet package
1 parent 960ab3f commit 4f2fa52

File tree

2 files changed

+44
-7
lines changed

2 files changed

+44
-7
lines changed

GenericSymbolWithSyntaxTree.csproj renamed to Monkeymoto.GeneratorUtils.GenericSymbolWithSyntaxTree.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ used in your project's compilation, each paired with a syntax node.</Description
2525
<RepositoryType>git</RepositoryType>
2626
<PackageTags>incremental-generator, source-generator, generics</PackageTags>
2727
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
28+
<FileVersion>$(AssemblyVersion)</FileVersion>
29+
<AssemblyVersion>1.0.0.1</AssemblyVersion>
30+
<Version>$(AssemblyVersion)</Version>
2831
</PropertyGroup>
2932

3033
<ItemGroup>
@@ -36,10 +39,6 @@ used in your project's compilation, each paired with a syntax node.</Description
3639
</ItemGroup>
3740

3841
<ItemGroup>
39-
<None Update="COPYING.md">
40-
<Pack>True</Pack>
41-
<PackagePath>\</PackagePath>
42-
</None>
4342
<None Update="LICENSE.md">
4443
<Pack>True</Pack>
4544
<PackagePath>\</PackagePath>

README.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,48 @@ used in your project's compilation, each paired with a syntax node.
88
This project is designed to be used with a C# incremental generator to discover
99
closed generic symbols that are referenced in your project's compilation.
1010
Accordingly, the first step in using this project is to [add the necessary
11-
references to your `csproj` file](https://github.com/dotnet/roslyn/discussions/47517)[^1].
11+
references to your `csproj` file](https://github.com/dotnet/roslyn/discussions/47517).
1212

13-
[^1]: This project will be built and published as a NuGet package. This README
14-
should then be updated with relevant package info.
13+
The pre-built binaries of this project are available as a
14+
[NuGet Package](https://www.nuget.org/packages/Monkeymoto.GeneratorUtils.GenericSymbolWithSyntaxTree).
15+
Your `csproj` file may look like this:
16+
17+
````XML
18+
<Project Sdk="Microsoft.NET.Sdk">
19+
20+
<PropertyGroup>
21+
<OutputType>Library</OutputType>
22+
<TargetFramework>netstandard2.0</TargetFramework>
23+
<Nullable>enable</Nullable>
24+
<LangVersion>preview</LangVersion>
25+
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
26+
<PublishAot>false</PublishAot>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
31+
<PrivateAssets>all</PrivateAssets>
32+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
33+
</PackageReference>
34+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" />
35+
<PackageReference Include="Monkeymoto.GeneratorUtils.GenericSymbolWithSyntaxTree" Version="1.0.0.1">
36+
<PrivateAssets>all</PrivateAssets>
37+
<GeneratePathProperty>true</GeneratePathProperty>
38+
</PackageReference>
39+
</ItemGroup>
40+
41+
<PropertyGroup>
42+
<GetTargetPathDependsOn>$(GetTargetPathDependsOn);GetDependencyTargetPaths</GetTargetPathDependsOn>
43+
</PropertyGroup>
44+
45+
<Target Name="GetDependencyTargetPaths">
46+
<ItemGroup>
47+
<TargetPathWithTargetPlatformMoniker Include="$(PKGMonkeymoto_GeneratorUtils_GenericSymbolWithSyntaxTree)\lib\netstandard2.0\GenericSymbolWithSyntaxTree.dll" IncludeRuntimeDependency="false" />
48+
</ItemGroup>
49+
</Target>
50+
51+
</Project>
52+
````
1553

1654
Once this project has been added to your incremental generator, you can then
1755
use the `GenericSymbolWithSyntaxTree.FromIncrementalGeneratorInitializationContext`

0 commit comments

Comments
 (0)