This repository has been archived by the owner on Sep 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDirectory.Build.targets
128 lines (99 loc) · 5.8 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright (c) Teroneko.
Licensed under the MIT license. See LICENSE file in the project root for full license information.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Condition="'$(IsMSBuildFileImported)' != 'true'" Project="$([MSBuild]::GetPathOfFileAbove(.msbuild))" />
<Import Condition="'$(IsTeronisDotNetCorePropsFileImported)' != 'true'" Project="$(RootCorePropsPath)" />
<Import Project="$(TeronisMSBuildPackagingProjectBuildInPackageTargetsFile)" />
<Import Project="$(TeronisMSBuildPackagingPackTargetsFile)" Condition="Exists($(TeronisMSBuildPackagingPackTargetsFile))" />
<!-- GIT_VERSION_CACHE: Replacement for GitVersion because it had some lock file issues. -->
<Import Project="$(TeronisMSBuildPackagingGitVersionCachePropsFile)"
Condition="Exists('$(TeronisMSBuildPackagingGitVersionCachePropsFile)')
And '$(IsGitVersionCacheRelated)' != 'true'
And '$(DisableGitVersionCache)' != 'true'" />
<!-- This gets overriden if below import exists. -->
<Target Name="GetVersionCache" />
<Import Project="$(TeronisMSBuildPackagingGitVersionCacheTargetsFile)"
Condition="Exists('$(TeronisMSBuildPackagingGitVersionCacheTargetsFile)')
And '$(IsGitVersionCacheRelated)' != 'true'
And '$(DisableGitVersionCache)' != 'true'" />
<!-- <ItemGroup>
<PackageReference Include="Nullable" Version="1.3.0"
Condition="'$(NullableWorkaround)' != 'disable' And '$(Nullable)' == 'enable' And ('$(TargetFramework)' == 'netstandard2.0'
Or '$(TargetFramework)' == 'netstandard2.1'
Or '$(TargetFramework)' == 'netstandard2.2')">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup> -->
<PropertyGroup>
<PackageDescription Condition="'$(PackageDescription)' == '' And '$(Description)' != ''">$(Description)</PackageDescription>
</PropertyGroup>
<PropertyGroup>
<!--
We get these errors, because the .NET Core 2.0 implementation/interfaces are not decorated with nullability attributes and somehow the analyzer/compiler just checks nullability
because of pure existence of such attribtues.
-->
<!-- Warning CS8767 Nullability of reference types in type of parameter '..' of '..' doesn't match implicitly implemented member '..' (possibly because of nullability attributes). -->
<!-- Warning CS8769 Nullability of reference types in type of parameter '..' doesn't match implemented member '..' (possibly because of nullability attributes). -->
<!-- Warning CS0436 -->
<NoWarn Condition="'$(TargetFramework)' == 'netstandard2.0'">$(NoWarn);CS8767;CS8769;0436</NoWarn>
<!-- Warning CS1591 Missing XML comment for publicly visible type or member '<name>' -->
<!-- TODO: Well.. Write XML comments... -->
<NoWarn>1591</NoWarn>
</PropertyGroup>
<!-- LINKS SOURCE CODE TO CODE UPLOADED TO GITHUB -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0"
PrivateAssets="All"
Conditions="'$(DisableGitVersionCache)' != 'true' And $(IsPackable)" />
</ItemGroup>
<ItemGroup>
<_ProjectReferences Include="@(ProjectReference)">
<!-- Prevent *Publish.*-projects from being tracked in *.nuspec files. -->
<IsPublishProject>false</IsPublishProject>
<IsPublishProject Condition="$([System.String]::Copy('%(Filename)').Contains('~ExecutablePublish'))
Or $([System.String]::Copy('%(Filename)').Contains('~DependencyPublish'))">true</IsPublishProject>
<ReferenceOutputAssembly Condition="'%(IsPublishProject)' == 'true'">false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties Condition="'%(IsPublishProject)' == 'true'">true</SkipGetTargetFrameworkProperties>
<GlobalPropertiesToRemove Condition="'%(IsPublishProject)' == 'true'">TargetFramework</GlobalPropertiesToRemove>
<BuildProjectReferences Condition="'%(IsPublishProject)' == 'true'">false</BuildProjectReferences>
<SetTargetFramework Condition="'%(SetTargetFramework)' == '' And (
'%(Filename)' == 'Teronis.NetStandard.Core'
Or '%(Filename)' == 'Teronis.NetStandard.Collections'
Or '%(Filename)' == 'Teronis.NetStandard.Collections.Algorithms')">TargetFramework=$(TargetFramework)</SetTargetFramework>
</_ProjectReferences>
<ProjectReference Remove="@(ProjectReference)" />
<ProjectReference Include="@(_ProjectReferences)" />
</ItemGroup>
<Target Name="_DirectoryBuildBeforeClean" BeforeTargets="BeforeClean">
<PropertyGroup>
<DisableGitVersionCache>true</DisableGitVersionCache>
</PropertyGroup>
</Target>
<Target Name="_DirectoryBuildAfterClean" BeforeTargets="AfterClean">
<PropertyGroup>
<DisableGitVersionCache>false</DisableGitVersionCache>
</PropertyGroup>
</Target>
<Target Name="AfterUnpackAsExecutablePackedProject" BeforeTargets="PackSourceWhenPackingPublishTypedProject">
<PropertyGroup>
<DisableGitVersionCache>true</DisableGitVersionCache>
</PropertyGroup>
</Target>
<Target Name="AfterUnpackAsExecutablePackedProject" AfterTargets="PackSourceWhenPackingPublishTypedProject">
<PropertyGroup>
<DisableGitVersionCache>false</DisableGitVersionCache>
</PropertyGroup>
</Target>
<!--
================================================================
GetVersionCacheWhenGettingPackageTypedExecutableSourceProperties
Invokes GetVersionCache, so its evaluation is regarded when
packing executable source project.
================================================================
-->
<Target Name="GetVersionCacheWhenGettingPackageTypedExecutableSourceProperties" DependsOnTargets="GetVersionCache" Condition="'$(ParentIsExecutablePackageTyped)' == 'true'" />
</Project>