-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project references support #15
Comments
https://github.com/HavenDV/H.Generators.Extensions/blob/main/src/libs/H.Generators.Extensions/build/H.Generators.Extensions.props I also tried releasing a new version of H.NSwag.Generator and it seems to still work correctly - I also don't see any extra dependencies in the .nuspec file |
The main problem with dependency code via PKG is transitive dependency version hell, because packages almost always use a non-latest version |
Add this also <None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" /> H.NSwag.Generator.csproj <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<NoWarn>$(NoWarn);CA1031</NoWarn>
</PropertyGroup>
<PropertyGroup Label="NuGet">
<NoWarn>$(NoWarn);NU5128</NoWarn>
<DevelopmentDependency>true</DevelopmentDependency>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>false</IncludeSymbols>
<Description>C# 9 Source Generator library for NSwag.</Description>
<PackageTags>nswag, generator, source generator, csharp 9</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NSwag.CodeGeneration.CSharp" Version="14.1.0" PrivateAssets="all" />
<PackageReference Include="NSwag.Core.Yaml" Version="14.1.0" PrivateAssets="all" />
<PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="11.0.2" PrivateAssets="all" />
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="$(AssemblyName).props" Pack="true" PackagePath="build" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" PrivateAssets="all" />
<PackageReference Include="H.Generators.Extensions" Version="1.22.0" PrivateAssets="all" />
</ItemGroup>
</Project> |
It was already there https://github.com/valchetski/NJsonSchema/blob/a213136fad1e41c519bd2762d81767574bbacc83/src/NJsonSchema.SourceGenerators.CSharp/NJsonSchema.SourceGenerators.CSharp.csproj#L30. I've pushed the latest changes after the removal of GetDependencyTargetPaths/GetTargetPathDependsOn to https://github.com/valchetski/NJsonSchema/tree/source-generator-h-generators. |
I've tried to use your library as suggested in RicoSuter/NJsonSchema#1726.
At first, amazing library 🙂. It works like a charm for transient NuGet packages.
However, I have one question and one issue with project references
Question
Does it support the automatic inclusion of referenced projects (also transient references) DLLs into the NuGet package?
For example, is it possible to avoid these lines and have these DLLs included automatically?
And avoid these for the case when Source Generator is used as project reference itself:
Issue
It appears that it somehow treats all project references as dependent NuGet packages.
Try to generate a NuGet package for the
NJsonSchema.SourceGenerators.CSharp
project from https://github.com/valchetski/NJsonSchema/tree/source-generator-h-generatorsThen try to install it and see that it gonna install all the packages.
This is something I would like to disable. Or at least have it configurable.
If you do the same from https://github.com/valchetski/NJsonSchema/tree/source-generator branch (H.Generators.Extensions library is not installed there) then it'll install the bare minimum which is what I need:
Thanks in advance!
The text was updated successfully, but these errors were encountered: