-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prerequisite checks to avoid confusing users
Explicit build targets now check for the two requirements for ThisAssembly: MSBuild 16.8+ or .NET SDK 5.0+ and C#.
- Loading branch information
Showing
8 changed files
with
54 additions
and
1 deletion.
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
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
26 changes: 26 additions & 0 deletions
26
src/ThisAssembly.Prerequisites/ThisAssembly.Prerequisites.csproj
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,26 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<PackBuildOutput>false</PackBuildOutput> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<PackageId>ThisAssembly.Prerequisites</PackageId> | ||
<Description>Ensures that referencing project satisfies the prerequisites for ThisAssembly, namely: | ||
|
||
* MSBuild 16.8+: contains the Roslyn support for source generators | ||
* C# language: it's the only language supported by Roslyn source generators at the moment. | ||
</Description> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="@(Compile)" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NuGetizer" Version="0.4.1" /> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
</Project> |
7 changes: 7 additions & 0 deletions
7
src/ThisAssembly.Prerequisites/ThisAssembly.Prerequisites.props
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,7 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<LangVersion>Preview</LangVersion> | ||
</PropertyGroup> | ||
|
||
</Project> |
10 changes: 10 additions & 0 deletions
10
src/ThisAssembly.Prerequisites/ThisAssembly.Prerequisites.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,10 @@ | ||
<Project> | ||
|
||
<Target Name="EnsureSourceGenerators" BeforeTargets="BeforeCompile;CoreCompile"> | ||
<Error Text="ThisAssembly requires MSBuild 16.8+ or .NET SDK 5.0+." | ||
Condition="$([MSBuild]::VersionLessThan($(MSBuildVersion), '16.8'))" /> | ||
<Error Text="ThisAssembly uses Roslyn source generators, which are only supported in C# at the moment." | ||
Condition="'$(Language)' != 'C#'" /> | ||
</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 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