-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor Sdk, make compatible with .NET 8 and CPM
- Loading branch information
Showing
13 changed files
with
600 additions
and
212 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
.ionide/ | ||
App_Data/ | ||
packages/ | ||
package/ | ||
obj/ | ||
bin/ | ||
build/ | ||
|
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 |
---|---|---|
@@ -1,38 +1,25 @@ | ||
<Project> | ||
|
||
<PropertyGroup Label="Target Platforms" > | ||
<TargetFramework>net6.0</TargetFramework> | ||
</PropertyGroup> | ||
<PropertyGroup Label="NuGet Properties"> | ||
<Authors>Allegro</Authors> | ||
<Company>Allegro</Company> | ||
<Copyright>© Allegro. All rights reserved.</Copyright> | ||
<Description>$(MSBuildProjectName)</Description> | ||
<Tags>Allegro</Tags> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Label="Project Settings" > | ||
<Platforms>AnyCPU</Platforms> | ||
<TargetPlatform>AnyCPU</TargetPlatform> | ||
<ErrorReport>prompt</ErrorReport> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<WarningsAsErrors /> | ||
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> | ||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks> | ||
<LangVersion>latest</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>disable</ImplicitUsings> | ||
<EnableDefaultNoneItems>false</EnableDefaultNoneItems> | ||
<NoWarn>$(NoWarn);NU5128;SA0001</NoWarn> | ||
<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Include="$(MSBuildThisFileDirectory)$(PackageReadmeFile)" Pack="true" PackagePath="" /> | ||
<None Include="$(MSBuildThisFileDirectory)$(PackageLicenseFile)" Pack="true" PackagePath="" /> | ||
<!-- <None Include="$(MSBuildThisFileDirectory)$(PackageIconPath)" Pack="true" PackagePath="" Visible="false" /> --> | ||
<!-- <None Include="$(MSBuildThisFileDirectory)CHANGELOG.md" Pack="true" PackagePath=""/> --> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Label="Build Output" > | ||
<BaseOutputPath>$(MSBuildThisFileDirectory)\bin\$(MSBuildProjectName)</BaseOutputPath> | ||
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath> | ||
<PackageOutputPath>$(MSBuildThisFileDirectory)\nuget</PackageOutputPath> | ||
<DocumentationFileValue>$(MSBuildThisFileDirectory)\bin\$(MSBuildProjectName)\$(Configuration)\$(TargetFramework)\$(MSBuildProjectName).xml</DocumentationFileValue> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Label="NuGet Properties"> | ||
<Authors>Allegro</Authors> | ||
<Company>Allegro</Company> | ||
<Copyright>© Allegro. All rights reserved.</Copyright> | ||
<Description>$(MSBuildProjectName)</Description> | ||
<Tags>Allegro</Tags> | ||
</PropertyGroup> | ||
|
||
</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 |
---|---|---|
@@ -1,13 +1,3 @@ | ||
<Project> | ||
<Sdk Name="Microsoft.Build.CentralPackageVersions" /> | ||
|
||
<ItemGroup Condition="'$(IsPackable)' == 'true'"> | ||
<None Include="Sdk\**" | ||
Pack="true" | ||
PackagePath="Sdk\" /> | ||
<None Include="$(PackageIconPath)" | ||
Pack="true" | ||
PackagePath="\" | ||
Visible="false" /> | ||
</ItemGroup> | ||
<!-- Empty file prevents accidental inclusion of files from directories above --> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.Build.NoTargets"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<BuildOutputTargetFolder>build\</BuildOutputTargetFolder> | ||
<PackageVersion>2.0.0</PackageVersion> | ||
<IsPackable>true</IsPackable> | ||
<DevelopmentDependency>true</DevelopmentDependency> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<PackageType>MSBuildSdk</PackageType> | ||
<Description>Allegro Dotnet SDK</Description> | ||
<PackageTags>MSBuild MSBuildSdk</PackageTags> | ||
<DevelopmentDependency>true</DevelopmentDependency> | ||
<PackageVersion>1.2.2</PackageVersion> | ||
<PackageDescription>Allegro Dotnet SDK</PackageDescription> | ||
<PackageTags>$(Tags) MSBuild MSBuildSdk</PackageTags> | ||
<EnableDefaultNoneItems>false</EnableDefaultNoneItems> | ||
<!-- NU5128: Add lib or ref assemblies for the net6.0 target framework --> | ||
<NoWarn>$(NoWarn);NU5128</NoWarn> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="Sdk/**" Pack="true" PackagePath="Sdk/" /> | ||
</ItemGroup> | ||
|
||
</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 |
---|---|---|
@@ -1,85 +1,27 @@ | ||
<Project> | ||
<PropertyGroup Label="Target Platforms"> | ||
<NetCoreVersions>net6.0</NetCoreVersions> | ||
<NetStandardVersions>netstandard2.0;netstandard2.1</NetStandardVersions> | ||
<LibraryTargetFrameworks>$(NetCoreVersions);$(NetStandardVersions)</LibraryTargetFrameworks> | ||
<ExecutableTargetFrameworks>$(NetCoreVersions)</ExecutableTargetFrameworks> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Label="Project Settings"> | ||
<LangVersion>latest</LangVersion> | ||
<AnalysisMode>Recommended</AnalysisMode> | ||
<AnalysisLevel>latest</AnalysisLevel> | ||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<!-- Documentation can be enforced per-project --> | ||
<GenerateDocumentationFile>false</GenerateDocumentationFile> | ||
<!-- Some devs might want to turn off errors for warning for local development --> | ||
<TreatWarningsAsErrors Condition=" '$(TreatWarningsAsErrors)' != 'false' ">true</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Label="ImplicitUsings additional includes"> | ||
<Using Include="System.Collections.Immutable" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<!-- | ||
Indicate to other targets that Allegro.DotnetSdk is being used. | ||
--> | ||
<UsingAllegroDotnetSdk>true</UsingAllegroDotnetSdk> | ||
|
||
<PropertyGroup Label="Build Output"> | ||
<RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)', 'global.json'))</RepoRoot> | ||
<BaseOutputPath>$(RepoRoot)\bin\$(MSBuildProjectName)</BaseOutputPath> | ||
<BaseIntermediateOutputPath>$(RepoRoot)\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath> | ||
<PackageOutputPath>$(RepoRoot)\nuget</PackageOutputPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Label="StyleCop" Condition="'$(AllegroDotnetSdkEnableStyleCop)' != false"> | ||
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json"/> | ||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435"> <!-- need to use beta version to get the latest fixes --> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
<!-- | ||
Import our custom props just after Directory.Build.props is imported, but before Microsoft.NET.Sdk.props | ||
--> | ||
<CustomAfterDirectoryBuildProps>$(CustomAfterDirectoryBuildProps);$(MSBuildThisFileDirectory)UseAllegroDotnetSdkDefaults.props</CustomAfterDirectoryBuildProps> | ||
<!-- | ||
Import our custom targets after Directory.Build.targets is imported | ||
--> | ||
<CustomBeforeDirectoryBuildTargets>$(CustomBeforeDirectoryBuildTargets);$(MSBuildThisFileDirectory)UseAllegroDotnetSdkDefaults.targets</CustomBeforeDirectoryBuildTargets> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Label="AsyncFixer" Condition="'$(AllegroDotnetSdkEnableAsyncFixer)' != false"> | ||
<PackageReference Include="AsyncFixer" Version="1.6.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="Meziantou" Condition="'$(AllegroDotnetSdkEnableMeziantou)' != false"> | ||
<PackageReference Include="Meziantou.Analyzer" Version="1.0.734"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
<!-- | ||
LEGACY: remove after no more projects reference NetCoreVersions property: | ||
https://sourcegraph.allegrogroup.com/search?q=context:global+repo:AllegroTechies+%22%28NetCoreVersions%29%22&patternType=standard&sm=1&groupBy=repo | ||
--> | ||
<PropertyGroup Label="Target Platforms"> | ||
<NetCoreVersions>net6.0</NetCoreVersions> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Label="NRT configuration" Condition=" '$(Configuration)' == 'Debug' AND '$(Nullable)' == 'enable' AND '$(AllegroDotnetSdkEnableSmartAnalyzers)' != false "> | ||
<PackageReference Include="SmartAnalyzers.CSharpExtensions.Annotations" Version="4.2.7"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; compile; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
<AssemblyAttribute Include="SmartAnalyzers.CSharpExtensions.Annotations.InitRequiredForNotNullAttribute" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="Global editor config" Condition="'$(AllegroDotnetSdkDisableGlobalEditorConfig)' != true"> | ||
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)editor.globalconfig" Link="editor.globalconfig" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Label="Properties dedicated for test projects" Condition="$(MSBuildProjectDirectory.Contains(`test`))"> | ||
<!-- Exclude analyzer warnings in test projects --> | ||
<!-- CA1707: Identifiers should not contain underscores --> | ||
<NoWarn>$(NoWarn);CA1707</NoWarn> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition=" !$(MSBuildProjectDirectory.Contains(`test`)) "> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<!-- SourceLink configuration --> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<!-- Embed PDBs in .nupkg because Azure Artifacts doesn't support .snupkg yet --> | ||
<AllowedOutputExtensionsInPackageBuildOutputFolder> | ||
$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb | ||
</AllowedOutputExtensionsInPackageBuildOutputFolder> | ||
<IncludeSymbols>true</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
</PropertyGroup> | ||
|
||
</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 |
---|---|---|
@@ -1,17 +1,9 @@ | ||
<Project> | ||
<!-- Empty file prevents accidental inclusion of files from directories above --> | ||
<Project InitialTargets="AllegroDotnetSdkValidation"> | ||
|
||
<Target Name="AllegroDotnetSdkValidation"> | ||
<Error | ||
Text="Allegro.DotnetSdk requires .NET SDK v8.0.100+ to be used, but $(NETCoreSdkVersion) was found." | ||
Condition="$([MSBuild]::VersionLessThan('$(NETCoreSdkVersion)', '8.0'))" /> | ||
</Target> | ||
|
||
<!-- | ||
According to https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2022#import-order, | ||
Directory.Build.props is imported very early. If the global using System.Net.Http | ||
is added by some file that is imported later, then the Remove in Directory.Build.props | ||
cannot affect the item that does not exist yet. It'd work better | ||
in Directory.Build.targets. | ||
More: https://stackoverflow.com/questions/52866794/why-doesnt-directory-build-props-work-when-building-a-solution-using-visual-stu | ||
--> | ||
<ItemGroup Label="ImplicitUsings additional removes"> | ||
<Using Remove="Microsoft.Extensions.Logging" /> | ||
<Using Remove="System.Net.Http" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.