Skip to content

Commit

Permalink
Remove design-time fix, share DebugSourceGenerators property
Browse files Browse the repository at this point in the history
The design-time intellisense issues are gone now, so no need for the fix package.

Also, the MSBuild comparison needs to work on pre-16.8 MSBuild (that ValueLessThan is
new in .NET5), so switch to a backwards-compatible check.
  • Loading branch information
kzu committed Oct 23, 2020
1 parent af2a78d commit a629f18
Show file tree
Hide file tree
Showing 15 changed files with 9 additions and 68 deletions.
8 changes: 1 addition & 7 deletions ThisAssembly.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThisAssembly", "src\ThisAss
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThisAssembly.Project", "src\ThisAssembly.Project\ThisAssembly.Project.csproj", "{A91C7A07-FFD6-4D19-BD78-B0BC8F9267DB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThisAssembly.DesignTimeFix", "src\ThisAssembly.DesignTimeFix\ThisAssembly.DesignTimeFix.csproj", "{C64BCC51-5E65-4062-BB92-A7E196DCD580}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThisAssembly.AssemblyInfo", "src\ThisAssembly.AssemblyInfo\ThisAssembly.AssemblyInfo.csproj", "{CDDF83BC-70BE-46C3-BD79-524D868A2812}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThisAssembly.Strings", "src\ThisAssembly.Strings\ThisAssembly.Strings.csproj", "{3E7158B5-BFEF-4416-8226-9096C7C98268}"
Expand All @@ -30,7 +28,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThisAssembly.Prerequisites", "src\ThisAssembly.Prerequisites\ThisAssembly.Prerequisites.csproj", "{568E5150-84AD-4619-BEA3-AA5EDF084ABC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThisAssembly.Constants", "src\ThisAssembly.Constants\ThisAssembly.Constants.csproj", "{31C53CCE-13FC-4890-803A-85CD146B909B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThisAssembly.Constants", "src\ThisAssembly.Constants\ThisAssembly.Constants.csproj", "{31C53CCE-13FC-4890-803A-85CD146B909B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -50,10 +48,6 @@ Global
{A91C7A07-FFD6-4D19-BD78-B0BC8F9267DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A91C7A07-FFD6-4D19-BD78-B0BC8F9267DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A91C7A07-FFD6-4D19-BD78-B0BC8F9267DB}.Release|Any CPU.Build.0 = Release|Any CPU
{C64BCC51-5E65-4062-BB92-A7E196DCD580}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C64BCC51-5E65-4062-BB92-A7E196DCD580}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C64BCC51-5E65-4062-BB92-A7E196DCD580}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C64BCC51-5E65-4062-BB92-A7E196DCD580}.Release|Any CPU.Build.0 = Release|Any CPU
{CDDF83BC-70BE-46C3-BD79-524D868A2812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDDF83BC-70BE-46C3-BD79-524D868A2812}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDDF83BC-70BE-46C3-BD79-524D868A2812}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ on the `ThisAssembly.Info` class.
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ThisAssembly.DesignTimeFix\ThisAssembly.DesignTimeFix.csproj" />
<ProjectReference Include="..\ThisAssembly.Prerequisites\ThisAssembly.Prerequisites.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>

<ItemGroup>
<CompilerVisibleProperty Include="DebugSourceGenerators" />
<CompilerVisibleProperty Include="DebugThisAssemblyAssemblyInfo" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion src/ThisAssembly.Constants/ThisAssembly.Constants.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ C#:
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ThisAssembly.DesignTimeFix\ThisAssembly.DesignTimeFix.csproj" />
<ProjectReference Include="..\ThisAssembly.Prerequisites\ThisAssembly.Prerequisites.csproj" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion src/ThisAssembly.Constants/ThisAssembly.Constants.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>

<ItemGroup>
<CompilerVisibleProperty Include="DebugSourceGenerators" />
<CompilerVisibleProperty Include="DebugThisAssemblyConstants" />

<CompilerVisibleItemMetadata Include="AdditionalFiles" MetadataName="SourceItemType" />
Expand Down
23 changes: 0 additions & 23 deletions src/ThisAssembly.DesignTimeFix/ThisAssembly.DesignTimeFix.csproj

This file was deleted.

26 changes: 0 additions & 26 deletions src/ThisAssembly.DesignTimeFix/ThisAssembly.DesignTimeFix.targets

This file was deleted.

1 change: 0 additions & 1 deletion src/ThisAssembly.Metadata/ThisAssembly.Metadata.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ C#:
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ThisAssembly.DesignTimeFix\ThisAssembly.DesignTimeFix.csproj" />
<ProjectReference Include="..\ThisAssembly.Prerequisites\ThisAssembly.Prerequisites.csproj" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion src/ThisAssembly.Metadata/ThisAssembly.Metadata.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>

<ItemGroup>
<CompilerVisibleProperty Include="DebugSourceGenerators" />
<CompilerVisibleProperty Include="DebugThisAssemblyMetadata" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<Project>

<PropertyGroup>
<LangVersion>Preview</LangVersion>
<MSBuildShortVersion>$(MSBuildVersion.TrimEnd('0123456789').TrimEnd('.'))</MSBuildShortVersion>
<!-- Remove when 16.8/C# 9 is stable -->
<LangVersion Condition="'$(MSBuildShortVersion)' == '16.8'">Preview</LangVersion>
</PropertyGroup>

<ItemGroup>
<CompilerVisibleProperty Include="DebugSourceGenerators" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<Target Name="EnsureSourceGenerators" BeforeTargets="BeforeCompile;CoreCompile">
<Error Text="ThisAssembly requires MSBuild 16.8+ or .NET SDK 5.0+."
Condition="$([MSBuild]::VersionLessThan($(MSBuildVersion), '16.8'))" />
Condition="$(MSBuildShortVersion) &lt; '16.8'" />
<Error Text="ThisAssembly uses Roslyn source generators, which are only supported in C# at the moment."
Condition="'$(Language)' != 'C#'" />
</Target>
Expand Down
1 change: 0 additions & 1 deletion src/ThisAssembly.Project/ThisAssembly.Project.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ C#:
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ThisAssembly.DesignTimeFix\ThisAssembly.DesignTimeFix.csproj" />
<ProjectReference Include="..\ThisAssembly.Prerequisites\ThisAssembly.Prerequisites.csproj" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion src/ThisAssembly.Project/ThisAssembly.Project.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
</Target>

<ItemGroup>
<CompilerVisibleProperty Include="DebugSourceGenerators" />
<CompilerVisibleProperty Include="DebugThisAssemblyProject" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion src/ThisAssembly.Strings/ThisAssembly.Strings.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ such as "Hello {name}".
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ThisAssembly.DesignTimeFix\ThisAssembly.DesignTimeFix.csproj" />
<ProjectReference Include="..\ThisAssembly.Prerequisites\ThisAssembly.Prerequisites.csproj" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion src/ThisAssembly.Strings/ThisAssembly.Strings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
</Target>

<ItemGroup>
<CompilerVisibleProperty Include="DebugSourceGenerators" />
<CompilerVisibleProperty Include="DebugThisAssemblyStrings" />

<CompilerVisibleItemMetadata Include="AdditionalFiles" MetadataName="SourceItemType" />
Expand Down

0 comments on commit a629f18

Please sign in to comment.