id = "apple-framework" name = "Framework" group = "Swift" icon = "project-apple-framework" description = "A Swift framework in an Xcode project." platforms = ["multiplatform", "ios", "macos"] section = "Framework & Library" # Xcode's product names: letters, digits, spaces, hyphens and underscores. name-pattern = '^[\p{L}\p{N}_][\p{L}\p{N}_ -]*$' [[requires]] program = "xcodebuild" version-args = ["-version"] min = "16.0" hint = "Install Xcode 16 or later from the App Store, then run xcode-select -s /Applications/Xcode.app." [[fields]] id = "team" label = "Team:" type = "text" pattern = '^([A-Z0-9]{10})?$' placeholder = "None" hint = "The Team ID to sign with; empty signs to run locally." remember = true [[fields]] id = "org" label = "Organization Identifier:" type = "text" pattern = '^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*$' default = "com.example" remember = true [[fields]] id = "bundle" label = "Bundle Identifier:" type = "text" readonly = true default = "{{org}}.{{name|bundle}}" [[fields]] id = "language" label = "Language:" type = "choice" segmented = true options = ["Swift"] default = "Swift" [[fields]] id = "testing" label = "Testing System:" type = "choice" options = [ { value = "swift-testing", label = "Swift Testing" }, { value = "xctest", label = "XCTest" }, { value = "none", label = "None" }, ] default = "swift-testing" [[files]] path = "{{name}}/{{name|c99}}.swift" content = ''' /// A greeting for `name`. Replace it with your framework's API. public func greeting(for name: String) -> String { "Hello, \(name)!" } ''' [[files]] path = "{{name}}Tests/{{name}}Tests.swift" when = { testing = "swift-testing" } content = ''' import Testing @testable import {{name|c99}} struct {{name|c99}}Tests { @Test func greets() { #expect(greeting(for: "World") == "Hello, World!") } } ''' [[files]] path = "{{name}}Tests/{{name}}Tests.swift" when = { testing = "xctest" } content = ''' import XCTest @testable import {{name|c99}} final class {{name|c99}}Tests: XCTestCase { func testGreeting() { XCTAssertEqual(greeting(for: "World"), "Hello, World!") } } ''' [[files]] path = ".gitignore" content = ''' xcuserdata/ DerivedData/ .build/ *.xcuserstate .DS_Store # Written by the IDE with paths of this machine. buildServer.json ''' [[files]] path = "{{name}}.xcodeproj/project.xcworkspace/contents.xcworkspacedata" content = ''' ''' [[files]] path = "{{name}}.xcodeproj/project.xcworkspace/contents.xcworkspacedata" content = ''' ''' [[files]] path = "{{name}}.xcodeproj/xcshareddata/xcschemes/{{name}}.xcscheme" content = ''' {{#if testing!=none}} {{/if}} ''' # Object ids: 0A… the project, 1A… the framework target, 2A… unit tests. [[files]] path = "{{name}}.xcodeproj/project.pbxproj" content = ''' // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 77; objects = { {{#if testing!=none}} /* Begin PBXBuildFile section */ 2A000000000000000000000C /* {{name|c99}}.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0000000000000000000002 /* {{name|c99}}.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 2A0000000000000000000001 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0A0000000000000000000000 /* Project object */; proxyType = 1; remoteGlobalIDString = 1A0000000000000000000000; remoteInfo = "{{name}}"; }; /* End PBXContainerItemProxy section */ {{/if}} /* Begin PBXFileReference section */ 1A0000000000000000000002 /* {{name|c99}}.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = "{{name|c99}}.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; {{#if testing!=none}} 2A0000000000000000000002 /* {{name}}Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "{{name}}Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; {{/if}} /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ 1A0000000000000000000003 /* {{name}} */ = { isa = PBXFileSystemSynchronizedRootGroup; path = "{{name}}"; sourceTree = ""; }; {{#if testing!=none}} 2A0000000000000000000003 /* {{name}}Tests */ = { isa = PBXFileSystemSynchronizedRootGroup; path = "{{name}}Tests"; sourceTree = ""; }; {{/if}} /* End PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFrameworksBuildPhase section */ 1A0000000000000000000004 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; {{#if testing!=none}} 2A0000000000000000000004 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 2A000000000000000000000C /* {{name|c99}}.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; {{/if}} /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 0A0000000000000000000004 = { isa = PBXGroup; children = ( 1A0000000000000000000003 /* {{name}} */, {{#if testing!=none}} 2A0000000000000000000003 /* {{name}}Tests */, {{/if}} 0A0000000000000000000005 /* Products */, ); sourceTree = ""; }; 0A0000000000000000000005 /* Products */ = { isa = PBXGroup; children = ( 1A0000000000000000000002 /* {{name|c99}}.framework */, {{#if testing!=none}} 2A0000000000000000000002 /* {{name}}Tests.xctest */, {{/if}} ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 1A000000000000000000000A /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 1A0000000000000000000000 /* {{name}} */ = { isa = PBXNativeTarget; buildConfigurationList = 1A0000000000000000000005 /* Build configuration list for PBXNativeTarget "{{name}}" */; buildPhases = ( 1A000000000000000000000A /* Headers */, 1A0000000000000000000006 /* Sources */, 1A0000000000000000000004 /* Frameworks */, 1A0000000000000000000007 /* Resources */, ); buildRules = ( ); dependencies = ( ); fileSystemSynchronizedGroups = ( 1A0000000000000000000003 /* {{name}} */, ); name = "{{name}}"; packageProductDependencies = ( ); productName = "{{name}}"; productReference = 1A0000000000000000000002 /* {{name|c99}}.framework */; productType = "com.apple.product-type.framework"; }; {{#if testing!=none}} 2A0000000000000000000000 /* {{name}}Tests */ = { isa = PBXNativeTarget; buildConfigurationList = 2A0000000000000000000005 /* Build configuration list for PBXNativeTarget "{{name}}Tests" */; buildPhases = ( 2A0000000000000000000006 /* Sources */, 2A0000000000000000000004 /* Frameworks */, 2A0000000000000000000007 /* Resources */, ); buildRules = ( ); dependencies = ( 2A000000000000000000000B /* PBXTargetDependency */, ); fileSystemSynchronizedGroups = ( 2A0000000000000000000003 /* {{name}}Tests */, ); name = "{{name}}Tests"; packageProductDependencies = ( ); productName = "{{name}}Tests"; productReference = 2A0000000000000000000002 /* {{name}}Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; {{/if}} /* End PBXNativeTarget section */ /* Begin PBXProject section */ 0A0000000000000000000000 /* Project object */ = { isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1600; LastUpgradeCheck = 1600; TargetAttributes = { 1A0000000000000000000000 = { CreatedOnToolsVersion = 16.0; }; {{#if testing!=none}} 2A0000000000000000000000 = { CreatedOnToolsVersion = 16.0; }; {{/if}} }; }; buildConfigurationList = 0A0000000000000000000001 /* Build configuration list for PBXProject "{{name}}" */; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 0A0000000000000000000004; minimizedProjectReferenceProxies = 1; preferredProjectObjectVersion = 77; productRefGroup = 0A0000000000000000000005 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 1A0000000000000000000000 /* {{name}} */, {{#if testing!=none}} 2A0000000000000000000000 /* {{name}}Tests */, {{/if}} ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 1A0000000000000000000007 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; {{#if testing!=none}} 2A0000000000000000000007 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; {{/if}} /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 1A0000000000000000000006 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; {{#if testing!=none}} 2A0000000000000000000006 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; {{/if}} /* End PBXSourcesBuildPhase section */ {{#if testing!=none}} /* Begin PBXTargetDependency section */ 2A000000000000000000000B /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 1A0000000000000000000000 /* {{name}} */; targetProxy = 2A0000000000000000000001 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ {{/if}} /* Begin XCBuildConfiguration section */ 0A0000000000000000000002 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu17; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); {{#if platform!=macos}} IPHONEOS_DEPLOYMENT_TARGET = 18.0; {{/if}} LOCALIZATION_PREFERS_STRING_CATALOGS = YES; {{#if platform!=ios}} MACOSX_DEPLOYMENT_TARGET = 15.0; {{/if}} MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; ONLY_ACTIVE_ARCH = YES; {{#if platform=ios}} SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; {{/if}} {{#if platform=macos}} SDKROOT = macosx; {{/if}} {{#if platform=multiplatform}} SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; SUPPORTS_MACCATALYST = NO; TARGETED_DEVICE_FAMILY = "1,2"; {{/if}} SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; 0A0000000000000000000003 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu17; {{#if platform!=macos}} IPHONEOS_DEPLOYMENT_TARGET = 18.0; {{/if}} LOCALIZATION_PREFERS_STRING_CATALOGS = YES; {{#if platform!=ios}} MACOSX_DEPLOYMENT_TARGET = 15.0; {{/if}} MTL_ENABLE_DEBUG_INFO = NO; {{#if platform=ios}} SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; {{/if}} {{#if platform=macos}} SDKROOT = macosx; {{/if}} {{#if platform=multiplatform}} SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; SUPPORTS_MACCATALYST = NO; TARGETED_DEVICE_FAMILY = "1,2"; {{/if}} SWIFT_COMPILATION_MODE = wholemodule; }; name = Release; }; 1A0000000000000000000008 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; {{#if platform=macos}} COMBINE_HIDPI_IMAGES = YES; {{/if}} CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = "{{team}}"; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; {{#if platform=ios}} LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); {{/if}} {{#if platform=macos}} LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/Frameworks", ); {{/if}} {{#if platform=multiplatform}} LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/Frameworks", ); {{/if}} MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "{{bundle}}"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_INSTALL_OBJC_HEADER = NO; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; 1A0000000000000000000009 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; {{#if platform=macos}} COMBINE_HIDPI_IMAGES = YES; {{/if}} CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = "{{team}}"; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; {{#if platform=ios}} LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); {{/if}} {{#if platform=macos}} LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/Frameworks", ); {{/if}} {{#if platform=multiplatform}} LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/Frameworks", ); {{/if}} MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "{{bundle}}"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_INSTALL_OBJC_HEADER = NO; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; {{#if testing!=none}} 2A0000000000000000000008 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = "{{team}}"; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "{{bundle}}Tests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; }; name = Debug; }; 2A0000000000000000000009 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = "{{team}}"; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "{{bundle}}Tests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; }; name = Release; }; {{/if}} /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 0A0000000000000000000001 /* Build configuration list for PBXProject "{{name}}" */ = { isa = XCConfigurationList; buildConfigurations = ( 0A0000000000000000000002 /* Debug */, 0A0000000000000000000003 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 1A0000000000000000000005 /* Build configuration list for PBXNativeTarget "{{name}}" */ = { isa = XCConfigurationList; buildConfigurations = ( 1A0000000000000000000008 /* Debug */, 1A0000000000000000000009 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; {{#if testing!=none}} 2A0000000000000000000005 /* Build configuration list for PBXNativeTarget "{{name}}Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( 2A0000000000000000000008 /* Debug */, 2A0000000000000000000009 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; {{/if}} /* End XCConfigurationList section */ }; rootObject = 0A0000000000000000000000 /* Project object */; } '''