-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDirectory.Build.targets
105 lines (92 loc) · 6.5 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
<Project>
<PropertyGroup>
<IsSourceProject Condition="'$(IsSourceProject)' == '' and
'$(IsTestProject)' != 'true' and
'$(IsTestUtilityProject)' != 'true'">true</IsSourceProject>
</PropertyGroup>
<Import Project="$(RepositoryEngineeringDir)overrideispackable.targets" Condition="'$(OverrideIsPackableForNonSourceProjects)' == 'true' and '$(IsSourceProject)' != 'true'" />
<Import Project="$(RepositoryEngineeringDir)resources.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="$(RepositoryEngineeringDir)testing\runsettings.targets" Condition="'$(IsTestProject)' == 'true'" />
<Import Project="$(RepositoryEngineeringDir)placeholderpackaging.targets" Condition="'$(IsPlaceholderTargetFramework)' == 'true' and '$(IsCrossTargetingBuild)' != 'true'" />
<Import Project="$(RepositoryEngineeringDir)packaging.targets" Condition="'$(IsPackable)' == 'true'" />
<PropertyGroup>
<!-- Libraries have never generated these attributes so don't let the SDK generate them. -->
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
<!-- Default item exclude patterns -->
<DefaultExcludesInProjectFolder Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">$(DefaultExcludesInProjectFolder);**/*.net$(DefaultLanguageSourceExtension)</DefaultExcludesInProjectFolder>
<DefaultExcludesInProjectFolder Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">$(DefaultExcludesInProjectFolder);**/*.netframework$(DefaultLanguageSourceExtension)</DefaultExcludesInProjectFolder>
</PropertyGroup>
<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
<!-- Suppress "CS1591 - Missing XML comment for publicly visible type or member" in tests. -->
<NoWarn>$(NoWarn);CS1573</NoWarn>
<!-- Don't run .NET Framework only tests on non Windows. -->
<SkipTests Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(OS)' != 'Windows_NT'">true</SkipTests>
<!-- Make sure the target platform identifier matches the OS for running tests. -->
<SkipTests Condition="'$(TargetPlatformIdentifier)' == 'windows' and '$(OS)' != 'Windows_NT'">true</SkipTests>
<SkipTests Condition="'$(TargetPlatformIdentifier)' == 'unix' and '$(OS)' == 'Windows_NT'">true</SkipTests>
<!-- Unsafe code is required by PlatformDetection. -->
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(IsSourceProject)' == 'true'">
<XmlDocumentationFilePath>$(MSBuildProjectDirectory)\$(AssemblyName).xml</XmlDocumentationFilePath>
<CLSCompliant Condition="'$(CLSCompliant)' == '' and '$(MSBuildProjectExtension)' != '.ilproj'">true</CLSCompliant>
<Description Condition="'$(Description)' == ''">$(AssemblyName)</Description>
<PackageDescription Condition="'$(PackageDescription)' == ''">$(AssemblyName)</PackageDescription>
</PropertyGroup>
<!-- The VSTest target is not bound by any conditions, needs to be overriden when we want to skip tests. -->
<Import Project="$(RepositoryEngineeringDir)testing\skiptests.targets" Condition="'$(IsTestProject)' == 'true' and '$(SkipTests)' == 'true'" />
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<Compile Include="$(CommonPath)tests\TestUtilities\System\AssertExtensions.cs" Link="Common\System\AssertExtensions.cs" />
<Compile Include="$(CommonPath)tests\TestUtilities\System\PlatformDetection.cs" Link="Common\System\PlatformDetection.cs" />
<Compile Include="$(CommonPath)src\Interop\Interop.Libraries.cs" Link="Common\Interop\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)src\Interop\NtDll\Interop.RtlGetVersion.cs" Link="Common\Interop\NtDll\Interop.RtlGetVersion.cs" />
</ItemGroup>
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="Microsoft.DotNet.RemoteExecutor" />
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" />
</ItemGroup>
<ItemGroup Condition="'$(IsSourceProject)' == 'true'">
<!-- Ensures docs xmls get copied to the artifacts bin output folder. -->
<None Include="$(XmlDocumentationFilePath)" CopyToOutputDirectory="PreserveNewest" Condition="'$(GenerateDocumentationFile)' == 'false'" />
<AssemblyAttribute Include="System.CLSCompliantAttribute" Condition="'$(CLSCompliant)' == 'true'">
<_Parameter1>true</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyDefaultAliasAttribute">
<_Parameter1>$(AssemblyName)</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Resources.NeutralResourcesLanguage" Condition="'@(EmbeddedResource)' != ''">
<_Parameter1>en-US</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute" Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<_Parameter1>System.Runtime.InteropServices.DllImportSearchPath.AssemblyDirectory | System.Runtime.InteropServices.DllImportSearchPath.System32</_Parameter1>
<_Parameter1_IsLiteral>true</_Parameter1_IsLiteral>
</AssemblyAttribute>
<AssemblyMetadata Include="IsTrimmable" Condition="'$(SetIsTrimmable)' == 'true'">
<Value>True</Value>
</AssemblyMetadata>
<AssemblyMetadata Include="PreferInbox">
<Value>True</Value>
</AssemblyMetadata>
<AssemblyMetadata Include="Serviceable">
<Value>True</Value>
</AssemblyMetadata>
</ItemGroup>
<!-- The Default behavior in VS is to show files for the first target framework in TargetFrameworks property.
This is required to show all the files corresponding to all target frameworks in VS.
https://github.com/dotnet/project-system/issues/935 -->
<ItemGroup Condition="'$(DefaultLanguageSourceExtension)' != '' and
('$(BuildingInsideVisualStudio)' == 'true' or '$(DesignTimeBuild)' == 'true')">
<None Include="$(MSBuildProjectDirectory)\**\*$(DefaultLanguageSourceExtension)"
Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder);@(Compile)" />
</ItemGroup>
<!-- Include docs xmls in the final packages. -->
<Target Name="AddDocumentationFileForPackaging"
AfterTargets="DocumentationProjectOutputGroup"
Condition="'$(GenerateDocumentationFile)' == 'false'">
<ItemGroup>
<DocumentationProjectOutputGroupOutput Include="$(XmlDocumentationFilePath)" />
</ItemGroup>
</Target>
</Project>