@@ -577,6 +577,60 @@ fileprivate struct AssetCatalogTaskConstructionTests: CoreBasedTests {
577577 }
578578 }
579579
580+ /// `--ui-framework-family uikit` should be passed to actool when (and only when) building for
581+ /// Mac Catalyst.
582+ @Test ( . requireSDKs( . macOS, . iOS) )
583+ func uiFrameworkFamilyForMacCatalyst( ) async throws {
584+ let actoolPath = try await self . actoolPath
585+ try await withTemporaryDirectory { tmpDir in
586+ let testProject = TestProject (
587+ " aProject " ,
588+ sourceRoot: tmpDir,
589+ groupTree: TestGroup ( " Root " , children: [
590+ TestFile ( " Assets.xcassets " ) ,
591+ ] ) ,
592+ buildConfigurations: [
593+ TestBuildConfiguration ( " Debug " , buildSettings: [
594+ " ASSETCATALOG_EXEC " : actoolPath. str,
595+ " AD_HOC_CODE_SIGNING_ALLOWED " : " YES " ,
596+ " CODE_SIGN_IDENTITY " : " - " ,
597+ " GENERATE_INFOPLIST_FILE " : " YES " ,
598+ " PRODUCT_NAME " : " $(TARGET_NAME) " ,
599+ " SDKROOT " : " iphoneos " ,
600+ " SUPPORTS_MACCATALYST " : " YES " ,
601+ " TARGETED_DEVICE_FAMILY " : " 2,6 " ,
602+ ] )
603+ ] ,
604+ targets: [
605+ TestStandardTarget (
606+ " App " ,
607+ type: . framework,
608+ buildPhases: [
609+ TestResourcesBuildPhase ( [ " Assets.xcassets " ] ) ,
610+ ] )
611+ ]
612+ )
613+
614+ let tester = try await TaskConstructionTester ( getCore ( ) , testProject)
615+
616+ // When building for Mac Catalyst, --ui-framework-family uikit should be emitted.
617+ await tester. checkBuild ( runDestination: . macCatalyst) { results in
618+ results. checkTask ( . matchRuleType( " CompileAssetCatalogVariant " ) , . matchRuleItem( " thinned " ) ) { task in
619+ task. checkCommandLineContainsUninterrupted ( [ " --ui-framework-family " , " uikit " ] )
620+ }
621+ results. checkNoDiagnostics ( )
622+ }
623+
624+ // When building for iOS device (not Mac Catalyst), the flag should NOT be emitted.
625+ await tester. checkBuild ( runDestination: . iOS) { results in
626+ results. checkTask ( . matchRuleType( " CompileAssetCatalogVariant " ) , . matchRuleItem( " thinned " ) ) { task in
627+ task. checkCommandLineDoesNotContain ( " --ui-framework-family " )
628+ }
629+ results. checkNoDiagnostics ( )
630+ }
631+ }
632+ }
633+
580634 /// When asset symbol generation is disabled, the asset catalog must stay in the Resources phase
581635 /// and not be moved to Sources. This matters for projects where the xcassets is generated by a
582636 /// preceding script phase and doesn't exist during Sources processing.
0 commit comments