Skip to content

Commit

Permalink
Remove workarounds for referencing the DllImport source generator now…
Browse files Browse the repository at this point in the history
… that we use the RTM sdk. (#62156)

Co-authored-by: Andy Gocke <[email protected]>
  • Loading branch information
jkoritzinsky and agocke authored Nov 30, 2021
1 parent f53075c commit 84b55d9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
3 changes: 0 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
<DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
<!-- Opt-in/out repo features -->
<UsingToolMicrosoftNetCompilers>true</UsingToolMicrosoftNetCompilers>
<UsingToolMicrosoftNetILLinkTasks>true</UsingToolMicrosoftNetILLinkTasks>
<UsingToolIbcOptimization>false</UsingToolIbcOptimization>
<UsingToolXliff>false</UsingToolXliff>
Expand Down Expand Up @@ -52,8 +51,6 @@
<MicrosoftCodeAnalysisCSharpCodeStyleVersion>4.0.0-4.final</MicrosoftCodeAnalysisCSharpCodeStyleVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.0.0-4.final</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>7.0.0-preview1.21572.6</MicrosoftCodeAnalysisNetAnalyzersVersion>
<!-- Pin compiler version to workaround issue: https://github.com/dotnet/runtime/issues/59908 -->
<MicrosoftNetCompilersToolsetVersion>4.0.0-5.21453.15</MicrosoftNetCompilersToolsetVersion>
<!-- SDK dependencies -->
<MicrosoftDotNetCompatibilityVersion>2.0.0-alpha.1.21525.11</MicrosoftDotNetCompatibilityVersion>
<!-- Arcade dependencies -->
Expand Down
10 changes: 2 additions & 8 deletions eng/generators.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
and @(EnabledGenerators->AnyHaveMetadataValue('Identity', 'DllImportGenerator'))">
<ProjectReference
Include="$(LibrariesProjectRoot)System.Runtime.InteropServices\gen\DllImportGenerator\DllImportGenerator.csproj"
OutputItemType="InRepoSourceGenerator"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
<ProjectReference
Include="$(LibrariesProjectRoot)System.Runtime.InteropServices\gen\Microsoft.Interop.SourceGeneration\Microsoft.Interop.SourceGeneration.csproj"
OutputItemType="InRepoSourceGenerator"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup Condition="'@(EnabledGenerators)' != ''
Expand Down Expand Up @@ -83,12 +83,6 @@
<DefineConstants>$(DefineConstants);DLLIMPORTGENERATOR_INTERNALUNSAFE</DefineConstants>
</PropertyGroup>

<!-- We binplace Microsoft.Interop.SourceGeneration.dll and Microsoft.Interop.DllImportGenerator.dll into a directory that we control and add them as Analyzer items from there
to work around https://github.com/dotnet/roslyn/issues/56442, which is fixed in the 6.0 RTM SDK. When we consume the 6.0 SDK, we can remove this and instead change the
ProjectReferences to the source generator projects to have OutputItemType="Analyzer" -->
<Copy SourceFiles="@(InRepoSourceGenerator)" DestinationFolder="$(IntermediateOutputPath)referencedGenerators" SkipUnchangedFiles="true">
<Output TaskParameter="DestinationFiles" ItemName="Analyzer" />
</Copy>
<PropertyGroup>
<DefineConstants>$(DefineConstants);DLLIMPORTGENERATOR_ENABLED</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<AssemblyName>Microsoft.Interop.DllImportGenerator</AssemblyName>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<IncludeBuildOutput>false</IncludeBuildOutput>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Packable>false</Packable>
<Nullable>enable</Nullable>
<RootNamespace>Microsoft.Interop</RootNamespace>
Expand Down

0 comments on commit 84b55d9

Please sign in to comment.