-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
63 lines (56 loc) · 2.63 KB
/
Directory.Build.targets
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
<Project>
<PropertyGroup>
<IsRetailAssembly>False</IsRetailAssembly>
<IsRetailAssembly Condition="$(MSBuildProjectName.StartsWith('Pitchfork.TypeParsing')) AND !$(MSBuildProjectName.EndsWith('.Tests'))">True</IsRetailAssembly>
</PropertyGroup>
<PropertyGroup Condition="$(IsRetailAssembly)">
<Version>$(RetailVersion)</Version>
<!-- Only modern .NET contains nullable annotations at the API surface; suppress all
downlevel warnings but allow our own annotations to be generated. -->
<Nullable>enable</Nullable>
<Nullable Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">annotations</Nullable>
<!-- other common settings -->
<HighEntropyVA>true</HighEntropyVA>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- assembly strong name signing -->
<SignAssembly>True</SignAssembly>
<ActualSigningKeyFile>$(MSBuildThisFileDirectory)IdentityKey.snk</ActualSigningKeyFile>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)IdentityPubKey.snk</AssemblyOriginatorKeyFile>
<DelaySign>True</DelaySign>
</PropertyGroup>
<Choose>
<When Condition="$(IsRetailAssembly) AND '$(Configuration)' == 'Release'">
<!-- package generation -->
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>levib</Authors>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/GrabYourPitchforks/Pitchfork.TypeParsing</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>(c) Levi Broderick</Copyright>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<ItemGroup >
<None Include="$(MSBuildThisFileDirectory)README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</When>
</Choose>
<!-- forbid referencing any version of Moq that's not 4.18.4 from tests -->
<Target Name="MoqCheck" AfterTargets="PostBuildEvent">
<Error Condition="'%(PackageReference.Identity)' == 'Moq' AND '%(PackageReference.Version)' != '4.18.4'"
Text="Unauthorized version of Moq (%(PackageReference.Version)) detected."></Error>
</Target>
<!-- assembly strong name signing -->
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="$(IsRetailAssembly)">
<GetFrameworkSdkPath>
<Output TaskParameter="Path" PropertyName="FrameworkSdkPath" />
</GetFrameworkSdkPath>
<Exec Command=""$(FrameworkSdkPath)\bin\NETFX 4.8 Tools\x64\sn.exe" -Ra "$(TargetPath)" "$(ActualSigningKeyFile)"" />
</Target>
</Project>