From acb90e57e8acfb6c7cba98dc47fb7dc6b0588571 Mon Sep 17 00:00:00 2001 From: Owen Voorhees Date: Tue, 16 Dec 2025 14:39:31 -0800 Subject: [PATCH] Ensure individual spec files don't mix different domains --- Sources/SWBApplePlatform/CMakeLists.txt | 1 + .../Specs/AppleFileTypes.xcspec | 204 ++++++++++++++++++ .../SWBApplePlatform/Specs/CoreData.xcspec | 78 +------ Sources/SWBApplePlatform/Specs/CoreML.xcspec | 29 --- Sources/SWBApplePlatform/Specs/EXUtil.xcspec | 1 + .../Specs/InstrumentsPackage.xcspec | 25 +-- Sources/SWBApplePlatform/Specs/Intents.xcspec | 15 -- .../Specs/RealityAssets.xcspec | 16 -- .../Specs/ReferenceObject.xcspec | 13 -- .../Specs/XCAppExtensionPoints.xcspec | 13 -- .../SWBApplePlatform/Specs/XCStrings.xcspec | 14 -- Sources/SWBGenericUnixPlatform/CMakeLists.txt | 1 + 12 files changed, 210 insertions(+), 200 deletions(-) create mode 100644 Sources/SWBApplePlatform/Specs/AppleFileTypes.xcspec diff --git a/Sources/SWBApplePlatform/CMakeLists.txt b/Sources/SWBApplePlatform/CMakeLists.txt index 7dd6a466..9dde01e4 100644 --- a/Sources/SWBApplePlatform/CMakeLists.txt +++ b/Sources/SWBApplePlatform/CMakeLists.txt @@ -50,6 +50,7 @@ add_library(SWBApplePlatform SwiftBuild_Bundle(MODULE SWBApplePlatform FILES Specs/AppIntentsMetadata.xcspec Specs/AppIntentsNLTraining.xcspec + Specs/AppleFileTypes.xcspec Specs/AppShortcutStringsMetadata.xcspec Specs/AssetCatalogCompiler.xcspec Specs/CompileSkybox.xcspec diff --git a/Sources/SWBApplePlatform/Specs/AppleFileTypes.xcspec b/Sources/SWBApplePlatform/Specs/AppleFileTypes.xcspec new file mode 100644 index 00000000..786f6187 --- /dev/null +++ b/Sources/SWBApplePlatform/Specs/AppleFileTypes.xcspec @@ -0,0 +1,204 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift open source project +// +// Copyright (c) 2025 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See http://swift.org/LICENSE.txt for license information +// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + +( + { + Type = FileType; + Identifier = "file.referenceobject"; + BasedOn = sourcecode; + Name = "ARKit Reference Object"; + Extensions = ( + referenceobject, + ); + AppliesToBuildRules = YES; + IncludeInIndex = YES; + CanSetIncludeInIndex = YES; + UTI = "com.apple.arkit.referenceobject"; + }, + { + Type = FileType; + Identifier = "text.json.xcstrings"; + BasedOn = text.json; + Name = "XCStrings files"; + UTI = "com.apple.xcode.xcstrings"; + Extensions = ( + xcstrings, + ); + AppliesToBuildRules = YES; + IncludeInIndex = YES; + CanSetIncludeInIndex = YES; + }, + { + AppliesToBuildRules = YES; + CanSetIncludeInIndex = YES; + Extensions = ( + rkassets, + ); + Identifier = "folder.rkassets"; + IncludeInIndex = YES; + IsFolder = YES; + IsTextFile = NO; + IsWrapperFolder = YES; + Name = "Reality Assets"; + Type = FileType; + UTI = "com.apple.rkassets"; + }, + { + Type = FileType; + Identifier = "com.apple.instruments.package-definition"; + BasedOn = text.xml; + Name = "Instruments Package Definition"; + Extensions = (instrpkg); + AppliesToBuildRules = Yes; + UTI = "com.apple.instruments.package-definition"; + }, + { + Type = FileType; + Identifier = "com.apple.instruments.instrdst"; + BasedOn = wrapper; + Name = "Instruments Distribution Package"; + Extensions = (instrdst); + UTI = "com.apple.instruments.instrdst"; + }, + { + Type = FileType; + Identifier = "file.intentdefinition"; + BasedOn = sourcecode; + Name = "SiriKit Intent Definition"; + Extensions = ( + intentdefinition, + ); + AppliesToBuildRules = YES; + IncludeInIndex = YES; + CanSetIncludeInIndex = YES; + UTI = "com.apple.sirikit.intentdefinition"; + "FallbackAutoroutingBuildPhase" = Resources; + }, + { + Name = "XCAppExtensionPoints"; + Type = FileType; + Identifier = text.plist.xcappextensionpoints; + BasedOn = text.plist; + Extensions = ( + xcappextensionpoints + ); + IsTransparent = NO; + AppliesToBuildRules = YES; + UTI = "com.apple.dt.xcappextensionpoints"; + }, + { + Type = FileType; + Identifier = "file.mlmodel"; + BasedOn = sourcecode; + Name = "CoreML Machine Learning Model"; + Extensions = ( + mlmodel, + mlkitmodel, + ); + AppliesToBuildRules = YES; + IncludeInIndex = YES; + CanSetIncludeInIndex = YES; + UTI = "com.apple.coreml.model"; + }, + { + Type = FileType; + Identifier = "folder.mlpackage"; + BasedOn = wrapper; + Name = "CoreML Machine Learning Model Package"; + Extensions = ( + mlpackage, + ); + IsWrapperFolder = YES; + IsFolder = YES; + AppliesToBuildRules = YES; + IncludeInIndex = YES; + CanSetIncludeInIndex = YES; + UTI = "com.apple.coreml.mlpackage"; + }, + // XDesign file types + { + Identifier = wrapper.xcdatamodel; + Type = FileType; + // Has to base on 'sourcecode' so that when we are adding data model file to a target, + // it gets dropped into the source code bucket to be compiled later. + BasedOn = sourcecode; + Name = "Data model files"; + Extensions = (xcdatamodel); + AppliesToBuildRules = yes; + + // from wrapper + IsWrapperFolder = YES; + IsFolder = NO; + IncludeInIndex = YES; + CanSetIncludeInIndex = YES; + + // Don't set encoding + IsTextFile = NO; + + UTI = "com.apple.xcode.model.data"; + }, + + { + Identifier = wrapper.xcdatamodeld; + Type = FileType; + // Has to base on 'sourcecode' so that when we are adding data model file to a target, + // it gets dropped into the source code bucket to be compiled later. + BasedOn = sourcecode; + Name = "Data model version files"; + Extensions = (xcdatamodeld); + AppliesToBuildRules = yes; + + // from wrapper + IsWrapperFolder = YES; + IsFolder = YES; + IncludeInIndex = YES; + CanSetIncludeInIndex = YES; + + // Don't set encoding + IsTextFile = NO; + + UTI = "com.apple.xcode.model.data-version"; + }, + + { + Identifier = wrapper.xcmappingmodel; + Type = FileType; + // Has to base on 'sourcecode' so that when we are adding data model file to a target, + // it gets dropped into the source code bucket to be compiled later. + BasedOn = sourcecode; + Name = "Mapping model files"; + Extensions = (xcmappingmodel); + AppliesToBuildRules = yes; + + // from wrapper + IsWrapperFolder = YES; + IsFolder = NO; + IncludeInIndex = YES; + CanSetIncludeInIndex = YES; + + // Don't set encoding + IsTextFile = NO; + + UTI = "com.apple.xcode.model.data-mapping"; + }, + + { + Identifier = wrapper.xcclassmodel; + Type = FileType; + BasedOn = wrapper; + Name = "Class model files"; + Extensions = (xcclassmodel); + IsTransparent = NO; + AppliesToBuildRules = yes; + UTI = "com.apple.xcode.model.class"; + }, +) diff --git a/Sources/SWBApplePlatform/Specs/CoreData.xcspec b/Sources/SWBApplePlatform/Specs/CoreData.xcspec index 964d2e6d..61421c35 100644 --- a/Sources/SWBApplePlatform/Specs/CoreData.xcspec +++ b/Sources/SWBApplePlatform/Specs/CoreData.xcspec @@ -11,83 +11,6 @@ //===----------------------------------------------------------------------===// ( - // XDesign file types - { - Identifier = wrapper.xcdatamodel; - Type = FileType; - // Has to base on 'sourcecode' so that when we are adding data model file to a target, - // it gets dropped into the source code bucket to be compiled later. - BasedOn = sourcecode; - Name = "Data model files"; - Extensions = (xcdatamodel); - AppliesToBuildRules = yes; - - // from wrapper - IsWrapperFolder = YES; - IsFolder = NO; - IncludeInIndex = YES; - CanSetIncludeInIndex = YES; - - // Don't set encoding - IsTextFile = NO; - - UTI = "com.apple.xcode.model.data"; - }, - - { - Identifier = wrapper.xcdatamodeld; - Type = FileType; - // Has to base on 'sourcecode' so that when we are adding data model file to a target, - // it gets dropped into the source code bucket to be compiled later. - BasedOn = sourcecode; - Name = "Data model version files"; - Extensions = (xcdatamodeld); - AppliesToBuildRules = yes; - - // from wrapper - IsWrapperFolder = YES; - IsFolder = YES; - IncludeInIndex = YES; - CanSetIncludeInIndex = YES; - - // Don't set encoding - IsTextFile = NO; - - UTI = "com.apple.xcode.model.data-version"; - }, - - { - Identifier = wrapper.xcmappingmodel; - Type = FileType; - // Has to base on 'sourcecode' so that when we are adding data model file to a target, - // it gets dropped into the source code bucket to be compiled later. - BasedOn = sourcecode; - Name = "Mapping model files"; - Extensions = (xcmappingmodel); - AppliesToBuildRules = yes; - - // from wrapper - IsWrapperFolder = YES; - IsFolder = NO; - IncludeInIndex = YES; - CanSetIncludeInIndex = YES; - - // Don't set encoding - IsTextFile = NO; - - UTI = "com.apple.xcode.model.data-mapping"; - }, - - { - Identifier = wrapper.xcclassmodel; - Type = FileType; - BasedOn = wrapper; - Name = "Class model files"; - Extensions = (xcclassmodel); - IsTransparent = NO; - AppliesToBuildRules = yes; - UTI = "com.apple.xcode.model.class"; - }, { _Domain = darwin; Type = Compiler; @@ -201,6 +124,7 @@ ); }, { + _Domain = darwin; Type = Compiler; Identifier = "com.apple.compilers.model.coredatamapping"; Name = "Core Data Mapping Model Compiler (MAPC)"; diff --git a/Sources/SWBApplePlatform/Specs/CoreML.xcspec b/Sources/SWBApplePlatform/Specs/CoreML.xcspec index 65ed602c..477b7ca4 100644 --- a/Sources/SWBApplePlatform/Specs/CoreML.xcspec +++ b/Sources/SWBApplePlatform/Specs/CoreML.xcspec @@ -11,35 +11,6 @@ //===----------------------------------------------------------------------===// ( - { - Type = FileType; - Identifier = "file.mlmodel"; - BasedOn = sourcecode; - Name = "CoreML Machine Learning Model"; - Extensions = ( - mlmodel, - mlkitmodel, - ); - AppliesToBuildRules = YES; - IncludeInIndex = YES; - CanSetIncludeInIndex = YES; - UTI = "com.apple.coreml.model"; - }, - { - Type = FileType; - Identifier = "folder.mlpackage"; - BasedOn = wrapper; - Name = "CoreML Machine Learning Model Package"; - Extensions = ( - mlpackage, - ); - IsWrapperFolder = YES; - IsFolder = YES; - AppliesToBuildRules = YES; - IncludeInIndex = YES; - CanSetIncludeInIndex = YES; - UTI = "com.apple.coreml.mlpackage"; - }, { _Domain = darwin; Type = Compiler; diff --git a/Sources/SWBApplePlatform/Specs/EXUtil.xcspec b/Sources/SWBApplePlatform/Specs/EXUtil.xcspec index b93edcf8..702c0d55 100644 --- a/Sources/SWBApplePlatform/Specs/EXUtil.xcspec +++ b/Sources/SWBApplePlatform/Specs/EXUtil.xcspec @@ -29,6 +29,7 @@ }, { + _Domain = darwin; Type = Compiler; Identifier = "com.apple.compilers.appextension-plist-generator"; Name = "AppExtension plist generator"; diff --git a/Sources/SWBApplePlatform/Specs/InstrumentsPackage.xcspec b/Sources/SWBApplePlatform/Specs/InstrumentsPackage.xcspec index 6c2c6273..322975e3 100644 --- a/Sources/SWBApplePlatform/Specs/InstrumentsPackage.xcspec +++ b/Sources/SWBApplePlatform/Specs/InstrumentsPackage.xcspec @@ -11,27 +11,8 @@ //===----------------------------------------------------------------------===// ( - - { - Type = FileType; - Identifier = "com.apple.instruments.package-definition"; - BasedOn = text.xml; - Name = "Instruments Package Definition"; - Extensions = (instrpkg); - AppliesToBuildRules = Yes; - UTI = "com.apple.instruments.package-definition"; - }, - - { - Type = FileType; - Identifier = "com.apple.instruments.instrdst"; - BasedOn = wrapper; - Name = "Instruments Distribution Package"; - Extensions = (instrdst); - UTI = "com.apple.instruments.instrdst"; - }, - { + _Domain = darwin; Type = ProductType; Identifier = "com.apple.product-type.instruments-package"; Name = "Instruments Package"; @@ -56,8 +37,8 @@ HasInfoPlist = NO; }, - { + _Domain = darwin; Type = PackageType; Identifier = com.apple.package-type.instruments-package; Name = "Instruments Package"; @@ -73,7 +54,6 @@ IsLaunchable = NO; }; }, - { _Domain = darwin; Type = Compiler; @@ -158,5 +138,4 @@ }, ); }, - ) diff --git a/Sources/SWBApplePlatform/Specs/Intents.xcspec b/Sources/SWBApplePlatform/Specs/Intents.xcspec index dd071d66..dce042f6 100644 --- a/Sources/SWBApplePlatform/Specs/Intents.xcspec +++ b/Sources/SWBApplePlatform/Specs/Intents.xcspec @@ -11,21 +11,6 @@ //===----------------------------------------------------------------------===// ( - { - Type = FileType; - Identifier = "file.intentdefinition"; - BasedOn = sourcecode; - Name = "SiriKit Intent Definition"; - Extensions = ( - intentdefinition, - ); - AppliesToBuildRules = YES; - IncludeInIndex = YES; - CanSetIncludeInIndex = YES; - UTI = "com.apple.sirikit.intentdefinition"; - "FallbackAutoroutingBuildPhase" = Resources; - }, - { _Domain = darwin; Type = Compiler; diff --git a/Sources/SWBApplePlatform/Specs/RealityAssets.xcspec b/Sources/SWBApplePlatform/Specs/RealityAssets.xcspec index c7affd00..0cb734bb 100644 --- a/Sources/SWBApplePlatform/Specs/RealityAssets.xcspec +++ b/Sources/SWBApplePlatform/Specs/RealityAssets.xcspec @@ -46,20 +46,4 @@ }, ); }, - - { - AppliesToBuildRules = YES; - CanSetIncludeInIndex = YES; - Extensions = ( - rkassets, - ); - Identifier = "folder.rkassets"; - IncludeInIndex = YES; - IsFolder = YES; - IsTextFile = NO; - IsWrapperFolder = YES; - Name = "Reality Assets"; - Type = FileType; - UTI = "com.apple.rkassets"; - }, ) diff --git a/Sources/SWBApplePlatform/Specs/ReferenceObject.xcspec b/Sources/SWBApplePlatform/Specs/ReferenceObject.xcspec index 2db1c3bc..45b054b0 100644 --- a/Sources/SWBApplePlatform/Specs/ReferenceObject.xcspec +++ b/Sources/SWBApplePlatform/Specs/ReferenceObject.xcspec @@ -11,19 +11,6 @@ //===----------------------------------------------------------------------===// ( - { - Type = FileType; - Identifier = "file.referenceobject"; - BasedOn = sourcecode; - Name = "ARKit Reference Object"; - Extensions = ( - referenceobject, - ); - AppliesToBuildRules = YES; - IncludeInIndex = YES; - CanSetIncludeInIndex = YES; - UTI = "com.apple.arkit.referenceobject"; - }, { _Domain = darwin; Type = Compiler; diff --git a/Sources/SWBApplePlatform/Specs/XCAppExtensionPoints.xcspec b/Sources/SWBApplePlatform/Specs/XCAppExtensionPoints.xcspec index ca052496..4cba73a2 100644 --- a/Sources/SWBApplePlatform/Specs/XCAppExtensionPoints.xcspec +++ b/Sources/SWBApplePlatform/Specs/XCAppExtensionPoints.xcspec @@ -33,17 +33,4 @@ Options = ( ); }, - - { - Name = "XCAppExtensionPoints"; - Type = FileType; - Identifier = text.plist.xcappextensionpoints; - BasedOn = text.plist; - Extensions = ( - xcappextensionpoints - ); - IsTransparent = NO; - AppliesToBuildRules = YES; - UTI = "com.apple.dt.xcappextensionpoints"; - }, ) diff --git a/Sources/SWBApplePlatform/Specs/XCStrings.xcspec b/Sources/SWBApplePlatform/Specs/XCStrings.xcspec index 75648eb4..5c3e6e15 100644 --- a/Sources/SWBApplePlatform/Specs/XCStrings.xcspec +++ b/Sources/SWBApplePlatform/Specs/XCStrings.xcspec @@ -11,20 +11,6 @@ //===----------------------------------------------------------------------===// ( - { - Type = FileType; - Identifier = "text.json.xcstrings"; - BasedOn = text.json; - Name = "XCStrings files"; - UTI = "com.apple.xcode.xcstrings"; - Extensions = ( - xcstrings, - ); - AppliesToBuildRules = YES; - IncludeInIndex = YES; - CanSetIncludeInIndex = YES; - }, - { _Domain = darwin; Type = Compiler; diff --git a/Sources/SWBGenericUnixPlatform/CMakeLists.txt b/Sources/SWBGenericUnixPlatform/CMakeLists.txt index b0858c29..4493a42e 100644 --- a/Sources/SWBGenericUnixPlatform/CMakeLists.txt +++ b/Sources/SWBGenericUnixPlatform/CMakeLists.txt @@ -11,6 +11,7 @@ See http://swift.org/CONTRIBUTORS.txt for Swift project authors add_library(SWBGenericUnixPlatform Plugin.swift) SwiftBuild_Bundle(MODULE SWBGenericUnixPlatform FILES + Specs/FreeBSDLibtool.xcspec Specs/Unix.xcspec Specs/UnixCompile.xcspec Specs/UnixLd.xcspec