|
326 | 326 | Condition="'$(TestAssemblies)' == 'true' and
|
327 | 327 | '$(Coverage)' == 'true'" />
|
328 | 328 |
|
| 329 | + <!-- Build Apple app bundles using AppBundleRoot --> |
| 330 | + <UsingTask Condition="'$(UseAppBundleRootForBuildingTests)' == 'true'" |
| 331 | + TaskName="XcodeCreateProject" |
| 332 | + AssemblyFile="$(AppleAppBuilderTasksAssemblyPath)" /> |
| 333 | + |
| 334 | + <UsingTask Condition="'$(UseAppBundleRootForBuildingTests)' == 'true'" |
| 335 | + TaskName="XcodeBuildApp" |
| 336 | + AssemblyFile="$(AppleAppBuilderTasksAssemblyPath)" /> |
| 337 | + |
| 338 | + <Target Condition="'$(UseAppBundleRootForBuildingTests)' == 'true'" |
| 339 | + Name="BuildAppleAppBundles" |
| 340 | + AfterTargets="Build"> |
| 341 | + |
| 342 | + <PropertyGroup> |
| 343 | + <!-- TODO: Unify this with TestArchiveTestsRoot in src/libraries/Directory.Build.props somehow, |
| 344 | + we can't use IsFunctionalTest==true here because it is only set in the context of the .csproj --> |
| 345 | + <TestArchiveNormalTestsRoot>$(TestArchiveRoot)tests/</TestArchiveNormalTestsRoot> |
| 346 | + <TestArchiveFunctionalTestsRoot>$(TestArchiveRoot)runonly/</TestArchiveFunctionalTestsRoot> |
| 347 | + |
| 348 | + <TestArchiveNormalTestsDir>$(TestArchiveNormalTestsRoot)$(OSPlatformConfig)/</TestArchiveNormalTestsDir> |
| 349 | + <TestArchiveFunctionalTestsDir>$(TestArchiveFunctionalTestsRoot)$(OSPlatformConfig)/</TestArchiveFunctionalTestsDir> |
| 350 | + |
| 351 | + <NormalTestsAppBundleRoot>$(AppBundleRoot)/tests/</NormalTestsAppBundleRoot> |
| 352 | + <FunctionalTestsAppBundleRoot>$(AppBundleRoot)/runonly/</FunctionalTestsAppBundleRoot> |
| 353 | + |
| 354 | + <NormalTestsAllAppBundlesRoot>$(AppBundleRoot)/tests.all/</NormalTestsAllAppBundlesRoot> |
| 355 | + <FunctionalTestsAllAppBundlesRoot>$(AppBundleRoot)/runonly.all/</FunctionalTestsAllAppBundlesRoot> |
| 356 | + </PropertyGroup> |
| 357 | + |
| 358 | + <ItemGroup> |
| 359 | + <NormalTestAppBundles Include="$(NormalTestsAppBundleRoot)*/AppBundle/CMakeLists.txt" /> |
| 360 | + <NormalTestCMakeEntries Include="cmake_minimum_required(VERSION 3.16)" /> |
| 361 | + <NormalTestCMakeEntries Include="project(NormalTestAppBundles)" /> |
| 362 | + <NormalTestCMakeEntries Include="add_subdirectory(%(NormalTestAppBundles.RootDir)%(NormalTestAppBundles.Directory) %(NormalTestAppBundles.RecursiveDir) EXCLUDE_FROM_ALL)" /> |
| 363 | + |
| 364 | + <FunctionalTestAppBundles Include="$(FunctionalTestsAppBundleRoot)*/AppBundle/CMakeLists.txt" /> |
| 365 | + <FunctionalTestCMakeEntries Include="cmake_minimum_required(VERSION 3.16)" /> |
| 366 | + <FunctionalTestCMakeEntries Include="project(FunctionalTestAppBundles)" /> |
| 367 | + <FunctionalTestCMakeEntries Include="add_subdirectory(%(FunctionalTestAppBundles.RootDir)%(FunctionalTestAppBundles.Directory) %(FunctionalTestAppBundles.RecursiveDir) EXCLUDE_FROM_ALL)" /> |
| 368 | + </ItemGroup> |
| 369 | + |
| 370 | + <WriteLinesToFile File="$(NormalTestsAllAppBundlesRoot)CMakeLists.txt" Lines="@(NormalTestCMakeEntries)" Overwrite="true" WriteOnlyWhenDifferent="true" /> |
| 371 | + <WriteLinesToFile File="$(FunctionalTestsAllAppBundlesRoot)CMakeLists.txt" Lines="@(FunctionalTestCMakeEntries)" Overwrite="true" WriteOnlyWhenDifferent="true" /> |
| 372 | + |
| 373 | + <XcodeCreateProject |
| 374 | + TargetOS="$(TargetOS)" |
| 375 | + Arch="$(TargetArchitecture)" |
| 376 | + ProjectName="NormalTestAppBundles" |
| 377 | + CMakeListsDirectory="$(NormalTestsAllAppBundlesRoot)" |
| 378 | + Condition="'@(NormalTestAppBundles)' != ''" /> |
| 379 | + |
| 380 | + <XcodeCreateProject |
| 381 | + TargetOS="$(TargetOS)" |
| 382 | + Arch="$(TargetArchitecture)" |
| 383 | + ProjectName="FunctionalTestAppBundles" |
| 384 | + CMakeListsDirectory="$(FunctionalTestsAllAppBundlesRoot)" |
| 385 | + Condition="'@(FunctionalTestAppBundles)' != ''" /> |
| 386 | + |
| 387 | + <MakeDir Directories="$(TestArchiveNormalTestsDir)" /> |
| 388 | + <MakeDir Directories="$(TestArchiveFunctionalTestsDir)" /> |
| 389 | + |
| 390 | + <ItemGroup> |
| 391 | + <!-- xcodeproj are directories, not files --> |
| 392 | + <XcodeProjects Condition="'@(NormalTestAppBundles)' != ''" Include="$([System.IO.Directory]::GetDirectories('$(NormalTestsAllAppBundlesRoot)NormalTestAppBundles/%(NormalTestAppBundles.RecursiveDir)', '*.xcodeproj'))" DestinationFolder="$(TestArchiveNormalTestsDir)" /> |
| 393 | + <XcodeProjects Condition="'@(FunctionalTestAppBundles)' != ''" Include="$([System.IO.Directory]::GetDirectories('$(FunctionalTestsAllAppBundlesRoot)FunctionalTestAppBundles/%(FunctionalTestAppBundles.RecursiveDir)', '*.xcodeproj'))" DestinationFolder="$(TestArchiveFunctionalTestsDir)" /> |
| 394 | + </ItemGroup> |
| 395 | + |
| 396 | + <XcodeBuildApp |
| 397 | + TargetOS="$(TargetOS)" |
| 398 | + Arch="$(TargetArchitecture)" |
| 399 | + XcodeProjectPath="%(XcodeProjects.Identity)" |
| 400 | + DevTeamProvisioning="$(DevTeamProvisioning)" |
| 401 | + Optimized="True" |
| 402 | + DestinationFolder="%(XcodeProjects.DestinationFolder)" /> |
| 403 | + |
| 404 | + <RemoveDir Condition="'$(ArchiveTests)' == 'true'" |
| 405 | + Directories="$(AppBundleRoot)" /> |
| 406 | + </Target> |
| 407 | + |
329 | 408 | <!-- Restoring all trimming test projects upfront in one single call to RestoreTrimmingProjects
|
330 | 409 | so as to avoid possible race conditions that could happen if we restore each individually. -->
|
331 | 410 | <Target Name="RestoreTrimmingProjects"
|
|
0 commit comments