|
18 | 18 | </ProjectReference> |
19 | 19 | </ItemGroup> |
20 | 20 |
|
| 21 | + <PropertyGroup> |
| 22 | + <_AnalyzerVariantsDir>..\..\artifacts\analyzer-variants</_AnalyzerVariantsDir> |
| 23 | + </PropertyGroup> |
| 24 | + |
| 25 | + <ItemGroup> |
| 26 | + <_RoslynVariant Include="4.8.0"> |
| 27 | + <Folder>roslyn4.8</Folder> |
| 28 | + </_RoslynVariant> |
| 29 | + <_RoslynVariant Include="5.0.0"> |
| 30 | + <Folder>roslyn5.0</Folder> |
| 31 | + </_RoslynVariant> |
| 32 | + </ItemGroup> |
| 33 | + |
| 34 | + <Target Name="_BuildAnalyzerVariants" BeforeTargets="GenerateNuspec" Condition="'$(NoBuild)' != 'true'"> |
| 35 | + <MSBuild |
| 36 | + Projects="..\EntityFrameworkCore.Projectables.Generator\EntityFrameworkCore.Projectables.Generator.csproj" |
| 37 | + Targets="Restore;Build" |
| 38 | + Properties="Configuration=$(Configuration);RoslynAnalyzerVersion=%(_RoslynVariant.Identity);BaseOutputPath=$(_AnalyzerVariantsDir)\Generator-%(_RoslynVariant.Folder)\bin\;BaseIntermediateOutputPath=$(_AnalyzerVariantsDir)\Generator-%(_RoslynVariant.Folder)\obj\" |
| 39 | + RemoveProperties="TargetFramework" /> |
| 40 | + <MSBuild |
| 41 | + Projects="..\EntityFrameworkCore.Projectables.CodeFixes\EntityFrameworkCore.Projectables.CodeFixes.csproj" |
| 42 | + Targets="Restore;Build" |
| 43 | + Properties="Configuration=$(Configuration);RoslynAnalyzerVersion=%(_RoslynVariant.Identity);BaseOutputPath=$(_AnalyzerVariantsDir)\CodeFixes-%(_RoslynVariant.Folder)\bin\;BaseIntermediateOutputPath=$(_AnalyzerVariantsDir)\CodeFixes-%(_RoslynVariant.Folder)\obj\" |
| 44 | + RemoveProperties="TargetFramework" /> |
| 45 | + </Target> |
| 46 | + |
| 47 | + <Target Name="_CheckAnalyzerVariants" BeforeTargets="GenerateNuspec" Condition="'$(NoBuild)' == 'true'"> |
| 48 | + <Error Condition="!Exists('$(_AnalyzerVariantsDir)\Generator-roslyn4.8\bin\$(Configuration)\netstandard2.0\EntityFrameworkCore.Projectables.Generator.dll') OR !Exists('$(_AnalyzerVariantsDir)\Generator-roslyn5.0\bin\$(Configuration)\netstandard2.0\EntityFrameworkCore.Projectables.Generator.dll')" |
| 49 | + Text="Roslyn-variant analyzer DLLs are missing under '$(_AnalyzerVariantsDir)'. Run 'dotnet pack' without --no-build to produce them." /> |
| 50 | + </Target> |
| 51 | + |
| 52 | + <Target Name="_CleanAnalyzerVariants" AfterTargets="Clean"> |
| 53 | + <RemoveDir Directories="$(_AnalyzerVariantsDir)\Generator-%(_RoslynVariant.Folder);$(_AnalyzerVariantsDir)\CodeFixes-%(_RoslynVariant.Folder)" /> |
| 54 | + </Target> |
| 55 | + |
21 | 56 | <ItemGroup> |
22 | | - <!-- Package the generator and the code fix provider in the analyzer directory of the nuget package --> |
23 | | - <None Include="..\EntityFrameworkCore.Projectables.Generator\bin\$(Configuration)\netstandard2.0\EntityFrameworkCore.Projectables.Generator.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" /> |
24 | | - <None Include="..\EntityFrameworkCore.Projectables.CodeFixes\bin\$(Configuration)\netstandard2.0\EntityFrameworkCore.Projectables.CodeFixes.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" /> |
| 57 | + <None Include="$(_AnalyzerVariantsDir)\Generator-roslyn4.8\bin\$(Configuration)\netstandard2.0\EntityFrameworkCore.Projectables.Generator.dll" |
| 58 | + Pack="true" PackagePath="analyzers/dotnet/roslyn4.8/cs" Visible="false" /> |
| 59 | + <None Include="$(_AnalyzerVariantsDir)\CodeFixes-roslyn4.8\bin\$(Configuration)\netstandard2.0\EntityFrameworkCore.Projectables.CodeFixes.dll" |
| 60 | + Pack="true" PackagePath="analyzers/dotnet/roslyn4.8/cs" Visible="false" /> |
| 61 | + <None Include="$(_AnalyzerVariantsDir)\Generator-roslyn5.0\bin\$(Configuration)\netstandard2.0\EntityFrameworkCore.Projectables.Generator.dll" |
| 62 | + Pack="true" PackagePath="analyzers/dotnet/roslyn5.0/cs" Visible="false" /> |
| 63 | + <None Include="$(_AnalyzerVariantsDir)\CodeFixes-roslyn5.0\bin\$(Configuration)\netstandard2.0\EntityFrameworkCore.Projectables.CodeFixes.dll" |
| 64 | + Pack="true" PackagePath="analyzers/dotnet/roslyn5.0/cs" Visible="false" /> |
25 | 65 | </ItemGroup> |
26 | 66 |
|
27 | 67 | <ItemGroup> |
|
0 commit comments