Repository navigation
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
102 lines (97 loc) · 6.03 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
102 lines (97 loc) · 6.03 KB
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
<Project>
<PropertyGroup>
<PackageOutputPath>$(MSBuildThisFileDirectory).nuget</PackageOutputPath>
</PropertyGroup>
<!--
Version for every iNKORE.UI.WPF PackageReference that doesn't state one; the nuspec dependencies follow it too.
Bump it here, not through the NuGet UI: a Version written into a csproj takes precedence over this one.
Has to live here rather than in Directory.Build.props: Update only sees items the project has already included.
-->
<ItemGroup>
<PackageReference Update="iNKORE.UI.WPF">
<Version Condition="'%(Version)' == ''">1.2.8</Version>
</PackageReference>
</ItemGroup>
<!--
Projects that hand-write their assembly attributes (GenerateAssemblyInfo=false) opt in with
GenerateVersionAttributes=true to get the version attributes from $(Version) instead.
-->
<Target Name="_GenerateVersionAttributes" BeforeTargets="CoreCompile" DependsOnTargets="GetAssemblyVersion"
Condition="'$(GenerateVersionAttributes)' == 'true'">
<PropertyGroup>
<_VersionAttributesFile>$(IntermediateOutputPath)$(AssemblyName).VersionInfo.g.cs</_VersionAttributesFile>
</PropertyGroup>
<ItemGroup>
<_VersionAttributesLine Include="[assembly: System.Reflection.AssemblyVersion("$(AssemblyVersion)")]" />
<_VersionAttributesLine Include="[assembly: System.Reflection.AssemblyFileVersion("$(AssemblyVersion)")]" />
<_VersionAttributesLine Include="[assembly: System.Reflection.AssemblyInformationalVersion("$(Version)")]" />
</ItemGroup>
<!-- WriteOnlyWhenDifferent keeps the timestamp, so an unchanged version doesn't force a recompile. -->
<WriteLinesToFile File="$(_VersionAttributesFile)" Lines="@(_VersionAttributesLine)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<ItemGroup>
<Compile Include="$(_VersionAttributesFile)" />
<FileWrites Include="$(_VersionAttributesFile)" />
</ItemGroup>
</Target>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<Optimize>True</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '4.6.1')) or
'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<DefineConstants>$(DefineConstants);NET461_OR_NEWER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '4.6.2')) or
'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<DefineConstants>$(DefineConstants);NET462_OR_NEWER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '4.7')) or
'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<DefineConstants>$(DefineConstants);NET47_OR_NEWER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '4.7.2')) or
'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<DefineConstants>$(DefineConstants);NET472_OR_NEWER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '4.8')) or
'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<DefineConstants>$(DefineConstants);NET48_OR_NEWER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '5.0'))">
<DefineConstants>$(DefineConstants);NET5_0_OR_NEWER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(SupportedOSPlatform)' != '' and $([MSBuild]::VersionGreaterThan($(SupportedOSPlatform), '7.0'))">
<SupportedOSPlatform>7.0</SupportedOSPlatform>
</PropertyGroup>
<Choose>
<When Condition="'$(UseWinRT)' == 'true'">
<Choose>
<When Condition="$(DefineConstants.Contains('NET5_0_OR_NEWER'))" />
<When Condition="$(DefineConstants.Contains('NET461_OR_NEWER'))">
<ItemGroup>
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.22621.755" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.7.0" />
<Reference Include="Windows">
<HintPath>$(MSBuildThisFileDirectory)libraries\Windows.WinMD</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
<Reference Include="Windows.Foundation.FoundationContract">
<HintPath>$(MSBuildThisFileDirectory)libraries\Windows.Foundation.FoundationContract.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
<Reference Include="Windows.Foundation.UniversalApiContract">
<HintPath>$(MSBuildThisFileDirectory)libraries\Windows.Foundation.UniversalApiContract.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
</ItemGroup>
</Otherwise>
</Choose>
</When>
</Choose>
</Project>