mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
* Build one MonoTargetsTasks assembly for Mono.NET.Runtime.MonoTargets.Sdk pack Instead of 3 assemblies for some tiny tasks. Building a single assembly also ensures that everything in the pack depends on and bundles identical versions of dependent assemblies. For example on net472, a single version of System.Text.Json with a single fixed version shared by both the JsonToItemsTaskFactory task factory and the RuntimeConfigParser task. Related to https://github.com/dotnet/runtime/issues/59619 * Update testing and wasm to use MonoTargetsTasks.dll * Move assembly stripper to a separate assembly Build it with nullability checking disabled. Build the main MonoTargetsTasks assembly with nullability enabled * Don't include msbuild assemblies in MonoTargets package * re-enable analyzers for the MonoTargetsTasks assembly * Include *.dll in the MonoTargetsTasks nupkg In particular, pick up all the dependent assemblies for the net472 build * Update various READMEs * remove unneeded target * Switch ILStrip to use the same Parallel.ForEach logic as MonoAOTCompiler * Remove unneeded NoWarn warnings * rearrange package references in MonoTargetsTask.csproj for readabilty * More ItemGroup reformatting * fix nits * Use SystemThreadingTasksExtensionsVersion instead of hardcoding Co-authored-by: Ankit Jain <[email protected]>
321 lines
19 KiB
XML
321 lines
19 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>
|
|
<RunAOTCompilation Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'">true</RunAOTCompilation>
|
|
|
|
<PublishingTestsRun>true</PublishingTestsRun>
|
|
<BundleTestAppTargets>BundleTestAppleApp;BundleTestAndroidApp</BundleTestAppTargets>
|
|
<PublishTestAsSelfContainedDependsOn>Publish</PublishTestAsSelfContainedDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(EnableAggressiveTrimming)' == 'true' or '$(EnableSoftTrimming)' == 'true'">
|
|
<PublishTrimmed>true</PublishTrimmed>
|
|
<!-- Suppress linker warnings as these are tests -->
|
|
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
|
|
<NoWarn>$(NoWarn);IL2103;IL2105;IL2025;IL2111</NoWarn>
|
|
<!-- Warns about missing Xamarin.iOS.dll -->
|
|
<NoWarn Condition="'$(EnableSoftTrimming)' == 'true'">$(NoWarn);IL2035</NoWarn>
|
|
<!-- https://github.com/dotnet/sdk/issues/18581 tracks needing to set 2 properties to disable warnings. -->
|
|
<EnableTrimAnalyzer>false</EnableTrimAnalyzer>
|
|
|
|
<!-- 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>
|
|
|
|
<PropertyGroup>
|
|
<AdditionalXHarnessArguments Condition="'$(ExpectedExitCode)' != ''">--expected-exit-code $(ExpectedExitCode)</AdditionalXHarnessArguments>
|
|
</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>
|
|
|
|
<UsingTask Condition="'$(RunAOTCompilation)' == 'true'" TaskName="MonoAOTCompiler" AssemblyFile="$(MonoAOTCompilerTasksAssemblyPath)" />
|
|
<Import Condition="'$(RunAOTCompilation)' == 'true'" Project="$(MonoAOTCompilerDir)MonoAOTCompiler.props" />
|
|
|
|
<PropertyGroup Condition="'$(RunAOTCompilation)' == 'true'">
|
|
<_MobileIntermediateOutputPath>$(IntermediateOutputPath)mobile</_MobileIntermediateOutputPath>
|
|
</PropertyGroup>
|
|
|
|
<Import Project="$(MSBuildThisFileDirectory)tests.wasm.targets" Condition="'$(TargetOS)' == 'Browser'" />
|
|
|
|
<UsingTask TaskName="RuntimeConfigParserTask"
|
|
AssemblyFile="$(MonoTargetsTasksAssemblyPath)"
|
|
Condition="'$(MonoTargetsTasksAssemblyPath)' != ''" />
|
|
|
|
<Target Name="GenerateRuntimeConfig" Condition="'$(TargetOS)' != 'Browser'"
|
|
Inputs="$(PublishDir)$(AssemblyName).runtimeconfig.json"
|
|
Outputs="$(PublishDir)runtimeconfig.bin">
|
|
<PropertyGroup>
|
|
<RuntimeConfigFilePath>$(PublishDir)$(AssemblyName).runtimeconfig.json</RuntimeConfigFilePath>
|
|
<ParsedRuntimeConfigFilePath>$(PublishDir)runtimeconfig.bin</ParsedRuntimeConfigFilePath>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<RuntimeConfigReservedProperties Include="RUNTIME_IDENTIFIER"/>
|
|
<RuntimeConfigReservedProperties Include="APP_CONTEXT_BASE_DIRECTORY"/>
|
|
</ItemGroup>
|
|
|
|
<!-- Parse runtimeconfig.template.json file -->
|
|
<RuntimeConfigParserTask
|
|
RuntimeConfigFile="$(RuntimeConfigFilePath)"
|
|
OutputFile="$(ParsedRuntimeConfigFilePath)"
|
|
RuntimeConfigReservedProperties="@(RuntimeConfigReservedProperties)">
|
|
</RuntimeConfigParserTask>
|
|
</Target>
|
|
|
|
<!-- Generate a self-contained app bundle for Android with tests. -->
|
|
<UsingTask Condition="'$(TargetOS)' == 'Android'"
|
|
TaskName="AndroidAppBuilderTask"
|
|
AssemblyFile="$(AndroidAppBuilderTasksAssemblyPath)" />
|
|
|
|
<Target Condition="'$(TargetOS)' == 'Android'" Name="BundleTestAndroidApp" DependsOnTargets="GenerateRuntimeConfig">
|
|
<Error Condition="!Exists('$(MicrosoftNetCoreAppRuntimePackRidDir)')" Text="MicrosoftNetCoreAppRuntimePackRidDir=$(MicrosoftNetCoreAppRuntimePackRidDir) doesn't exist" />
|
|
|
|
<PropertyGroup>
|
|
<AndroidAbi Condition="'$(TargetArchitecture)' == 'arm64'">arm64-v8a</AndroidAbi>
|
|
<AndroidAbi Condition="'$(TargetArchitecture)' == 'arm'">armeabi-v7a</AndroidAbi>
|
|
<AndroidAbi Condition="'$(TargetArchitecture)' == 'x64'">x86_64</AndroidAbi>
|
|
<AndroidAbi Condition="'$(TargetArchitecture)' == 'x86'">x86</AndroidAbi>
|
|
|
|
<MainLibraryFileName Condition="'$(MainLibraryFileName)' == ''">AndroidTestRunner.dll</MainLibraryFileName>
|
|
</PropertyGroup>
|
|
<ItemGroup Condition="'$(RunAOTCompilation)' == 'true'">
|
|
<AotInputAssemblies Include="$(PublishDir)\*.dll">
|
|
<AotArguments>@(MonoAOTCompilerDefaultAotArguments, ';')</AotArguments>
|
|
<ProcessArguments>@(MonoAOTCompilerDefaultProcessArguments, ';')</ProcessArguments>
|
|
</AotInputAssemblies>
|
|
</ItemGroup>
|
|
|
|
<WriteLinesToFile File="$(PublishDir)xunit-excludes.txt" Lines="$(XunitExcludesTxtFileContent)" Overwrite="true" />
|
|
|
|
<MakeDir Directories="$(_MobileIntermediateOutputPath)"
|
|
Condition="'$(RunAOTCompilation)' == 'true'"/>
|
|
<RemoveDir Directories="$(BundleDir)" />
|
|
|
|
<MonoAOTCompiler Condition="'$(RunAOTCompilation)' == 'true'"
|
|
CompilerBinaryPath="@(MonoAotCrossCompiler->WithMetadataValue('RuntimeIdentifier','$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())'))"
|
|
OutputDir="$(_MobileIntermediateOutputPath)"
|
|
Mode="Full"
|
|
OutputType="AsmOnly"
|
|
Assemblies="@(AotInputAssemblies)"
|
|
AotModulesTablePath="$(BundleDir)\modules.c"
|
|
IntermediateOutputPath="$(IntermediateOutputPath)"
|
|
UseLLVM="$(MonoEnableLLVM)"
|
|
LLVMPath="$(MonoAotCrossDir)">
|
|
<Output TaskParameter="CompiledAssemblies" ItemName="BundleAssemblies" />
|
|
</MonoAOTCompiler>
|
|
|
|
<AndroidAppBuilderTask
|
|
RuntimeIdentifier="$(RuntimeIdentifier)"
|
|
ProjectName="$(AssemblyName)"
|
|
MonoRuntimeHeaders="$(MicrosoftNetCoreAppRuntimePackNativeDir)include\mono-2.0"
|
|
Assemblies="@(BundleAssemblies)"
|
|
MainLibraryFileName="$(MainLibraryFileName)"
|
|
ForceAOT="$(RunAOTCompilation)"
|
|
ForceInterpreter="$(MonoForceInterpreter)"
|
|
StripDebugSymbols="False"
|
|
OutputDir="$(BundleDir)"
|
|
AppDir="$(PublishDir)">
|
|
<Output TaskParameter="ApkPackageId" PropertyName="ApkPackageId" />
|
|
<Output TaskParameter="ApkBundlePath" PropertyName="ApkBundlePath" />
|
|
</AndroidAppBuilderTask>
|
|
|
|
<Message Importance="High" Text="PackageId: $(ApkPackageId)"/>
|
|
<Message Importance="High" Text="Instrumentation: net.dot.MonoRunner"/>
|
|
<Message Importance="High" Text="Apk: $(ApkBundlePath)"/>
|
|
|
|
<Copy SourceFiles="$(ApkBundlePath)"
|
|
DestinationFolder="$(TestArchiveTestsDir)"
|
|
SkipUnchangedFiles="true"
|
|
Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'" />
|
|
</Target>
|
|
|
|
<!-- Generate a self-contained app bundle for iOS with tests. -->
|
|
<UsingTask Condition="'$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator'"
|
|
TaskName="AppleAppBuilderTask"
|
|
AssemblyFile="$(AppleAppBuilderTasksAssemblyPath)" />
|
|
|
|
<UsingTask Condition="'$(RunAOTCompilation)' == 'true' and ('$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator')"
|
|
TaskName="ILStrip"
|
|
AssemblyFile="$(MonoTargetsTasksAssemblyPath)" />
|
|
|
|
<Target Condition="'$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator'" Name="BundleTestAppleApp" DependsOnTargets="GenerateRuntimeConfig">
|
|
<Error Condition="!Exists('$(MicrosoftNetCoreAppRuntimePackRidDir)')" Text="MicrosoftNetCoreAppRuntimePackRidDir=$(MicrosoftNetCoreAppRuntimePackRidDir) doesn't exist" />
|
|
<Error Condition="('$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'MacCatalyst') and '$(DevTeamProvisioning)' == ''"
|
|
Text="'DevTeamProvisioning' needs to be set for device builds. Set it to 'UBF8T346G9' if you're part of the Microsoft team account, 'adhoc' to sign with an adhoc key, or '-' to skip signing all together.." />
|
|
<Error Condition="'$(TestArchiveTestsDir)' == ''" Text="TestArchiveTestsDir property to archive the test folder must be set." />
|
|
|
|
<WriteLinesToFile File="$(PublishDir)xunit-excludes.txt" Lines="$(XunitExcludesTxtFileContent)" Overwrite="true" />
|
|
|
|
<PropertyGroup>
|
|
<Optimized>true</Optimized>
|
|
<MainLibraryFileName Condition="'$(MainLibraryFileName)' == ''">AppleTestRunner.dll</MainLibraryFileName>
|
|
<_MobileIntermediateOutputPath Condition="'$(RunAOTCompilation)' == 'true'">$(IntermediateOutputPath)mobile</_MobileIntermediateOutputPath>
|
|
<GenerateXcodeProject>true</GenerateXcodeProject>
|
|
<GenerateCMakeProject>false</GenerateCMakeProject>
|
|
<GenerateXcodeProject Condition="'$(UseAppBundleRootForBuildingTests)' == 'true'">false</GenerateXcodeProject>
|
|
<GenerateCMakeProject Condition="'$(UseAppBundleRootForBuildingTests)' == 'true' and '$(IgnoreForCI)' != 'true'">true</GenerateCMakeProject>
|
|
</PropertyGroup>
|
|
<PropertyGroup>
|
|
<AOTMode Condition="'$(TargetOS)' != 'MacCatalyst'">Full</AOTMode>
|
|
<AOTMode Condition="'$(TargetOS)' == 'MacCatalyst' and '$(MonoForceInterpreter)' != 'true'">Full</AOTMode>
|
|
<AOTMode Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' == 'true'">JustInterp</AOTMode>
|
|
</PropertyGroup>
|
|
<ItemGroup>
|
|
<_AotExcludeAssemblies Include="$(PublishDir)System.Runtime.WindowsRuntime.dll" />
|
|
<_AotExcludeAssemblies Include="@(NativeLibraries->'$(PublishDir)%(Identity)')" />
|
|
|
|
<!-- JustInterp only needs to AOT CoreLib, the other assemblies will just get added to BundleAssemblies via _BundleNonAotAssemblies -->
|
|
<_AotIncludeAssemblies Condition="'$(RunAOTCompilation)' == 'true' and '$(AOTMode)' == 'JustInterp'" Include="$(PublishDir)System.Private.CoreLib.dll" />
|
|
<_AotIncludeAssemblies Condition="'$(RunAOTCompilation)' == 'true' and '$(AOTMode)' != 'JustInterp'" Include="$(PublishDir)*.dll" />
|
|
|
|
<AotInputAssemblies Condition="'$(RunAOTCompilation)' == 'true'" Include="@(_AotIncludeAssemblies)" Exclude="@(_AotExcludeAssemblies)">
|
|
<AotArguments>@(MonoAOTCompilerDefaultAotArguments, ';')</AotArguments>
|
|
<ProcessArguments>@(MonoAOTCompilerDefaultProcessArguments, ';')</ProcessArguments>
|
|
</AotInputAssemblies>
|
|
<BundleAssemblies Condition="'$(RunAOTCompilation)' != 'true'" Include="$(PublishDir)*.dll" />
|
|
<_BundleNonAotAssemblies Condition="'$(RunAOTCompilation)' == 'true' and '$(AOTMode)' == 'JustInterp'" Include="$(PublishDir)*.dll" Exclude="$(PublishDir)System.Private.CoreLib.dll" />
|
|
</ItemGroup>
|
|
|
|
<MakeDir Directories="$(_MobileIntermediateOutputPath)"
|
|
Condition="'$(RunAOTCompilation)' == 'true'"/>
|
|
<RemoveDir Directories="$(BundleDir)" />
|
|
|
|
<MonoAOTCompiler Condition="'$(RunAOTCompilation)' == 'true'"
|
|
CompilerBinaryPath="@(MonoAotCrossCompiler->WithMetadataValue('RuntimeIdentifier','$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())'))"
|
|
OutputDir="$(_MobileIntermediateOutputPath)"
|
|
Mode="$(AOTMode)"
|
|
OutputType="AsmOnly"
|
|
Assemblies="@(AotInputAssemblies)"
|
|
AotModulesTablePath="$(BundleDir)\modules.m"
|
|
AotModulesTableLanguage="ObjC"
|
|
IntermediateOutputPath="$(IntermediateOutputPath)"
|
|
UseLLVM="$(MonoEnableLLVM)"
|
|
LLVMPath="$(MonoAotCrossDir)">
|
|
<Output TaskParameter="CompiledAssemblies" ItemName="BundleAssemblies" />
|
|
</MonoAOTCompiler>
|
|
|
|
<!-- <ILStrip Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' != 'true'" Assemblies="@(BundleAssemblies)" /> -->
|
|
|
|
<ItemGroup>
|
|
<BundleAssemblies Include="@(_BundleNonAotAssemblies)" />
|
|
</ItemGroup>
|
|
|
|
<!-- Run App bundler, it uses AOT libs (if needed), link all native bits, compile simple UI (written in ObjC)
|
|
and produce an app bundle (with xcode project) -->
|
|
<AppleAppBuilderTask
|
|
TargetOS="$(TargetOS)"
|
|
Arch="$(TargetArchitecture)"
|
|
ProjectName="$(AssemblyName)"
|
|
MonoRuntimeHeaders="$(MicrosoftNetCoreAppRuntimePackNativeDir)include\mono-2.0"
|
|
Assemblies="@(BundleAssemblies)"
|
|
MainLibraryFileName="$(MainLibraryFileName)"
|
|
ForceAOT="$(RunAOTCompilation)"
|
|
ForceInterpreter="$(MonoForceInterpreter)"
|
|
InvariantGlobalization="$(InvariantGlobalization)"
|
|
UseConsoleUITemplate="True"
|
|
GenerateXcodeProject="$(GenerateXcodeProject)"
|
|
GenerateCMakeProject="$(GenerateCMakeProject)"
|
|
BuildAppBundle="$(GenerateXcodeProject)"
|
|
Optimized="$(Optimized)"
|
|
DevTeamProvisioning="$(DevTeamProvisioning)"
|
|
OutputDirectory="$(BundleDir)"
|
|
AppDir="$(PublishDir)">
|
|
<Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" />
|
|
<Output TaskParameter="XcodeProjectPath" PropertyName="XcodeProjectPath" />
|
|
</AppleAppBuilderTask>
|
|
<Message Importance="High" Text="Xcode: $(XcodeProjectPath)" Condition="'$(GenerateXcodeProject)' == 'true'" />
|
|
<Message Importance="High" Text="App: $(AppBundlePath)" Condition="'$(GenerateXcodeProject)' == 'true'"/>
|
|
|
|
<ItemGroup Condition="'$(GenerateXcodeProject)' == 'true'">
|
|
<_appFiles Include="$(AppBundlePath)/../**/*" />
|
|
</ItemGroup>
|
|
|
|
<Copy SourceFiles="@(_appFiles)"
|
|
DestinationFolder="$(TestArchiveTestsDir)/%(RecursiveDir)"
|
|
SkipUnchangedFiles="true"
|
|
Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true' and '$(GenerateXcodeProject)' == 'true'" />
|
|
|
|
<RemoveDir Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'"
|
|
Directories="$(OutDir)" />
|
|
</Target>
|
|
|
|
<!-- 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' or '$(EnableSoftTrimming)' == 'true') And '$(SkipConfigureTrimming)' != 'true'" AfterTargets="AddTestRunnersToPublishedFiles">
|
|
<PropertyGroup>
|
|
<TrimMode Condition="'$(EnableAggressiveTrimming)' == 'true'">Link</TrimMode>
|
|
<TrimMode Condition="'$(EnableSoftTrimming)' == 'true'">CopyUsed</TrimMode>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<!-- Mark all the assemblies for link/copyused. 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)'" />
|
|
|
|
<!-- TODO: find out why these assemblies aren't copied by copyused even though they're referenced -->
|
|
<ResolvedFileToPublish TrimMode="Copy" Condition="'$(EnableSoftTrimming)' == 'true' and '%(FileName)' == 'System.Drawing.Primitives'" />
|
|
<ResolvedFileToPublish TrimMode="Copy" Condition="'$(EnableSoftTrimming)' == 'true' and '%(FileName)' == 'System.Security.AccessControl'" />
|
|
<ResolvedFileToPublish TrimMode="Copy" Condition="'$(EnableSoftTrimming)' == 'true' and '%(FileName)' == 'System.Security.Claims'" />
|
|
|
|
<!-- 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.FullPath)" />
|
|
</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">
|
|
<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'" />
|
|
|
|
<!-- 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>
|
|
|
|
<Target Name="PublishTestAsSelfContained"
|
|
Condition="'$(IsCrossTargetingBuild)' != 'true'"
|
|
AfterTargets="Build"
|
|
DependsOnTargets="$(PublishTestAsSelfContainedDependsOn);$(BundleTestAppTargets);ArchiveTests" />
|
|
|
|
<Target Name="PrepareForTestUsingWorkloads"
|
|
BeforeTargets="Test"
|
|
DependsOnTargets="InstallWorkloadUsingArtifacts"
|
|
Condition="'$(InstallWorkloadForTesting)' == 'true'" />
|
|
|
|
<Import Project="$(RepositoryEngineeringDir)illink.targets" Condition="'$(SkipImportRepoLinkerTargets)' != 'true'" />
|
|
</Project>
|