-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.props
93 lines (93 loc) · 6.3 KB
/
Directory.Build.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<Project>
<PropertyGroup>
<!--
Try to stop Visual Studio TypeScript compilation.
It's not easy :-(. See here. https://developercommunity.visualstudio.com/t/disable-typescriptjavascript-parsing-on-projectsol/354713
-->
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptNoEmitOnError>true</TypeScriptNoEmitOnError>
<TypeScriptNoImplicitReturns>true</TypeScriptNoImplicitReturns>
</PropertyGroup>
<!--<BasicDefinitions>: provides simple and useful definitions.-->
<PropertyGroup>
<!-- See https://www.meziantou.net/csharp-compiler-strict-mode.htm -->
<Features>strict</Features>
<!-- Nullable Reference Type is not an option. -->
<Nullable>enable</Nullable>
<!-- Simple IsTestProject and IsInTestsFolder variables. -->
<IsTestProject Condition=" '$(IsTestProject)' == '' And $(MSBuildProjectName.EndsWith('.Tests'))">true</IsTestProject>
<IsInTestsFolder Condition="$(MSBuildProjectDirectory.Contains('\Tests\')) Or $(MSBuildProjectDirectory.Contains('/Tests/'))">true</IsInTestsFolder>
<!-- SolutionDir is defined by Visual Studio, we unify the behavior here. -->
<SolutionDir Condition=" '$(SolutionDir)' == '' ">$([System.IO.Path]::GetDirectoryName($(MSBuildThisFileDirectory)))/</SolutionDir>
<!-- CakeBuild drives the standard ContinuousIntegrationBuild that is used. -->
<ContinuousIntegrationBuild Condition=" '$(CakeBuild)' == 'true' ">true</ContinuousIntegrationBuild>
<!-- InformationalVersion is either the Zero version or provided by the CodeCakeBuilder when in CI build). -->
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<!-- Includes the .pdb in package. -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<SourceRoot Include="$(SolutionDir)" />
</ItemGroup>
<!--</BasicDefinitions>-->
<!--<StandardProperties>-->
<PropertyGroup>
<RepositoryUrl>https://github.com/signature-opensource/CK-TypeScript</RepositoryUrl>
<ProductName>CK</ProductName>
<Company>Signature Code</Company>
<Authors>Signature Code</Authors>
<Copyright>Copyright Signature-Code 2007-$([System.DateTime]::UtcNow.ToString("yyyy"))</Copyright>
<!--Removes annoying Pack warning: The package version ... uses SemVer 2.0.0 or components of SemVer 1.0.0 that are not supported on legacy clients...-->
<NoWarn>NU5105</NoWarn>
<!--Considering .net6 'global using' to be an opt-in (simply reproduce this with 'enable' in the csproj if needed).-->
<ImplicitUsings>disable</ImplicitUsings>
<!--Nullable Reference Type should always be used!-->
<Nullable>enable</Nullable>
<!--Nullable Reference Type should always be used!-->
<PackageIcon>PackageIcon.png</PackageIcon>
<AssemblyOriginatorKeyFile>$(SolutionDir)Common/SharedKey.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
</PropertyGroup>
<ItemGroup>
<None Include="$(SolutionDir)Common/PackageIcon.png" Pack="true" PackagePath="\" Visible="false" />
</ItemGroup>
<!--</StandardProperties>-->
<!--<ZeroVersion>: When not building from the CI, assemblies always use the ZeroVersion (see CSemVer.InformationalVersion).-->
<PropertyGroup Condition=" '$(ContinuousIntegrationBuild)' != 'true' ">
<Version>0.0.0-0</Version>
<AssemblyVersion>0.0.0</AssemblyVersion>
<FileVersion>0.0.0.0</FileVersion>
<InformationalVersion>0.0.0-0/0000000000000000000000000000000000000000/0001-01-01 00:00:00Z</InformationalVersion>
</PropertyGroup>
<!--</ZeroVersion>-->
<!--<GenerateDocumentation>: When in IsInTestsFolder and in Release or during ContinuousIntegrationBuild builds. Each project can override GenerateDocumentationFile property. -->
<PropertyGroup Condition=" '$(GenerateDocumentationFile)' == '' And '$(IsInTestsFolder)' != 'true' And ('$(ContinuousIntegrationBuild)' == 'true' Or '$(Configuration)' == 'Release') ">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<!--</GenerateDocumentation>-->
<!--<Analyzers>: This analyzer provides very welcome guidelines about async and threading issues.-->
<ItemGroup Condition=" '$(MSBuildProjectName)' != 'CodeCakeBuilder' ">
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19" PrivateAssets="All" IncludeAssets="runtime;build;native;contentfiles;analyzers" />
</ItemGroup>
<!--</Analyzers>-->
<!--<ReproducibleBuilds>-->
<!--Enable Deterministic build. https://github.com/dotnet/reproducible-builds. SourceLink is automatically managed by this package.-->
<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.25" PrivateAssets="All" />
</ItemGroup>
<!--Guaranty that the build is isolated. https://github.com/dotnet/reproducible-builds#dotnetreproduciblebuildsisolated-documentation-and-nuget-package-->
<Sdk Name="DotNet.ReproducibleBuilds.Isolated" Version="1.2.25" />
<!--</ReproducibleBuilds>-->
<!--<_CopyXmlDocFiles>:
It's a mess... See https://github.com/dotnet/sdk/issues/1458#issuecomment-695119194
This solution works and filters out System and Microsoft packages.
Not sure the .Net 7 solution will enable this: see https://github.com/dotnet/sdk/issues/1458#issuecomment-1265262224-->
<Target Name="_CopyXmlDocFiles" AfterTargets="ResolveReferences" Condition=" '$(MSBuildProjectName)' != 'CodeCakeBuilder' ">
<ItemGroup>
<XmlDocFiles Include="@(ReferencePath->'%(RootDir)%(Directory)%(Filename).xml')" Condition="!( $([System.String]::new('%(FileName)').StartsWith('System.')) Or $([System.String]::new('%(FileName)').StartsWith('Microsoft.')) Or $([System.String]::new('%(FileName)').StartsWith('CommunityToolkit.')) Or '%(FileName)' == 'netstandard' )" />
</ItemGroup>
<Copy SourceFiles="@(XmlDocFiles)" Condition="Exists('%(FullPath)')" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
</Target>
<!--</_CopyXmlDocFiles>-->
</Project>