-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package the SG into the runtime package
The SG can be disabled by the consumer project by settings the following MSBuild property: <DisableCSnakesRuntimeSourceGenerator>true</DisableCSnakesRuntimeSourceGenerator>
- Loading branch information
Showing
6 changed files
with
58 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/CSnakes.Runtime/NuGet/buildTransitive/net8.0/CSnakes.Runtime.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project> | ||
<Target Name="_CSnakes_Runtime_GatherAnalyzers"> | ||
|
||
<ItemGroup> | ||
<_CSnakes_Runtime_Analyzer Include="@(Analyzer)" Condition="'%(Analyzer.NuGetPackageId)' == 'CSnakes.Runtime'" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="_CSnakes_Runtime_RemoveAnalyzers" | ||
Condition="'$(DisableCSnakesRuntimeSourceGenerator)' == 'true'" | ||
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets" | ||
DependsOnTargets="_CSnakes_Runtime_GatherAnalyzers"> | ||
|
||
<!-- Remove all our analyzers --> | ||
<ItemGroup> | ||
<Analyzer Remove="@(_CSnakes_Runtime_Analyzer)" /> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<PackageId>CSnakes.Runtime</PackageId> | ||
<Title>CSnakes Runtime</Title> | ||
<IsPackable>true</IsPackable> | ||
|
||
<!-- warning NU5128: Add lib or ref assemblies for the netstandard2.0 target framework --> | ||
<NoWarn>$(NoWarn);NU5128</NoWarn> | ||
|
||
<DevelopmentDependency>true</DevelopmentDependency> | ||
<GeneratePackageOnBuild>$(EnableLocalPackaging)</GeneratePackageOnBuild> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="NuGet\buildTransitive\**\*" CopyToOutputDirectory="PreserveNewest" Pack="true" PackagePath="buildTransitive\%(RecursiveDir)%(Filename)%(Extension)" /> | ||
</ItemGroup> | ||
|
||
<Target Name="_PackSourceGeneratorOutputs" BeforeTargets="_GetPackageFiles"> | ||
<!-- Find out the source generator and its dependencies locations --> | ||
<MSBuild Projects="@(ProjectReference)" | ||
Targets="GetTargetPath" | ||
BuildInParallel="true" | ||
Properties="TargetFramework=netstandard2.0" | ||
Condition="$([System.String]::Copy('%(Identity)').Contains('CSnakes.SourceGeneration'))"> | ||
<Output TaskParameter="TargetOutputs" ItemName="DependentAssemblies" /> | ||
</MSBuild> | ||
|
||
<!-- ...and pack the dependencies --> | ||
<ItemGroup> | ||
<None Include="@(DependentAssemblies)" Pack="true" PackagePath="analyzers/dotnet/cs" /> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.