Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
Move a bunch of files around to match the Library.Template
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Oct 31, 2022
1 parent 4185a16 commit 3db06b3
Show file tree
Hide file tree
Showing 134 changed files with 401 additions and 574 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,14 @@ dotnet_diagnostic.SA1130.severity = silent
dotnet_diagnostic.IDE1006.severity = none

dotnet_diagnostic.DOC100.severity = silent
dotnet_diagnostic.DOC104.severity = warning
dotnet_diagnostic.DOC104.severity = silent # TODO: promote to warning
dotnet_diagnostic.DOC105.severity = warning
dotnet_diagnostic.DOC106.severity = warning
dotnet_diagnostic.DOC107.severity = warning
dotnet_diagnostic.DOC108.severity = warning
dotnet_diagnostic.DOC200.severity = warning
dotnet_diagnostic.DOC202.severity = warning
dotnet_diagnostic.DOC207.severity = silent # TODO: promote to warning

[*.sln]
indent_style = tab
File renamed without changes.
46 changes: 9 additions & 37 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,21 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<RepoRootPath>$(MSBuildThisFileDirectory)</RepoRootPath>
<BaseIntermediateOutputPath>$(RepoRootPath)obj\$([MSBuild]::MakeRelative($(RepoRootPath), $(MSBuildProjectDirectory)))\</BaseIntermediateOutputPath>
<BaseOutputPath Condition=" '$(BaseOutputPath)' == '' ">$(RepoRootPath)bin\$(MSBuildProjectName)\</BaseOutputPath>
<PackageOutputPath>$(RepoRootPath)bin\Packages\$(Configuration)\</PackageOutputPath>
<BaseOutputPath Condition=" '$(BaseOutputPath)' == '' ">$(RepoRootPath)bin\</BaseOutputPath>
<PackageOutputPath>$(RepoRootPath)bin\$(Configuration)\Packages\</PackageOutputPath>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<AnalysisLevel>latest</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ProduceReferenceAssembly Condition=" '$(IsTestProject)' != 'true' ">true</ProduceReferenceAssembly>

<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
<IsCodeGenerationProject Condition=" $(MSBuildProjectName.Contains('CodeGeneration')) ">true</IsCodeGenerationProject>
<IsPInvokeProject Condition=" '$(IsTestProject)' != 'true' and '$(IsCodeGenerationProject)' != 'true' ">true</IsPInvokeProject>
<IsPackable Condition=" '$(IsTestProject)' == 'true' or '$(IsCodeGenerationProject)' == 'true' ">false</IsPackable>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>

<!-- https://github.com/dotnet/msbuild/blob/main/documentation/ProjectReference-Protocol.md#setplatform-negotiation -->
<EnableDynamicPlatformResolution>true</EnableDynamicPlatformResolution>
<EnableDynamicPlatformResolution>false</EnableDynamicPlatformResolution>

<!-- Opt in till https://github.com/NuGet/Home/issues/9803 makes this the default. -->
<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>
<RestoreUseStaticGraphEvaluation>false</RestoreUseStaticGraphEvaluation>

<!-- This entire repo has just one version.json file, so compute the version once and share with all projects in a large build. -->
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
Expand Down Expand Up @@ -59,32 +54,24 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.119" PrivateAssets="all" />
<PackageReference Include="Nullable" Version="1.3.1" PrivateAssets="all" />
<!-- Use the Unstable package ID so that update tools will help us keep it current even though it seems to be ever-unstable lately. -->
<PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.435" PrivateAssets="all" />
<PackageReference Include="CSharpIsNullAnalyzer" Version="0.1.329" PrivateAssets="all" />
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition=" '$(IsCodeGenerationProject)' != 'true' ">
<ProjectReference Include="..\CodeGenerationAttributes\CodeGenerationAttributes.csproj" PrivateAssets="all">
<ProjectReference Include="$(RepoRootPath)src\CodeGenerationAttributes\CodeGenerationAttributes.csproj" PrivateAssets="all">
<Private>false</Private>
<OutputItemType>Analyzer</OutputItemType>
</ProjectReference>
<ProjectReference Include="..\CodeGeneration\CodeGeneration.csproj">
<ProjectReference Include="$(RepoRootPath)src\CodeGeneration\CodeGeneration.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>Analyzer</OutputItemType>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<UndefineProperties>TargetFramework</UndefineProperties>
<Private>false</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup Condition=" '$(IsTestProject)' == 'true' ">
<PackageReference Include="coverlet.msbuild" Version="3.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
Expand All @@ -95,21 +82,6 @@
<AssemblyName>PInvoke.$(MSBuildProjectName)</AssemblyName>
</PropertyGroup>

<PropertyGroup Condition=" '$(IsTestProject)' == 'true' ">
<OutputPath>$(RepoRootPath)bin\$(Configuration)\tests\$(MSBuildProjectName)\</OutputPath>
<RootNamespace />
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)PInvoke.Tests.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemDefinitionGroup>
<!-- We build all libraries to a common directory, so avoid trying to copy P2P refs to the directory
to avoid wasting time with file collisions and build warnings. -->
<ProjectReference Condition=" '$(IsTestProject)' != 'true' ">
<!-- Sadly, enabling this optimization breaks loading the assembly later for exporting p/invoke method coverage. -->
<!-- <Private>false</Private> -->
</ProjectReference>
</ItemDefinitionGroup>

<ItemGroup>
<GeneratorAssemblySearchPaths Include="$(RepoRootPath)bin\$(Configuration)\netstandard2.0\" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)../stylecop.json"/>
Expand Down
5 changes: 0 additions & 5 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
</PropertyGroup>

<PropertyGroup>
<RootNamespace Condition=" '$(IsTestProject)' == 'true' " />
<ExcludeStoreBannedAPIs Condition=" ('$(TargetPlatformIdentifier)' == 'Windows' or '$(TargetPlatformIdentifier)' == 'UAP') and '$(TargetPlatformVersion)' >= 8.0 ">true</ExcludeStoreBannedAPIs>
<DefineConstants Condition=" '$(ExcludeStoreBannedAPIs)' != 'true' ">$(DefineConstants);IncludeStoreBannedAPIs</DefineConstants>
<DefineConstants Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' or ('$(TargetFrameworkIdentifier)' == '.NETStandard' and '$(_TargetFrameworkVersionWithoutV)' >= 2.0) ">$(DefineConstants);Serialization</DefineConstants>
Expand All @@ -18,8 +17,6 @@
<ItemGroup>
<Compile Remove="storebanned\**" Condition=" '$(ExcludeStoreBannedAPIs)' == 'true' " />
<Compile Remove="**" Condition=" '$(ExcludeStoreBannedAPIs)' == 'true' and '$(StoreBanned)' == 'true' " />
<Compile Include="$(MSBuildThisFileDirectory)AssemblyAttributes.cs" Condition=" '$(IsPInvokeProject)' == 'true' " />
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup Condition=" '$(IsPInvokeProject)' == 'true' and '$(MSBuildProjectName)' != 'Win32' and '$(TargetFramework)' == 'net45' ">
Expand All @@ -28,8 +25,6 @@
<AdditionalFiles Include="PublicAPI.Unshipped.txt" />
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)PInvoke.Extra.targets" Condition=" '$(IsTestProject)' != 'true' and '$(IsCodeGenerationProject)' != 'true' "/>

<!-- Workaround win8 .targets defining a target that should be blank (https://github.com/dotnet/sdk/issues/2517) -->
<Target Name="GetPackagingOutputs" />

Expand Down
Loading

0 comments on commit 3db06b3

Please sign in to comment.