mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-11 02:13:38 +09:00

- Fixes https://github.com/dotnet/runtime/issues/98955 We will now produce a warning when a non-assembly-qualified type flows into a string location annotated with DynamicallyAccessedMembers, and we don't try to look up or mark the type (since we don't know which assemblies will be searched at runtime by the Type.GetType call). - Fixes https://github.com/dotnet/runtime/issues/103906 The ILLink intrinsic handling for `Type.GetType` will now look in corelib for generic arguments, matching native AOT. This replaces the existing warning IL2105. This uses a new warning instead of repurposing IL2105, because we already documented IL2105 and older versions of ILLink will produce it. Best to avoid any confusion about them.
151 lines
9.5 KiB
XML
151 lines
9.5 KiB
XML
<Project>
|
|
<PropertyGroup>
|
|
<!-- OutDir is not set early enough to set this property in .props file. -->
|
|
<BundleDir>$([MSBuild]::NormalizeDirectory('$(OutDir)', 'AppBundle'))</BundleDir>
|
|
<PublishDir Condition="'$(UseAppBundleRootForBuildingTests)' == 'true' and '$(IgnoreForCI)' != 'true' and '$(IsFunctionalTest)' != 'true'">$(AppBundleRoot)tests\$(AssemblyName)</PublishDir>
|
|
<PublishDir Condition="'$(UseAppBundleRootForBuildingTests)' == 'true' and '$(IgnoreForCI)' != 'true' and '$(IsFunctionalTest)' == 'true'">$(AppBundleRoot)runonly\$(AssemblyName)</PublishDir>
|
|
<BundleDir Condition="'$(UseAppBundleRootForBuildingTests)' == 'true' and '$(IgnoreForCI)' != 'true'">$([MSBuild]::NormalizeDirectory('$(PublishDir)', 'AppBundle'))</BundleDir>
|
|
<RunScriptOutputPath>$([MSBuild]::NormalizePath('$(BundleDir)', '$(RunScriptOutputName)'))</RunScriptOutputPath>
|
|
|
|
<PublishingTestsRun>true</PublishingTestsRun>
|
|
<PublishTestAsSelfContainedDependsOn Condition="'$(PublishTestAsSelfContainedDependsOn)' == ''">Publish</PublishTestAsSelfContainedDependsOn>
|
|
<PublishTestAsSelfContainedAfterTargets Condition="'$(PublishTestAsSelfContainedAfterTargets)' == ''">Build</PublishTestAsSelfContainedAfterTargets>
|
|
|
|
<SkipWorkloadsTestingTargetsImport Condition="'$(SkipWorkloadsTestingTargetsImport)' == ''">true</SkipWorkloadsTestingTargetsImport>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos'">
|
|
<RunAOTCompilation Condition="'$(RuntimeFlavor)' == 'Mono' ">true</RunAOTCompilation>
|
|
<UseNativeAOTRuntime Condition="'$(RuntimeFlavor)' == 'CoreCLR'">true</UseNativeAOTRuntime>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<DotnetPgoToolDir>$([MSBuild]::NormalizeDirectory('$(CoreCLRToolPath)', 'dotnet-pgo'))</DotnetPgoToolDir>
|
|
<DotnetPgoToolPath>$([MSBuild]::NormalizePath('$(DotnetPgoToolDir)', 'dotnet-pgo'))</DotnetPgoToolPath>
|
|
</PropertyGroup>
|
|
|
|
<!-- When tests are built on Helix, we don't want to invoke ILLink on build machines -->
|
|
<PropertyGroup Condition="'$(EnableAggressiveTrimming)' == 'true' and '$(BuildTestsOnHelix)' != 'true'">
|
|
<PublishTrimmed>true</PublishTrimmed>
|
|
<!-- Suppress trimming warnings as these are tests -->
|
|
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
|
|
<NoWarn>$(NoWarn);IL2103;IL2025;IL2111;IL2122</NoWarn>
|
|
|
|
<!-- Reduce library test app size by trimming framework library features -->
|
|
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' != 'Debug'">false</DebuggerSupport>
|
|
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
|
|
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
|
|
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
|
|
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">false</UseSystemResourceKeys>
|
|
<UseNativeHttpHandler Condition="'$(UseNativeHttpHandler)' == ''">false</UseNativeHttpHandler>
|
|
</PropertyGroup>
|
|
|
|
<!-- When trimming non-exe projects, root the whole intermediate assembly.
|
|
The SDK settings root only the entry point by default. These targets are used not only for standard
|
|
console apps, but also for test projects without an entry point. -->
|
|
<Target Name="RootEntireIntermediateAssembly" AfterTargets="PrepareForILLink" Condition="'$(OutputType)' != 'Exe'">
|
|
<ItemGroup>
|
|
<TrimmerRootAssembly Condition="'%(Identity)' == '@(IntermediateAssembly)'">
|
|
<RootMode>all</RootMode>
|
|
</TrimmerRootAssembly>
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<PropertyGroup>
|
|
<AdditionalXHarnessArguments Condition="'$(ExpectedExitCode)' != ''">$(AdditionalXHarnessArguments) --expected-exit-code $(ExpectedExitCode)</AdditionalXHarnessArguments>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<DiagnosticPorts Condition="'$(DiagnosticStartupMode)' != ''">$(DiagnosticPorts),$(DiagnosticStartupMode)</DiagnosticPorts>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(TargetOS)' == 'android'">
|
|
<!-- The -arg flag for xharness passes the arguments along to the instrumentation app -->
|
|
<AdditionalXHarnessArguments Condition="'$(XUnitMethodName)' != ''">$(AdditionalXHarnessArguments) --arg=-m=$(XUnitMethodName)</AdditionalXHarnessArguments>
|
|
<AdditionalXHarnessArguments Condition="'$(XUnitClassName)' != ''">$(AdditionalXHarnessArguments) --arg=-c=$(XUnitClassName)</AdditionalXHarnessArguments>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator'">
|
|
<!-- Pass the -m or -c flag along to the app bundle, note that due to the double hyphen this needs to be the last argument -->
|
|
<AdditionalXHarnessArguments Condition="'$(XUnitMethodName)' != ''">$(AdditionalXHarnessArguments) -- -m=$(XUnitMethodName)</AdditionalXHarnessArguments>
|
|
<AdditionalXHarnessArguments Condition="'$(XUnitClassName)' != ''">$(AdditionalXHarnessArguments) -- -c=$(XUnitClassName)</AdditionalXHarnessArguments>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup Condition="'$(XUnitUseRandomizedTestOrderer)' == 'true'">
|
|
<Compile Include="$(RepoRoot)src\libraries\Common\tests\Tests\RandomizedTestOrderAssemblyInfo.cs" />
|
|
</ItemGroup>
|
|
|
|
<Import Project="$(MSBuildThisFileDirectory)tests.android.targets"
|
|
Condition="'$(TargetOS)' == 'android'" />
|
|
<Import Project="$(MSBuildThisFileDirectory)tests.ioslike.targets"
|
|
Condition="'$(TargetsAppleMobile)' == 'true'" />
|
|
<Import Project="$(MSBuildThisFileDirectory)tests.browser.targets"
|
|
Condition="'$(TargetOS)' == 'browser'" />
|
|
<Import Project="$(MSBuildThisFileDirectory)tests.wasi.targets"
|
|
Condition="'$(TargetOS)' == 'wasi'" />
|
|
|
|
<PropertyGroup Condition="'$(RunAOTCompilation)' == 'true'">
|
|
<_MobileIntermediateOutputPath>$(IntermediateOutputPath)mobile</_MobileIntermediateOutputPath>
|
|
</PropertyGroup>
|
|
|
|
<!-- This .targets file is also imported by the runtime Trimming tests, and we want to be able to manually configure trimming in them so this
|
|
should be considered if we ever want to change the Condition of the ConfigureTrimming target -->
|
|
<Target Name="ConfigureTrimming" Condition="'$(EnableAggressiveTrimming)' == 'true' And '$(SkipConfigureTrimming)' != 'true'" AfterTargets="AddTestRunnersToPublishedFiles">
|
|
<PropertyGroup>
|
|
<TrimMode>link</TrimMode>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<!-- Mark all the assemblies for link. We will explicitly mark the non-trimmable ones -->
|
|
<ResolvedFileToPublish TrimMode="$(TrimMode)" />
|
|
|
|
<!-- Don't trim the main assembly.
|
|
TrimMode="" is needed so the root assemblies are correctly identified -->
|
|
<ResolvedFileToPublish TrimMode="" Condition="'%(FileName)' == '$(AssemblyName)'" />
|
|
|
|
<!-- Even though we are trimming the test runner assembly, we want it to be treated
|
|
as a root -->
|
|
<TrimmerRootAssembly
|
|
Condition="$([System.String]::Copy('%(ResolvedFileToPublish.FileName)%(ResolvedFileToPublish.Extension)').EndsWith('TestRunner.dll'))"
|
|
Include="%(ResolvedFileToPublish.FileName)" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptor.xunit.xml" Condition="'$(SkipXunitTrimmerDescriptor)' != 'true'" />
|
|
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptor.TestUtilities.xml" Condition="'$(SkipTestUtilitiesReference)' != 'true'" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="AddTestRunnersToPublishedFiles"
|
|
AfterTargets="ComputeResolvedFilesToPublishList"
|
|
Condition="'$(TestFramework)' == 'xunit'">
|
|
<ItemGroup>
|
|
<_runnerFilesToPublish Include="$(AndroidTestRunnerDir)*" Condition="'$(TargetOS)' == 'android'" />
|
|
<_runnerFilesToPublish Include="$(AppleTestRunnerDir)*" Condition="'$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator'" />
|
|
<_runnerFilesToPublish Include="$(WasmTestRunnerDir)*" Condition="'$(TargetOS)' == 'Browser' or '$(TargetOS)' == 'wasi'" />
|
|
|
|
<!-- Remove runner files that already exist in ResolvedFileToPublish to avoid double publishing -->
|
|
<_resolvedFilesToPublishToFileName Include="@(ResolvedFileToPublish -> '%(FileName)%(Extension)')" />
|
|
|
|
<_runnerFilesToPublishToFileName Include="@(_runnerFilesToPublish -> '%(FileName)%(Extension)')">
|
|
<OriginalIdentity>%(Identity)</OriginalIdentity>
|
|
</_runnerFilesToPublishToFileName>
|
|
<_runnerFilesToPublishToFileName Remove="@(_resolvedFilesToPublishToFileName)" />
|
|
|
|
<ResolvedFileToPublish Include="@(_runnerFilesToPublishToFileName -> '%(OriginalIdentity)')" RelativePath="%(FileName)%(Extension)" CopyToPublishDirectory="PreserveNewest" PostprocessAssembly="true" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Import Project="$(MSBuildThisFileDirectory)workloads-testing.targets" Condition="'$(SkipWorkloadsTestingTargetsImport)' == 'true'" />
|
|
|
|
<Target Name="PublishTestAsSelfContained"
|
|
Condition="'$(IsCrossTargetingBuild)' != 'true'"
|
|
AfterTargets="$(PublishTestAsSelfContainedAfterTargets)"
|
|
DependsOnTargets="$(PublishTestAsSelfContainedDependsOn);$(BundleTestAppTargets);ArchiveTests" />
|
|
|
|
<Target Name="PrepareForTestUsingWorkloads"
|
|
BeforeTargets="Test"
|
|
DependsOnTargets="InstallWorkloadUsingArtifacts"
|
|
Condition="'$(InstallWorkloadForTesting)' == 'true'" />
|
|
|
|
</Project>
|