|
7 | 7 | <!--Mark the nuget as a dev dependency, so any projects using this nuget don't auto pull in this project-->
|
8 | 8 | <DevelopmentDependency>true</DevelopmentDependency>
|
9 | 9 | <IsPackable>true</IsPackable>
|
10 |
| - <GeneratePackageOnBuild>true</GeneratePackageOnBuild> |
| 10 | + <!--<GeneratePackageOnBuild>true</GeneratePackageOnBuild>--> |
11 | 11 | <!--Skip Package Analysis because it'll complain we don't have any files at the "lib/netstandard2.0" path, which is okay because this is a source generator-->
|
12 | 12 | <NoPackageAnalysis>true</NoPackageAnalysis>
|
13 | 13 | </PropertyGroup>
|
|
36 | 36 | <ItemGroup>
|
37 | 37 | <PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
|
38 | 38 | <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" PrivateAssets="all" />
|
| 39 | + </ItemGroup> |
39 | 40 |
|
| 41 | + <!-- Reference the attributes from the generator to compile against them --> |
| 42 | + <!-- Ensure we specify PrivateAssets so the NuGet doesn't have any dependencies --> |
| 43 | + <ItemGroup> |
| 44 | + <ProjectReference Include="..\PublicInterfaceGenerator.Attributes\PublicInterfaceGenerator.Attributes.csproj" PrivateAssets="All" /> |
40 | 45 | </ItemGroup>
|
| 46 | + |
41 | 47 | <ItemGroup>
|
42 |
| - <!-- Generator dependencies --> |
| 48 | + <!-- Anyone using the generator needs to use the attributes NuGet so any reflection doesn't throw when it sees the attributes in code --> |
43 | 49 | <PackageReference Include="ProgrammerAl.SourceGenerators.PublicInterfaceGenerator.Attributes" Version="*" />
|
44 | 50 |
|
45 | 51 | <!-- Package the generator in the analyzer directory of the nuget package -->
|
46 | 52 | <None Include="$(OutputPath)/$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
|
47 | 53 |
|
48 |
| - <!-- Pack the attributes dll in the lib\netstandard2.0 path so the library consuming this nuget can use it --> |
49 |
| - <!--<None Include="$(OutputPath)/ProgrammerAl.SourceGenerators.PublicInterfaceGenerator.Attributes.dll" Pack="true" PackagePath="lib/netstandard2.0" Visible="true" />--> |
| 54 | + <!--Pack the attributes dll in the lib\netstandard2.0 path so the library consuming this nuget can use it--> |
| 55 | + <None Include="$(OutputPath)/ProgrammerAl.SourceGenerators.PublicInterfaceGenerator.Attributes.dll" Pack="true" PackagePath="lib/netstandard2.0" Visible="true" /> |
50 | 56 |
|
51 | 57 | <None Include="../../README.md" Pack="true" PackagePath="/" />
|
52 | 58 | </ItemGroup>
|
|
0 commit comments