-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
pretest.proj
148 lines (133 loc) · 8.67 KB
/
pretest.proj
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<Project Sdk="Microsoft.Build.Traversal">
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />
<PropertyGroup Condition="'$(ContinuousIntegrationBuild)' != 'true'">
<!-- Create an intermediate runsettings file to enable VSTest discovery. -->
<EnableRunSettingsSupport>true</EnableRunSettingsSupport>
<CreateIntermediateRunSettingsFile>true</CreateIntermediateRunSettingsFile>
<CreateVsCodeRunSettingsFile>true</CreateVsCodeRunSettingsFile>
</PropertyGroup>
<PropertyGroup>
<IsPackable>false</IsPackable>
</PropertyGroup>
<!--
Explicitly build the externals.csproj project first to create the PlatformManifest for
the targeting and runtimepack before the test runners which consume that asset are built.
-->
<ItemGroup>
<ExternalsProject Include="externals.csproj" Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''" />
<ProjectReference Include="@(ExternalsProject)" Condition="'$(MSBuildRestoreSessionId)' != ''" />
<ProjectReference Include="$(CommonTestPath)AppleTestRunner\AppleTestRunner.csproj" Condition="'$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator'"/>
<ProjectReference Include="$(CommonTestPath)AndroidTestRunner\AndroidTestRunner.csproj" Condition="'$(TargetOS)' == 'Android'" />
<ProjectReference Include="$(CommonTestPath)WasmTestRunner\WasmTestRunner.csproj" Condition="'$(TargetOS)' == 'Browser'" />
<ProjectReference Include="$(MonoProjectRoot)wasm\symbolicator\WasmSymbolicator.csproj" Condition="'$(TargetOS)' == 'Browser'" />
<!-- needed to test workloads for wasm -->
<ProjectReference Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Runtime.sfxproj" Pack="true" Condition="'$(TargetOS)' == 'Browser'" />
</ItemGroup>
<Target Name="BuildExternalsProject"
BeforeTargets="Build">
<MSBuild Targets="Build"
Projects="@(ExternalsProject)"
Properties="$(TraversalGlobalProperties)" />
</Target>
<Target Name="CreateIntermediateRunSettingsFile"
DependsOnTargets="GenerateRunSettingsFile"
BeforeTargets="Build"
Condition="'$(CreateIntermediateRunSettingsFile)' == 'true'" />
<Target Name="GetSharedFrameworkRuntimeFiles">
<ItemGroup>
<ManualRuntimePackNativeFile Include="System.Security.Cryptography.Native.Android.so" />
<ManualRuntimePackNativeFile Include="System.Security.Cryptography.Native.OpenSsl.so" />
<ManualRuntimePackNativeFile Include="System.Security.Cryptography.Native.Apple.dylib" />
<ManualRuntimePackNativeFile Include="System.Security.Cryptography.Native.OpenSsl.dylib" />
<SharedFrameworkRuntimeFile Include="$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)*;
$(MicrosoftNetCoreAppRuntimePackNativeDir)*;
@(ManualRuntimePackNativeFile->'$(MicrosoftNetCoreAppRuntimePackNativeDir)%(Identity)')"
TargetPath="runtimes/" />
</ItemGroup>
</Target>
<!-- Generate the runtime pack's PlatformManifest -->
<UsingTask TaskName="GenerateFileVersionProps" AssemblyFile="$(InstallerTasksAssemblyPath)"/>
<Target Name="GenerateFileVersionPropsRuntimePack"
DependsOnTargets="GetSharedFrameworkRuntimeFiles"
AfterTargets="BuildExternalsProject"
Inputs="@(SharedFrameworkRuntimeFile)"
Outputs="$(MicrosoftNetCoreAppRuntimePackDir)data\PlatformManifest.txt"
Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<GenerateFileVersionProps Files="@(SharedFrameworkRuntimeFile)"
PackageId="$(MicrosoftNetCoreAppFrameworkName).Runtime.$(PackageRID)"
PackageVersion="$(ProductVersion)"
PlatformManifestFile="$(MicrosoftNetCoreAppRuntimePackDir)data\PlatformManifest.txt"
PreferredPackages="$(MicrosoftNetCoreAppFrameworkName).Runtime.$(PackageRID)"
PermitDllAndExeFilesLackingFileVersion="true" />
</Target>
<!-- Generate the ref pack's PlatformManifest -->
<Target Name="GenerateFileVersionPropsRefPack"
DependsOnTargets="GetSharedFrameworkRuntimeFiles"
AfterTargets="BuildExternalsProject"
Inputs="@(SharedFrameworkRuntimeFile)"
Outputs="$(MicrosoftNetCoreAppRefPackDataDir)PlatformManifest.txt"
Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<GenerateFileVersionProps Files="@(SharedFrameworkRuntimeFile)"
PackageId="$(MicrosoftNetCoreAppFrameworkName).Ref"
PackageVersion="$(ProductVersion)"
PlatformManifestFile="$(MicrosoftNetCoreAppRefPackDataDir)PlatformManifest.txt"
PreferredPackages="$(MicrosoftNetCoreAppFrameworkName).Ref"
PermitDllAndExeFilesLackingFileVersion="true" />
</Target>
<!-- Generate the shared framework's deps.json -->
<UsingTask TaskName="GenerateTestSharedFrameworkDepsFile" AssemblyFile="$(InstallerTasksAssemblyPath)"/>
<Target Name="GenerateTestSharedFrameworkAssets"
AfterTargets="BuildExternalsProject"
Inputs="$(NetCoreAppCurrentTestHostSharedFrameworkPath)*.*"
Outputs="$(NetCoreAppCurrentTestHostSharedFrameworkPath)$(MicrosoftNetCoreAppFrameworkName).deps.json"
Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<!-- Shared framework deps file generation. Produces a test shared-framework deps file. -->
<GenerateTestSharedFrameworkDepsFile SharedFrameworkDirectory="$(NetCoreAppCurrentTestHostSharedFrameworkPath)"
RuntimeGraphFiles="$(RuntimeIdGraphDefinitionFile)"
TargetRuntimeIdentifier="$(PackageRID)" />
</Target>
<Target Name="GetRuntimePackFiles">
<ItemGroup>
<RuntimePackLibFile Include="$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)*.*">
<TargetPath>runtimes/$(PackageRID)/lib/$(NetCoreAppCurrent)</TargetPath>
</RuntimePackLibFile>
<RuntimePackNativeFile Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)*.*">
<TargetPath>runtimes/$(PackageRID)/native</TargetPath>
<IsNative>true</IsNative>
</RuntimePackNativeFile>
<!-- Clear the IsNative flag on System.Private.CoreLib given that it is present in native dir but it is actually managed -->
<RuntimePackNativeFile IsNative=""
Condition="'%(FileName)%(Extension)' == 'System.Private.CoreLib.dll'" />
</ItemGroup>
<!-- We need to set this metadata in a separate ItemGroup than when the Items are initially populated in order to
have access to the Extension metadata. -->
<ItemGroup>
<RuntimePackLibFile>
<IsSymbolFile Condition="'%(Extension)' == '.pdb'">true</IsSymbolFile>
</RuntimePackLibFile>
<RuntimePackNativeFile>
<IsSymbolFile Condition="'%(Extension)' == '.pdb'">true</IsSymbolFile>
</RuntimePackNativeFile>
</ItemGroup>
</Target>
<!-- Generate the runtime pack's RuntimeList.xml -->
<UsingTask TaskName="CreateFrameworkListFile" AssemblyFile="$(DotNetSharedFrameworkTaskFile)"/>
<Target Name="GenerateRuntimeListFile"
DependsOnTargets="GetRuntimePackFiles"
AfterTargets="BuildExternalsProject"
Inputs="@(RuntimePackLibFile);@(RuntimePackNativeFile)"
Outputs="$(MicrosoftNetCoreAppRuntimePackDir)data\RuntimeList.xml"
Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<ItemGroup>
<FrameworkListRootAttribute Include="Name" Value="$(NetCoreAppCurrentBrandName)" />
<FrameworkListRootAttribute Include="TargetFrameworkIdentifier" Value="$(NetCoreAppCurrentIdentifier)" />
<FrameworkListRootAttribute Include="TargetFrameworkVersion" Value="$(NetCoreAppCurrentVersion)" />
<FrameworkListRootAttribute Include="FrameworkName" Value="$(MicrosoftNetCoreAppFrameworkName)" />
</ItemGroup>
<CreateFrameworkListFile Files="@(RuntimePackLibFile);@(RuntimePackNativeFile)"
TargetFile="$(MicrosoftNetCoreAppRuntimePackDir)data\RuntimeList.xml"
TargetFilePrefixes="ref/;runtimes/"
RootAttributes="@(FrameworkListRootAttribute)" />
</Target>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />
</Project>