mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-09 17:44:48 +09:00
284 lines
16 KiB
XML
284 lines
16 KiB
XML
<Project>
|
|
<PropertyGroup>
|
|
<!-- OutDir is not set early enough to set this property in .props file. -->
|
|
<BundleDir>$([MSBuild]::NormalizeDirectory('$(OutDir)', 'AppBundle'))</BundleDir>
|
|
<RunScriptOutputPath>$([MSBuild]::NormalizePath('$(BundleDir)', '$(RunScriptOutputName)'))</RunScriptOutputPath>
|
|
<RunAOTCompilation Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'">true</RunAOTCompilation>
|
|
|
|
<PublishingTestsRun>true</PublishingTestsRun>
|
|
<UseDefaultBlazorWASMFeatureSwitches Condition="'$(UseDefaultBlazorWASMFeatureSwitches)' == ''">true</UseDefaultBlazorWASMFeatureSwitches>
|
|
<UseDefaultAndroidFeatureSwitches Condition="'$(UseDefaultAndroidFeatureSwitches)' == ''">true</UseDefaultAndroidFeatureSwitches>
|
|
<UseDefaultiOSFeatureSwitches Condition="'$(UseDefaultiOSFeatureSwitches)' == ''">true</UseDefaultiOSFeatureSwitches>
|
|
<BundleTestAppTargets>BundleTestAppleApp;BundleTestAndroidApp</BundleTestAppTargets>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(TargetOS)' == 'Android' and '$(UseDefaultAndroidFeatureSwitches)' == 'true'">
|
|
<DebuggerSupport>false</DebuggerSupport>
|
|
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
|
|
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
|
|
<EventSourceSupport>false</EventSourceSupport>
|
|
<UseSystemResourceKeys>true</UseSystemResourceKeys>
|
|
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
|
|
<StartupHookSupport>false</StartupHookSupport>
|
|
<UseNativeHttpHandler>true</UseNativeHttpHandler>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="('$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator') and '$(UseDefaultiOSFeatureSwitches)' == 'true'">
|
|
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
|
|
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
|
|
<EventSourceSupport>false</EventSourceSupport>
|
|
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
|
|
<StartupHookSupport>false</StartupHookSupport>
|
|
<UseSystemResourceKeys>true</UseSystemResourceKeys>
|
|
<UseNativeHttpHandler>true</UseNativeHttpHandler>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(EnableAggressiveTrimming)' == 'true'">
|
|
<PublishTrimmed>true</PublishTrimmed>
|
|
<!-- Suppress linker warnings as these are tests -->
|
|
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
|
|
</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'" />
|
|
|
|
<!-- Generate a self-contained app bundle for Android with tests. -->
|
|
<UsingTask Condition="'$(TargetOS)' == 'Android'"
|
|
TaskName="AndroidAppBuilderTask"
|
|
AssemblyFile="$(AndroidAppBuilderTasksAssemblyPath)" />
|
|
<UsingTask Condition="'$(TargetOS)' == 'Android'"
|
|
TaskName="RuntimeConfigParserTask"
|
|
AssemblyFile="$(RuntimeConfigParserTasksAssemblyPath)" />
|
|
|
|
<Target Condition="'$(TargetOS)' == 'Android'" Name="BundleTestAndroidApp">
|
|
<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>
|
|
<RuntimeConfigFilePath>$(PublishDir)$(AssemblyName).runtimeconfig.json</RuntimeConfigFilePath>
|
|
<ParsedRuntimeConfigFilePath>$(PublishDir)runtimeconfig.bin</ParsedRuntimeConfigFilePath>
|
|
</PropertyGroup>
|
|
<ItemGroup Condition="'$(RunAOTCompilation)' == 'true'">
|
|
<AotInputAssemblies Include="$(PublishDir)\*.dll">
|
|
<AotArguments>@(MonoAOTCompilerDefaultAotArguments, ';')</AotArguments>
|
|
<ProcessArguments>@(MonoAOTCompilerDefaultProcessArguments, ';')</ProcessArguments>
|
|
</AotInputAssemblies>
|
|
<RuntimeConfigReservedProperties Include="RUNTIME_IDENTIFIER"/>
|
|
<RuntimeConfigReservedProperties Include="APP_CONTEXT_BASE_DIRECTORY"/>
|
|
</ItemGroup>
|
|
|
|
<WriteLinesToFile File="$(PublishDir)xunit-excludes.txt" Lines="$(XunitExcludesTxtFileContent)" Overwrite="true" />
|
|
|
|
<MakeDir Directories="$(_MobileIntermediateOutputPath)"
|
|
Condition="'$(RunAOTCompilation)' == 'true'"/>
|
|
<RemoveDir Directories="$(BundleDir)" />
|
|
|
|
<!-- Parse runtimeconfig.template.json file -->
|
|
<RuntimeConfigParserTask
|
|
RuntimeConfigFile="$(RuntimeConfigFilePath)"
|
|
OutputFile="$(ParsedRuntimeConfigFilePath)"
|
|
RuntimeConfigReservedProperties="@(RuntimeConfigReservedProperties)">
|
|
</RuntimeConfigParserTask>
|
|
|
|
<MonoAOTCompiler Condition="'$(RunAOTCompilation)' == 'true'"
|
|
CompilerBinaryPath="$(MonoAotCrossCompilerPath)"
|
|
OutputDir="$(_MobileIntermediateOutputPath)"
|
|
Mode="Full"
|
|
OutputType="AsmOnly"
|
|
Assemblies="@(AotInputAssemblies)"
|
|
AotModulesTablePath="$(BundleDir)\modules.c"
|
|
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)" />
|
|
|
|
<PropertyGroup>
|
|
<DevTeamProvisioning Condition="'$(TargetOS)' == 'MacCatalyst' and '$(DevTeamProvisioning)' == ''">adhoc</DevTeamProvisioning>
|
|
</PropertyGroup>
|
|
|
|
<Target Condition="'$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator'" Name="BundleTestAppleApp">
|
|
<Error Condition="!Exists('$(MicrosoftNetCoreAppRuntimePackRidDir)')" Text="MicrosoftNetCoreAppRuntimePackRidDir=$(MicrosoftNetCoreAppRuntimePackRidDir) doesn't exist" />
|
|
<Error Condition="('$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm' 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, or 'adhoc' to sign with an adhoc key.." />
|
|
<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>
|
|
</PropertyGroup>
|
|
<ItemGroup>
|
|
<AotInputAssemblies Condition="'$(RunAOTCompilation)' == 'true'" Include="$(PublishDir)*.dll" Exclude="$(PublishDir)System.Runtime.WindowsRuntime.dll">
|
|
<AotArguments>@(MonoAOTCompilerDefaultAotArguments, ';')</AotArguments>
|
|
<ProcessArguments>@(MonoAOTCompilerDefaultProcessArguments, ';')</ProcessArguments>
|
|
</AotInputAssemblies>
|
|
<BundleAssemblies Condition="'$(RunAOTCompilation)' != 'true'" Include="$(PublishDir)*.dll" />
|
|
</ItemGroup>
|
|
|
|
<MakeDir Directories="$(_MobileIntermediateOutputPath)"
|
|
Condition="'$(RunAOTCompilation)' == 'true'"/>
|
|
<RemoveDir Directories="$(BundleDir)" />
|
|
|
|
<MonoAOTCompiler Condition="'$(RunAOTCompilation)' == 'true'"
|
|
CompilerBinaryPath="$(MonoAotCrossCompilerPath)"
|
|
OutputDir="$(_MobileIntermediateOutputPath)"
|
|
Mode="Full"
|
|
OutputType="AsmOnly"
|
|
Assemblies="@(AotInputAssemblies)"
|
|
AotModulesTablePath="$(BundleDir)\modules.m"
|
|
AotModulesTableLanguage="ObjC"
|
|
UseLLVM="$(MonoEnableLLVM)"
|
|
LLVMPath="$(MonoAotCrossDir)">
|
|
<Output TaskParameter="CompiledAssemblies" ItemName="BundleAssemblies" />
|
|
</MonoAOTCompiler>
|
|
|
|
<!-- 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="True"
|
|
BuildAppBundle="True"
|
|
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)"/>
|
|
<Message Importance="High" Text="App: $(AppBundlePath)"/>
|
|
|
|
<ItemGroup>
|
|
<_appFiles Include="$(AppBundlePath)/../**/*" />
|
|
</ItemGroup>
|
|
|
|
<Copy SourceFiles="@(_appFiles)"
|
|
DestinationFolder="$(TestArchiveTestsDir)/%(RecursiveDir)"
|
|
SkipUnchangedFiles="true"
|
|
Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'" />
|
|
|
|
<RemoveDir Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'" Directories="$(AppBundlePath)" />
|
|
<ItemGroup>
|
|
<_removeFiles Include="$(OutDir)*.*" />
|
|
</ItemGroup>
|
|
|
|
<Delete Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true' and '$(OutDir)' != ''" Files="@(_removeFiles)" />
|
|
<RemoveDir Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'" Directories="$(PublishDir)" />
|
|
</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' 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="link" />
|
|
|
|
<!-- 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.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="Publish;$(BundleTestAppTargets);ArchiveTests" />
|
|
|
|
<Import Project="$(RepositoryEngineeringDir)illink.targets" Condition="'$(SkipImportRepoLinkerTargets)' != 'true'" />
|
|
</Project>
|