This repository has been archived by the owner on Mar 28, 2024. It is now read-only.
forked from OpenXmlDev/Open-Xml-PowerTools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Directory.Build.props
104 lines (94 loc) · 4.22 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
94
95
96
97
98
99
100
101
102
103
104
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<NoWarn>$(NoWarn);SA0001;NU5048</NoWarn>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<!--
The following values for ProjectLoadStyle are supported:
- netstandard2_0: .NET Standard 2.0
- net461: .NET Framework 4.6.1
- All: Will build for all platforms
The choice of targeting .NET Standard 2.0 and .NET Framework 4.6.1 is based on Microsoft's
recommendations regarding cross-platform targeting:
- DO start with including a netstandard2.0 target
- CONSIDER adding a target for net461 when you're offering a netstandard2.0 target.
See https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/cross-platform-targeting
-->
<ProjectLoadStyle Condition=" '$(ProjectLoadStyle)' == '' ">net461</ProjectLoadStyle>
<__InvalidProjectLoadStyle>false</__InvalidProjectLoadStyle>
</PropertyGroup>
<PropertyGroup>
<DocumentFormatOpenXmlVersion>2.14.0</DocumentFormatOpenXmlVersion>
<SystemDrawingCommonVersion>4.7.3</SystemDrawingCommonVersion>
<SystemIOPackagingVersion>4.7.0</SystemIOPackagingVersion>
</PropertyGroup>
<Choose>
<When Condition=" '$(ProjectLoadStyle)' == 'netstandard2_0' ">
<PropertyGroup>
<ProductTargetFrameworks>netstandard2.0</ProductTargetFrameworks>
<TestTargetFrameworks>net6.0</TestTargetFrameworks>
<SamplesFrameworks>net6.0</SamplesFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="$(DocumentFormatOpenXmlVersion)" />
</ItemGroup>
</When>
<When Condition=" '$(ProjectLoadStyle)' == 'net461' ">
<PropertyGroup>
<ProductTargetFrameworks>net461</ProductTargetFrameworks>
<TestTargetFrameworks>net462</TestTargetFrameworks>
<SamplesFrameworks>net461</SamplesFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="$(DocumentFormatOpenXmlVersion)" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
</When>
<When Condition=" '$(ProjectLoadStyle)' == 'All' ">
<PropertyGroup>
<!--
.NET Standard target must be first to avoid a ResXFileCodeGenerator issue
(tracked at https://github.com/dotnet/project-system/issues/1519)
-->
<ProductTargetFrameworks>netstandard2.0;net461</ProductTargetFrameworks>
<TestTargetFrameworks>net462;net6.0</TestTargetFrameworks>
<SamplesFrameworks>net461;net6.0</SamplesFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="$(DocumentFormatOpenXmlVersion)" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
</When>
<Otherwise>
<PropertyGroup>
<ProductTargetFrameworks>netstandard2.0</ProductTargetFrameworks>
<TestTargetFrameworks>net6.0</TestTargetFrameworks>
<SamplesFrameworks>net6.0</SamplesFrameworks>
<__InvalidProjectLoadStyle>true</__InvalidProjectLoadStyle>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="$(DocumentFormatOpenXmlVersion)" />
</ItemGroup>
</Otherwise>
</Choose>
<Target Name="UnknownProjectLoadStyle" BeforeTargets="Build" Condition="$(__InvalidProjectLoadStyle)">
<Warning Text="Unknown ProjectLoadStyle '$(ProjectLoadStyle)' set. Please verify settings in Directory.Build.props and environment variables to a known value. For now, default values will be used." />
</Target>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)\rules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
</Project>