forked from dotnet/Open-XML-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
89 lines (71 loc) · 4.79 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
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!--
Since this project supports multiple configurations which don't all have the same surface area, the following define
constants are used to conditionally compile features:
FEATURE_ABSTRACT_XML_CLOSE : XmlWriter.Close is defined as abstract
FEATURE_ARRAY_EMPTY : Array.Empty exists
FEATURE_CLOSE : Stream.Close is available in the platform
FEATURE_PACKAGE_FLUSH : System.IO.Package.Flush will correctly flush all data
FEATURE_CONCURRENT_COLLECTIONS : Concurrent collections are not available
FEATURE_SERIALIZATION : Serialization using ISerializable is in the platform
FEAUTRE_SPAN : Span<> and friends are available
FEATURE_SCHEMA_GENERATOR : Provides access to helpers to generate schema information
FEATURE_SYSTEMEXCEPTION : SytemException is available in the platform
FEATURE_XML_DISPOSE_PROTECTED : XmlWriter.Dispose is protected
FEATURE_XML_PROHIBIT_DTD : XML settings only has ProhibitDtd property
FEATURE_XML_QUOTECHAR : XmlReader.QuoteChar is an abstract member
FEATURE_XML_SCHEMA : XML Schema is available in the platform
-->
<PropertyGroup Condition=" '$(TargetFramework)' == 'net35' ">
<DefineConstants>$(DefineConstants);FEATURE_PACKAGE_FLUSH;FEATURE_XML_PROHIBIT_DTD</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net35' OR '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net452' ">
<DefineConstants>$(DefineConstants);FEATURE_ABSTRACT_XML_CLOSE;FEATURE_CLOSE;FEATURE_PACKAGE_FLUSH;FEATURE_SERIALIZATION;FEATURE_SYSTEMEXCEPTION;FEATURE_XML_DISPOSE_PROTECTED;FEATURE_XML_QUOTECHAR;FEATURE_XML_SCHEMA</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net452' ">
<DefineConstants>$(DefineConstants);FEATURE_CONCURRENT_COLLECTIONS;FEATURE_CANCELLATION_TOKEN</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' OR '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net46' OR '$(TargetFramework)' == 'net5.0' ">
<DefineConstants> $(DefineConstants);FEATURE_ARRAY_EMPTY;FEATURE_CONCURRENT_COLLECTIONS;FEATURE_CANCELLATION_TOKEN</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net46' OR '$(TargetFramework)' == 'netcoreapp2.1' OR '$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'net5.0' ">
<DefineConstants>$(DefineConstants);FEATURE_ABSTRACT_XML_CLOSE;FEATURE_CLOSE;FEATURE_SCHEMA_GENERATOR;FEATURE_SERIALIZATION;FEATURE_SYSTEMEXCEPTION;FEATURE_XML_QUOTECHAR;FEATURE_XML_SCHEMA;FEATURE_CANCELLATION_TOKEN</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net46' ">
<DefineConstants>$(DefineConstants);FEATURE_PACKAGE_FLUSH</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<DefineConstants>$(DefineConstants);FEATURE_SPAN</DefineConstants>
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\stylecop.json" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.321">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<!-- The tool is used by default, but we don't want it to. It must be set in a target to ensure it is not overridden -->
<Target Name="BeforeResGen" Condition=" '$(TargetFramework)' == 'net35' ">
<PropertyGroup>
<ResGenExecuteAsTool>false</ResGenExecuteAsTool>
</PropertyGroup>
</Target>
<PropertyGroup>
<IncludeFrameworkShims Condition=" '$(IncludeFrameworkShims)' == '' ">false</IncludeFrameworkShims>
</PropertyGroup>
<Import Condition="$(IncludeFrameworkShims)" Project="$(MSBuildThisFileDirectory)src\common\FrameworkShims.targets" />
<Import Condition="$(IncludeSourceGenerator)" Project="$(MSBuildThisFileDirectory)gen\DocumentFormat.OpenXml.Generator\SourceGenerator.targets"/>
<PropertyGroup>
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\$(Configuration)\packages\</PackageOutputPath>
<PackageOutputPath Condition="$(IsShipped)">$(PackageOutputPath)shipping\</PackageOutputPath>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' OR $(TargetFramework.StartsWith('net4'))">
<Reference Include="WindowsBase" />
</ItemGroup>
</Project>