Docs/Examples
Examples
These are a bunch of real world examples of XcodeGen project specs. Feel free to add your own via PR.
- toshi0383/Bitrise-iOS
- johndpope/swift-models
- atelier-socle/AppRepositoryTemplate
- atelier-socle/FrameworkRepositoryTemplate
- scelis/XcodeGen-TestStickers
- minvws/nl-covid19-notification-app-ios
- pvinis/react-native-xcodegen
- covid19cz/erouska-ios
- markst/hotreloading-vscode-ios
- MultiPlatformApp - A modern SwiftUI multi-platform (iOS & macOS) example featuring a modular 3-tier architecture and shared logic.
---
Docs/FAQ
Frequently asked questions
- Can I still check in my project
- Can I use CocoaPods
- Can I use Crashlytics
- How do I setup code signing
Can I still check in my project
Absolutely. You will get the most out of XcodeGen by adding your project to your
.gitignore, as this way you avoid merge conflicts. But you can also check it in as a halfway step.>Note that you can run
xcodegen as a step in your build process on CI.What happens when I switch branches
If files were added or removed in the new checkout you will most likely need to run
xcodegen again so that your project will reference all your files.It's recommended to set up some git hooks to automate the process:
- run xcodegen generate --use-cache on the following hooks. This will make sure the project is up to date when checking out, merging and rebasing
- post-checkout
- post-rewrite
- post-merge
- run xcodegen cache on pre-commit. This will make sure that when switching branches the cache will be updated in case you made local changes, or are ammending a commit that added a new file.
Can I use CocoaPods
Yes, you will just need to run
pod install after the project is generated to integrate Cocoapods changes.It's recommended to use a combination of --use-cache and the postGenCommand option which will only generate the project if required, and then only run pod install if the project has been regenerated.
Can I use Crashlytics
Yes, but you need to use a little trick when using CocoaPods. Add this script in your
Podfile:``ruby:Podfile
// Your dependencies
pod 'Firebase/Crashlytics'
script_phase name: 'Run Firebase Crashlytics',
shell_path: '/bin/sh',
script: '"${PODS_ROOT}/FirebaseCrashlytics/run"',
input_files: ['$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)']
This script will be added after[CP] Embed Pods Frameworks.DEVELOPMENT_TEAMHow do I setup code signing
At the moment there are no special options for code signing in XcodeGen, and this must be configured via regular build settings. For code signing to work, you need to tell Xcode which development team to use. This requires setting the
and possiblyCODE_SIGN_STYLEbuild settings. See Configuring build settings for how to do that${SOME_VARIABLE}---
Docs/ProjectSpec
Project Spec
The project spec can be written in either YAML or JSON. All the examples below use YAML.
- [x] required property
- [ ] optional propertySome of the YAML examples below don't show all the required properties. For example not all target examples will have a platform or type, even though they are required.
You can also use environment variables in your configuration file, by using
in a string.LastUpgradeCheck- Project
- Include
- Options
- GroupOrdering
- FileType
- Breakpoints
- Breakpoint Action
- Configs
- Setting Groups
- Settings
- Target
- Product Type
- Platform
- Supported Destinations
- Sources
- Target Source
- Dependency
- Config Files
- Plist
- Build Tool Plug-ins
- Build Script
- Build Rule
- Target Scheme
- Legacy Target
- Aggregate Target
- Target Template
- Scheme
- Build
- Common Build Action options
- Execution Action
- Run Action
- Test Action
- Test Target
- Other Parameters
- Testable Target Reference
- Archive Action
- Simulate Location
- Scheme Management
- Environment Variable
- Test Plan
- Scheme Template
- Swift Package
- Remote Package
- Local Package
- Project ReferenceProject
- [x] name: String - Name of the generated project
- [ ] include: Include - One or more paths to other specs
- [ ] options: Options - Various options to override default behaviour
- [ ] attributes: [String: Any] - The PBXProject attributes. This is for advanced use. If no value is set for, it will be defaulted to{"LastUpgradeCheck": "XcodeVersion"}withxcodeVersionbeing set by Options.xcodeVersionDebug
- [ ] breakpoints: Breakpoints - Add shared breakpoints to the generated project
- [ ] configs: Configs - Project build configurations. Defaults toandReleaseconfigs.xcconfig
- [ ] configFiles: Config Files -files per configtemplate
- [ ] settings: Settings - Project specific settings. Default base and config type settings will be applied first before any settings defined here
- [ ] settingGroups: Setting Groups - Setting groups mapped by name
- [ ] targets: String: [Target] - The list of targets in the project mapped by name
- [ ] fileGroups: [String] - A list of paths to add to the root of the project. These aren't files that will be included in your targets, but that you'd like to include in the project hierarchy anyway. For example a folder of xcconfig files that aren't already added by any target sources, or a Readme file.
- [ ] schemes: Scheme - A list of schemes by name. This allows more control over what is found in Target Scheme
- [ ] schemeTemplates: String: [Scheme Template] - a list of schemes that can be used as templates for actual schemes which reference them via aproperty. They can be used to extract common scheme settings. Works great in combination withinclude.template
- [ ] targetTemplates: String: [Target Template] - a list of targets that can be used as templates for actual targets which reference them via aproperty. They can be used to extract common target settings. Works great in combination withinclude.
- [ ] packages: String: [Swift Package] - a map of Swift packages by name.
- [ ] projectReferences: String: [Project Reference] - a map of project references by nameInclude
One or more specs can be included in the project spec. This can be used to split your project spec into multiple files, for easier structuring or sharing between multiple specs. Included specs can also include other specs and so on.
Include can either be a list of includes or a single include. They will be merged in order and then the current spec will be merged on top.
An include can be provided via a string (the path) or an object of the form:
Include Object
- [x] path: String - The path to the included file.
- [ ] relativePaths: Bool - Dictates whether the included spec specifies paths relative to itself (the default) or the root spec file.
- [ ] enable: Bool - Dictates whether the specified spec should be included or not. You can also specify it by environment variable.
include:
- includedFile.yml
- path: path/to/includedFile.yml
relativePaths: false
enable: ${INCLUDE_ADDITIONAL_YAML}
By default specs are merged additively. That is for every value::REPLACE- if existing value and new value are both dictionaries merge them and continue down the hierarchy
- if existing value and new value are both an array then add the new value to the end of the array
- otherwise replace the existing value with the new valueThis merging behaviour can be overridden on a value basis. If you wish to replace a whole value (set a new dictionary or new array instead of merging them) then just affix
to the key
include:
- base.yml
name: CustomSpec
targets:
MyTarget: # target lives in base.yml
sources:REPLACE:
- my_new_sources
Note that target names can also be changed by adding anameproperty to a target.Carthage/BuildOptions
- [ ] minimumXcodeGenVersion: String - The minimum version of XcodeGen required.
- [ ] carthageBuildPath: String - The path to the carthage build directory. Defaults to. This is used when specifying target carthage dependenciescarthage
- [ ] carthageExecutablePath: String - The path to the carthage executable. Defaults to. You can specify when you use custom built or locally installed Carthage using Mint, for example.true
- [ ] createIntermediateGroups: Bool - If this is specified and set to, then intermediate groups will be created for every path component between the folder containing the source and next existing group it finds or the base path. For example, when enabled if a source path is specified asVendor/Foo/Hello.swift, the groupVendorwill created as a parent of theFoogroup. This can be overridden in a specific Target sourcePRODUCT_BUNDLE_IDENTIFIER
- [ ] bundleIdPrefix: String - If this is specified then any target that doesn't have an(via all levels of build settings) will get an autogenerated one by combiningbundleIdPrefixand the target name:bundleIdPrefix.name. The target name will be stripped of all characters that aren't alphanumerics, hyphens, or periods. Underscores will be replaced with hyphens.all
- [ ] settingPresets: String - This controls the settings that are automatically applied to the project and its targets. These are the same build settings that Xcode would add when creating a new project. Project settings are applied by config type. Target settings are applied by the product type and platform. By default this is set toall
-: project and target settingsproject
-: only project settingstargets
-: only target settingsnone
-: no settings are automatically applieden
- [ ] developmentLanguage: String - Sets the development language of the project. Defaults to0910
- [ ] usesTabs: Bool - If this is specified, the Xcode project will override the user's setting determining whether or not tabs or spaces should be used in the project.
- [ ] indentWidth: Int - If this is specified, the Xcode project will override the user's setting for indent width in number of spaces.
- [ ] tabWidth: Int - If this is specified, the Xcode project will override the user's setting for indent width in number of spaces.
- [ ] xcodeVersion: String - The version of Xcode. This defaults to the latest version periodically. You can specify it in the formator9.1xcode16_0
- [ ] projectFormat: String - The version of Xcode project. By default this is set toxcode16_3
-: Xcode 16.3xcode16_0
-: Xcode 16.0xcode15_3
-: Xcode 15.3xcode15_0
-: Xcode 15.0xcode14_0
-: Xcode 14.0IPHONEOS_DEPLOYMENT_TARGET- [ ] deploymentTarget: [Platform: String] - A project wide deployment target can be specified for each platform otherwise the default SDK version in Xcode will be used. This will be overridden by any custom build settings that set the deployment target eg
. Target specific deployment targets can also be set with Target.deploymentTarget.missingConfigs
- [ ] disabledValidations: [String] - A list of validations that can be disabled if they're too strict for your use case. By default this is set to an empty array. Currently these are the available options:
-: Disable errors for configurations in yaml files that don't exist in the project itself. This can be useful if you include the same yaml file in different projectsmissingConfigFiles
-: Disable checking for the existence of configuration files. This can be useful for generating a project in a context where config files are not available.missingTestPlans
-: Disable checking if test plan paths exist. This can be useful if your test plans haven't been created yet.none
- [ ] defaultConfig: String - The default configuration for command line builds from Xcode. If the configuration provided here doesn't match one in your configs key, XcodeGen will fail. If you don't set this, the first configuration alphabetically will be chosen.
- [ ] groupSortPosition: String - Where groups are sorted in relation to other files. Either:
-- sorted alphabetically with all the other filestop
-- at the top, before filesbottom
-(default) - at the bottom, after other filestrue
- [ ] groupOrdering: [[GroupOrdering]](#groupOrdering) - An order of groups.
- [ ] transitivelyLinkDependencies: Bool - If this isthen targets will link to the dependencies of their target dependencies. If a target should embed its dependencies, such as application and test bundles, it will embed these transitive dependencies as well. Some complex setups might want to set this tofalseand explicitly specify dependencies at every level. Targets can override this with Target.transitivelyLinkDependencies. Defaults tofalse.true
- [ ] generateEmptyDirectories: Bool - If this isthen empty directories will be added to project too else will be missed. Defaults tofalse.true
- [ ] findCarthageFrameworks: Bool - When this is set to, all the individual frameworks for Carthage framework dependencies will automatically be found. This property can be overridden individually for each carthage dependency - for more details see See findFrameworks in the Dependency section. Defaults tofalse.Packages
- [ ] localPackagesGroup: String - The group name that local packages are put into. This defaults to. Use""to specify the project root.pod install
- [ ] fileTypes: String: [FileType] - A list of default file options for specific file extensions across the project. Values in Sources will overwrite these settings.
- [ ] preGenCommand: String - A bash command to run before the project has been generated. If the project isn't generated due to no changes when using the cache then this won't run. This is useful for running things like generating resources files before the project is regenerated.
- [ ] postGenCommand: String - A bash command to run after the project has been generated. If the project isn't generated due to no changes when using the cache then this won't run. This is useful for running things likeonly if the project is actually regenerated.false
- [ ] useBaseInternationalization: Bool If this isand your project does not include resources located in a Base.lproj directory thenBasewill not be included in the projects 'known regions'. The default value istrue."../../"
- [ ] schemePathPrefix: String - A path prefix for relative paths in schemes, such as StoreKitConfiguration. The default is, which is suitable for non-workspace projects. For use in workspaces, use"../".group
- [ ] defaultSourceDirectoryType: String - When a Target source doesn't specify a type and is a directory, this is the type that will be used. If nothing is specified for either thenwill be used.group
-(default)folder
-syncedFolder
-: Can be used starting from projectFormatxcode16_0
options:
deploymentTarget:
watchOS: "2.0"
tvOS: "10.0"
postGenCommand: pod install
GroupOrdering
Describe an order of groups. Available parameters:
- [ ] pattern: String - A group name pattern. Can be just a single string and also can be a regex pattern. Optional option, if you don't set it, it will pattern for the main group, i.e. the project.
- [ ] order: [String] - An order of groups.
options:
groupOrdering:
- order: [Sources, Resources, Tests, Support files, Configurations]
- pattern: '^.*Screen$'
order: [View, Presenter, Interactor, Entities, Assembly]
In this example, we set up the order of two groups. First one is the main group, i.e. the project, note that in this case, we shouldn't setpatternoption and the second group order is for groups whose names ends withScreen.FileFileType
Default settings for file extensions. See Sources for more documentation on properties. If you overwrite an extension that XcodeGen already provides by default, you will need to provide all the settings.- [ ] file: Bool - Whether this extension should be treated like a file. Defaults to true.
- [ ] buildPhase: String - The default build phase.
- [ ] attributes: [String] - Additional settings attributes that will be applied to any build files.
- [ ] resourceTags: [String] - On Demand Resource Tags that will be applied to any resources. This also adds to the project attribute's knownAssetTags.
- [ ] compilerFlags: [String] - A list of compiler flags to add.Breakpoints
- [x] type: String - Breakpoint type
-: file breakpointException
-: exception breakpointSwiftError
-: swift error breakpointOpenGLError
-: OpenGL breakpointSymbolic
-: symbolic breakpointIDEConstraintError
-: IDE constraint breakpointIDETestFailure
-: IDE test failure breakpointRuntimeIssue
-: Runtime issue breakpointtrue
- [ ] enabled: Bool - Indicates whether it should be active. Default to0
- [ ] ignoreCount: Int - Indicates how many times it should be ignored before stopping, Default tofalse
- [ ] continueAfterRunningActions: Bool - Indicates if should automatically continue after evaluating actions, Default toAll
- [ ] path: String - Breakpoint file path (only required by file breakpoints)
- [ ] line: Int - Breakpoint line (only required by file breakpoints)
- [ ] symbol: String - Breakpoint symbol (only used by symbolic breakpoints)
- [ ] module: String - Breakpoint module (only used by symbolic breakpoints)
- [ ] scope: String - Breakpoint scope (only used by exception breakpoints)
-Objective-C
-(default)C++
-throw
- [ ] stopOnStyle: String - Indicates if should stop on style (only used by exception breakpoints)
-(default)catch
-
- [ ] condition: String - Breakpoint condition
- [ ] actions: [Breakpoint Action] - breakpoint actions
breakpoints:
- type: ExceptionBreakpoint
enabled: true
ignoreCount: 0
continueAfterRunningActions: false
#### Breakpoint ActionDebuggerCommand- [x] type: String - Breakpoint action type
-: execute debugger commandLog
-: log messageShellCommand
-: execute shell commandGraphicsTrace
-: capture GPU frameAppleScript
-: execute AppleScriptSound
-: play soundconsole
- [ ] command: String - Debugger command (only used by debugger command breakpoint action)
- [ ] message: String - Log message (only used log message breakpoint action)
- [ ] conveyanceType: String - Conveyance type (only used by log message breakpoint action)
-: log message to console (default)speak
-: speak messagefalse
- [ ] path: String - Shell command file path (only used by shell command breakpoint action)
- [ ] arguments: String - Shell command arguments (only used by shell command breakpoint action)
- [ ] waitUntilDone: Bool - Indicates whether it should wait until done (only used by shell command breakpoint action). Default toBasso
- [ ] script: String - AppleScript (only used by AppleScript breakpoint action)
- [ ] sound: String - Sound name (only used by sound breakpoint action)
-(default)Blow
-Bottle
-Frog
-Funk
-Glass
-Hero
-Morse
-Ping
-Pop
-Purr
-Sosumi
-Submarine
-Tink
-
actions:
- type: Sound
sound: Blow
debugConfigs
Each config maps to a build type of either
orreleasewhich will then apply defaultBuild Settingsto the project. Any value other thandebugorrelease(for examplenone), will mean no defaultBuild Settingswill be applied to the project.
configs:
Debug: debug
Beta: release
AppStore: release
If no configs are specified, defaultDebugandReleaseconfigs will be created automatically.Build SettingsSetting Groups
Setting groups are named groups of
that can be reused elsewhere. Each preset is a Settings schema, so can include othergroupsor define settings byconfigs.
settingGroups:
preset_generic:
CUSTOM_SETTING: value_custom
preset_debug:
BUILD_SETTING: value_debug
preset_release:
base:
BUILD_SETTING: value_release
preset_all:
groups:
- preset_generic
configs:
debug:
groups:
- preset_debug
release:
groups:
- preset_release
targets:
Application:
settings:
groups:
- preset_all
Build SettingsSettings
Settings correspond to
tab in Xcode. To display Setting Names instead of Setting Titles, selectEditor -> Show Setting Namesin Xcode.Build SettingsSettings can either be a simple map of
[String:String], or can be more advanced with the following properties:Staging Debug- [ ] groups: [String] - List of Setting Groups to include and merge
- [ ] configs: String:[Settings] - Mapping of config name to a settings spec. These settings will only be applied for that config. Each key will be matched to any configs that contain the key and is case insensitive. So if you hadandStaging Release, you could apply settings to both of them usingstaging. However if a config name is an exact match to a config it won't be applied to any others. egReleasewill be applied to configReleasebut notStaging Release
- [ ] base: [String:String] - Used to specify default settings that apply to any config
settings:
GENERATE_INFOPLIST_FILE: NO
CODE_SIGNING_ALLOWED: NO
WRAPPER_EXTENSION: bundle
Don't mix simple maps withgroups,baseandconfigs.groups
If,base,configsare used then simple maps is silently ignored.CURRENT_PROJECT_VERSIONIn this example,
will be set, butMARKETING_VERSIONwill be ignored:
settings:
MARKETING_VERSION: 100.0.0
base:
CURRENT_PROJECT_VERSION: 100.0
settings:
base:
PRODUCT_NAME: XcodeGenProduct
configs:
debug:
CODE_SIGN_IDENTITY: iPhone Developer
PRODUCT_BUNDLE_IDENTIFIER: com.tomtom.debug_app
release:
CODE_SIGN_IDENTITY: iPhone Distribution
PRODUCT_BUNDLE_IDENTIFIER: com.tomtom.app
PROVISIONING_PROFILE_SPECIFIER: "Xcodegen Release"
groups:
- my_settings
Settings are merged in the following order:groups,base,configs(simple maps are ignored).9.2Target
- [x] type: Product Type - Product type of the target
- [x] platform: Platform - Platform of the target
- [ ] supportedDestinations: [Supported Destinations] - List of supported platform destinations for the target.
- [ ] deploymentTarget: String - The deployment target (eg). If this is not specified the value from the project set in Options.deploymentTarget.PLATFORMwill be used..xcconfig
- [ ] sources: Sources - Source directories of the target
- [ ] configFiles: Config Files -files per configINFOPLIST_FILE
- [ ] settings: Settings - Target specific build settings. Default platform and product type settings will be applied first before any custom settings defined here. Other context dependant settings will be set automatically as well:
-: If it doesn't exist your sources will be searched forInfo.plistfiles and the first one found will be used for this settingFRAMEWORK_SEARCH_PATHS
-: If carthage framework dependencies are used, the platform build path will be added to this settingOTHER_LDFLAGS
-: SeerequiresObjCLinkingbelowTEST_TARGET_NAME
-: for ui tests that target an applicationTEST_HOST
-: for unit tests that target an applicationInfo.plist
- [ ] dependencies: [Dependency] - Dependencies for the target
- [ ] info: Plist - If defined, this will generate and write anto the specified path and use it by setting theINFOPLIST_FILEbuild setting for every configuration, unlessINFOPLIST_FILEis already defined in settings for this configuration. The following properties are generated automatically if appropriate, the rest will have to be provided.CFBundleIdentifier
-CFBundleInfoDictionaryVersion
-CFBundleExecutable
-Not generated for targets of type bundleCFBundleName
-CFBundleDevelopmentRegion
-CFBundleShortVersionString
-CFBundleVersion
-CFBundlePackageType
-.entitlements
- [ ] entitlements: Plist - If defined this will generate and write afile, and use it by settingCODE_SIGN_ENTITLEMENTSbuild setting for every configuration. All properties must be provided${target_name}
- [ ] templates: [String] - A list of Target Templates referenced by name that will be merged with the target in order. Any instances ofwithin these templates will be replaced with the target name.${attributeName}
- [ ] templateAttributes: [String: String] - A list of attributes where each instance ofwithin the templates listed intemplateswill be replaced with the value specified..transitivelyLinkDependencies
- [ ] transitivelyLinkDependencies: Bool - If this is not specified the value from the project set in Optionswill be used.true
- [ ] directlyEmbedCarthageDependencies: Bool - If this isCarthage framework dependencies will be embedded using anEmbed Frameworksbuild phase instead of thecopy-frameworksscript. Defaults totruefor all targets except iOS/tvOS/watchOS Applications.true
- [ ] requiresObjCLinking: Bool - If this isany targets that link to this target will have-ObjCadded to theirOTHER_LDFLAGS. This is required if a static library has any categories or extensions on Objective-C code. See this guide for more details. Defaults totrueiftypeislibrary.static. If you are 100% sure you don't have categories or extensions on Objective-C code (pure Swift with no use of Foundation/UIKit) you can set this tofalse, otherwise it's best to leave it alone.true
- [ ] onlyCopyFilesOnInstall: Bool – If this is, theEmbed FrameworksandEmbed App Extensions(if available) build phases will have the "Copy only when installing" chekbox checked. Defaults tofalse.TargetAttributes
- [ ] buildToolPlugins: [Build Tool Plug-ins] - Commands for the build system that run automatically during the build.
- [ ] preBuildScripts: [Build Script] - Build scripts that run before any other build phases
- [ ] postCompileScripts: [Build Script] - Build scripts that run after the Compile Sources phase
- [ ] postBuildScripts: [Build Script] - Build scripts that run after any other build phases
- [ ] buildRules: [Build Rule] - Custom build rules
- [ ] scheme: Target Scheme - Generated scheme with tests or config variants
- [ ] legacy: Legacy Target - When present, opt-in to make an Xcode "External Build System" legacy target instead.
- [ ] attributes: [String: Any] - This sets values in the project. It is merged withattributesfrom the project and anything automatically added by XcodeGen, with any duplicate values being override by values specified here. This is for advanced use only. Properties that are already set include:DevelopmentTeam
-: if all configurations have the sameDEVELOPMENT_TEAMsettingProvisioningStyle
-: if all configurations have the sameCODE_SIGN_STYLEsettingTestTargetID
-: if all configurations have the sameTEST_TARGET_NAMEsettingtrue
- [ ] putResourcesBeforeSourcesBuildPhase: Bool - If this istheCopy Resourcesstep will be placed before theCompile Sourcesbuild step.applicationProduct Type
This will provide default build settings for a certain product type. It can be any of the following:
-
application.on-demand-install-capable
-application.messages
-application.watchapp
-application.watchapp2
-application.watchapp2-container
-app-extension
-app-extension.intents-service
-app-extension.messages
-app-extension.messages-sticker-pack
-bundle
-bundle.ocunit-test
-bundle.ui-testing
-bundle.unit-test
-extensionkit-extension
-framework
-instruments-package
-library.dynamic
-library.static
-framework.static
-tool
-tv-app-extension
-watchkit-extension
-watchkit2-extension
-xcode-extension
-driver-extension
-system-extension
-xpc-service
-
-""(used for legacy targets)autoPlatform
This will provide default build settings for a certain platform. It can be any of the following:
-
(available only when we usesupportedDestinations)iOS
-tvOS
-macOS
-watchOS
-visionOS
-(visionOSdoesn't support Carthage usage)autoNote that when we use supported destinations with Xcode 14+ we can avoid the definition of platform that fallbacks to the
value.deploymentTargetMulti Platform targets
You can also specify an array of platforms. This will generate a target for each platform.
Ifis specified for a multi platform target, it can have different values per platform similar to how it's defined in Options. See below for an example.${platform}
If you reference the stringanywhere within the target spec, that will be replaced with the platform._${platform}The generated targets by default will have a suffix of
applied, you can change this by specifying aplatformSuffixorplatformPrefix.PRODUCT_NAMEIf no
build setting is specified for a target, this will be set to the target name, so that this target can be imported under a single name.
targets:
MyFramework:
sources: MyFramework
platform: [iOS, tvOS]
deploymentTarget:
iOS: 9.0
tvOS: 10.0
type: framework
settings:
base:
INFOPLIST_FILE: MyApp/Info.plist
PRODUCT_BUNDLE_IDENTIFIER: com.myapp
MY_SETTING: platform ${platform}
groups:
- ${platform}
The above will generate 2 targets namedMyFramework_iOSandMyFramework_tvOS, with all the relevant platform build settings. They will both have aPRODUCT_NAMEofMyFrameworkiOSSupported Destinations
This will provide a mix of default build settings for the chosen platform destinations. It can be any of the following:
-
tvOS
-macOS
-macCatalyst
-visionOS
-watchOS
-
targets:
MyFramework:
type: framework
supportedDestinations: [iOS, tvOS]
deploymentTarget:
iOS: 9.0
tvOS: 10.0
sources:
- path: MySources
inferDestinationFiltersByPath: true
- path: OtherSources
destinationFilters: [iOS]
Note that the definition of supported destinations can be applied to almost every type of bundle making everything more easy to manage (app targets, unit tests, UI tests etc). App targets currently do not support the watchOS destination. Create a separate target usingplatformfor watchOS apps. See Apple's Configuring a multiplatform app for details..lprojSources
Specifies the source directories for a target. This can either be a single source or a list of sources. Applicable source files, resources, headers, and
files will be parsed appropriately.createIntermediateGroupsA source can be provided via a string (the path) or an object of the form:
#### Target Source
- [x] path: String - The path to the source file or directory.
- [ ] name: String - Can be used to override the name of the source file or directory. By default the last component of the path is used for the name
- [ ] group: String - Can be used to override the parent group of the source file or directory. By default a group is created at the root with the name of this source file or directory or intermediate groups are created ifis set totrue. Multiple groups can be created by separating each one using a/. If multiple target sources share the samegroup, they will be put together in the same parent group.path
- [ ] compilerFlags: [String] or String - A list of compilerFlags to add to files under this specific path provided as a list or a space delimited string. Defaults to empty.
- [ ] excludes: [String] - A list of global patterns) representing the files to exclude. These rules are relative toand _not the directory whereproject.ymlresides_. XcodeGen uses Bash 4's Glob behaviors where globstar () is enabled.excludes
- [ ] includes: [String] - A list of global patterns in the same format asrepresenting the files to include. These rules are relative topathand _not the directory whereproject.ymlresides_. If excludes is present and file conflicts with includes, excludes will override the includes behavior.syncedFolder
- [ ] explicitFolders: [String] - Only valid fortype. A list of global patterns in the same format asexcludesto child folders that Xcode should treat as folder references./<supportedDestination>/
- [ ] destinationFilters: [Supported Destinations] - List of supported platform destinations the files should filter to. Defaults to all supported destinations.
- [ ] inferDestinationFiltersByPath: Bool - This is a convenience filter that helps you to filter the files if their paths match these patternsor_<supportedDestination>.swift. Note, if you usedestinationFiltersthis flag will be ignored.Info.plist
- [ ] createIntermediateGroups: Bool - This overrides the value in Options.
- [ ] optional: Bool - Disable missing path check. Defaults to false.
- [ ] buildPhase: String - This manually sets the build phase this file or files in this directory will be added to, otherwise XcodeGen will guess based on the file extension. Note thatfiles will never be added to any build phases, no matter what this setting is. Possible values are:sources
-- Compile Sources phaseresources
-- Copy Bundle Resources phaseheaders
-- Headers PhasecopyFiles
-- Copy Files Phase. Must be specified as an object with the following fields:absolutePath
- [x] destination: String - Destination of the Copy Files phase. This can be one of the following values:
-productsDirectory
-wrapper
-executables
-resources
-javaResources
-frameworks
-sharedFrameworks
-sharedSupport
-plugins
-none
- [ ] subpath: String - The path inside of the destination to copy the files.
-- Will not be added to any build phasesfile
- [ ] type: String: This can be one of the following values
-: a file reference with a parent group will be created (Default for files or directories with extensions)group
-: a group with all it's containing files. (Default for directories without extensions)folder
-: a folder reference.syncedFolder
-: Xcode 16's synchronized folders, also knows as buildable folderspublic
- [ ] headerVisibility: String - The visibility of any headers. This defaults to, but can be either:public
-private
-project
-
- [ ] attributes: [String] - Additional settings attributes that will be applied to any build files.
- [ ] resourceTags: [String] - On Demand Resource Tags that will be applied to any resources. This also adds to the project attribute's knownAssetTags
targets:
MyTarget:
sources: MyTargetSource
MyOtherTarget:
supportedDestinations: [iOS, tvOS]
sources:
- MyOtherTargetSource1
- path: MyOtherTargetSource2
inferDestinationFiltersByPath: true
name: MyNewName
excludes:
- "ios/*.[mh]"
- "configs/server[0-2].json"
- "*-Private.h"
- "/*.md" # excludes all files with the .md extension
- "ios//*Tests.[hm]" # excludes all files with an h or m extension within the ios directory.
compilerFlags:
- "-Werror"
- "-Wextra"
- path: MyOtherTargetSource3
destinationFilters: [iOS]
compilerFlags: "-Werror -Wextra"
- path: ModuleMaps
buildPhase:
copyFiles:
destination: productsDirectory
subpath: include/$(PRODUCT_NAME)
- path: Resources
type: folder
- path: Path/To/File.asset
resourceTags: [tag1, tag2]
target: nameDependency
A dependency can be one of a 6 types:
-
- links to another target. If you are using project references you can specify a target within another project by usingProjectName/TargetNamefor the nameframework: path
-- links to a framework or XCFrameworkcarthage: name
-- helper for linking to a Carthage framework (not XCFramework)sdk: name
-- links to a dependency with the SDK. This can either be a relative path within the sdk root or a single filename that references a framework (.framework) or lib (.tbd)package: name
-- links to a Swift Package. The name must match the name of a package defined in the top levelpackagesbundle: name
-- adds the pre-built bundle for the supplied name to the copy resources build phase. This is useful when a dependency exists on a static library target that has an associated bundle target, both existing in a separate project. Only usable in target types which can copy resources.trueLinking options:
- [ ] embed: Bool - Whether to embed the dependency. Defaults to true for application target and false for non application targets.
- [ ] link: Bool - Whether to link the dependency. Defaults todepending on the type of the dependency and the type of the target (e.g. static libraries will only link to executables by default).codeSignOnCopy
- [ ] codeSign: Bool - Whether thesetting is applied when embedding framework. Defaults to true.removeHeadersOnCopy
- [ ] removeHeaders: Bool - Whether thesetting is applied when embedding the framework. Defaults to true.Weak
- [ ] weak: Bool - Whether thesetting is applied when linking the framework. Defaults to false.embed
- [ ] platformFilter: String - This field is specific to Mac Catalyst. It corresponds to the "Platforms" dropdown in the Frameworks & Libraries section of Target settings in Xcode. Available options are: iOS, macOS and all. Defaults is all.
- [ ] destinationFilters: [Supported Destinations] - List of supported platform destinations this dependency should filter to. Defaults to all supported destinations.
- [ ] platforms: [Platform] - List of platforms this dependency should apply to. Defaults to all applicable platforms.
- copy - Copy Files Phase for this dependency. This only applies whenis true. Must be specified as an object with the following fields:absolutePath
- [x] destination: String - Destination of the Copy Files phase. This can be one of the following values:
-productsDirectory
-wrapper
-executables
-resources
-javaResources
-frameworks
-sharedFrameworks
-sharedSupport
-plugins
-framework
- [ ] subpath: String - The path inside of the destination to copy the files.Implicit Framework options:
This only applies to
dependencies. Implicit framework dependencies are useful in Xcode Workspaces which have multiple.xcodeprojthat are not embedded within each other yet have a dependency on a framework built in an adjacent.xcodeproj. By havingFind Implicit Dependencieschecked within your schemeBuild OptionsXcode can link built frameworks inBUILT_PRODUCTS_DIR.false- [ ] implicit: Bool - Whether the framework is an implicit dependency. Defaults to
.trueCarthage Dependency
- [ ] findFrameworks: Bool - Whether to find Carthage frameworks automatically. Defaults to
.dynamic
- [ ] linkType: String - Dependency link type. This value should beorstatic. Default value isdynamic.CARTHAGE_BUILD_PATH/PLATFORM/FRAMEWORK.frameworkCarthage frameworks are expected to be in
where:CARTHAGE_BUILD_PATH-
=options.carthageBuildPathorCarthage/Buildby defaultPLATFORM
-= the target's platformFRAMEWORK
-= the specified name.CARTHAGE_BUILD_PATH/FRAMEWORK.xcframeworkTo link an XCFramework produced by Carthage (in
), use a normalframework:findFrameworks: true
dependency. The helper logic provided by this dependency type is not necessary.All the individual frameworks of a Carthage dependency can be automatically found via
. This overrides the value of Options.findCarthageFrameworks. Otherwise each one will have to be listed individually..version
Xcodegen usesfiles generated by Carthage in order for this framework lookup to work, so the Carthage dependencies will need to have already been built at the time XcodeGen is run.FRAMEWORK_SEARCH_PATHSIf any applications contain carthage dependencies within itself or any dependent targets, a carthage copy files script is automatically added to the application containing all the relevant frameworks. A
setting is also automatically addedCARTHAGE_BUILD_PATH/PLATFORM/Static/FRAMEWORK.frameworkCarthage officially supports static frameworks. In this case, frameworks are expected to be in
.linkType
You can specifytostaticto integrate static ones.
projectReferences:
FooLib:
path: path/to/FooLib.xcodeproj
targets:
MyTarget:
supportedDestinations: [iOS, tvOS]
dependencies:
- target: MyFramework
destinationFilters: [iOS]
- target: FooLib/FooTarget
- framework: path/to/framework.framework
destinationFilters: [tvOS]
- carthage: Result
findFrameworks: false
linkType: static
destinationFilters: [iOS]
- sdk: Contacts.framework
- sdk: libc++.tbd
- sdk: libz.dylib
MyFramework:
type: framework
SDK DependencyDEVELOPER_DIR- [ ] root: String - Root of framework path, for example
. Default value isBUILT_PRODUCTS_DIR
targets:
MyTestTarget:
dependencies:
- target: MyFramework
- framework: path/to/framework.framework
- sdk: Contacts.framework
- sdk: Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest
root: DEVELOPER_DIR
MyFramework:
type: framework
Package dependencyproducts
- [ ] product: String - The product to use from the package. This defaults to the package name, so is only required if a Package has multiple libraries or a library with a differing name. Use this overwhen you want to define different linking options per product.
- [ ] products: String - A list of products to use from the package. This can be used when depending on multiple products from a package.
packages:
Yams:
url: https://github.com/jpsim/Yams
majorVersion: 2.0.0
SwiftPM:
url: https://github.com/apple/swift-package-manager
branch: swift-5.0-branch
targets:
App:
dependencies:
- package: Yams
- package: SwiftPM
product: SPMUtility
Depending on multiple products from a package:packages:
FooFeature:
path: Packages/FooFeature
targets:
App:
dependencies:
- package: FooFeature
products:
- FooDomain
- FooUI
.xcconfigConfig Files
Specifies
files for each configuration.
configFiles:
Debug: debug.xcconfig
Release: release.xcconfig
targets:
App:
configFiles:
Debug: App/debug.xcconfig
Release: App/release.xcconfig
Info.plistPlist
Plists are created on disk on every generation of the project. They can be used as a way to defineor.entitlementfiles. SomeInfo.plistproperties are generated automatically.- [x] path: String - This is the path where the plist will be written to
- [x] properties: [String: Any] - This is a map of all the plist keys and values
targets:
App:
info:
path: App/Info.plist
properties:
UISupportedInterfaceOrientations: [UIInterfaceOrientationPortrait]
UILaunchStoryboardName: LaunchScreen
entitlements:
path: App/App.entitlements
properties:
com.apple.security.application-groups: group.com.app
Build Tool Plug-insBuild Tool Plug-ins
To add
, you need to add information about plugins to Target:- buildToolPlugins: List of plugins to connect to the target
Each plugin includes information:
- [x] plugin: String - plugin name
- [x] package: String - the name of the package that contains the pluginСonnect the plugin to the desired target:
targets:
App:
buildToolPlugins:
- plugin: MyPlugin
package: MyPackage
Don't forget to add a package containing the plugin we need:packages:
MyPackage:
url: https://github.com/MyPackage
from: 1.3.0
Run ScriptBuild Script
Run script build phases can be added at 3 different points in the build:
- preBuildScripts: Before any other build phases
- postCompileScripts: After the compile sources build phase
- postBuildScripts: After any other build phasesEach script can contain:
- [x] path: String - a relative or absolute path to a shell script
- [x] script: String - an inline shell script
- [ ] name: String - name of a script. Defaults to/bin/sh
- [ ] inputFiles: [String] - list of input files
- [ ] outputFiles: [String] - list of output files
- [ ] inputFileLists: [String] - list of input .xcfilelist
- [ ] outputFileLists: [String] - list of output .xcfilelist
- [ ] shell: String - shell used for the script. Defaults totrue
- [ ] showEnvVars: Bool - whether the environment variables accessible to the script show be printed to the build log. Defaults torunOnlyForDeploymentPostprocessing
- [ ] runOnlyWhenInstalling: Bool - whether the script is only run when installing (). Defaults tofalsetrue
- [ ] basedOnDependencyAnalysis: Bool - whether to skip the script if inputs, context, or outputs haven't changed. Defaults to|
- [ ] discoveredDependencyFile: String - discovered dependency .d file. Defaults to noneEither a path or script must be defined, the rest are optional.
A multiline script can be written using the various YAML multiline methods, for example with
as below:
targets:
MyTarget:
preBuildScripts:
- path: myscripts/my_script.sh
name: My Script
inputFiles:
- $(SRCROOT)/file1
- $(SRCROOT)/file2
inputFileLists:
- $(SRCROOT)/inputFiles.xcfilelist
outputFiles:
- $(DERIVED_FILE_DIR)/file1
- $(DERIVED_FILE_DIR)/file2
outputFileLists:
- $(SRCROOT)/outputFiles.xcfilelist
discoveredDependencyFile: $(DERIVED_FILE_DIR)/target.d
postCompileScripts:
- script: swiftlint
name: Swiftlint
- script: |
command do
othercommand
postBuildScripts:
- path: myscripts/my_final_script.sh
name: My Final Script
fileTypeBuild Rule
- [ ] filePattern: String - A glob pattern for the files that will have the build rule run on them. This or
must be definedProcess
- [ ] fileType: String - A file type determined by Xcode. The available types can be seen by hovering your mouse of thedropdown in the Xcode interface. For examplesourcecode.swiftorfile.xib. This orfilePatternmust be defined.compilerSpec
- [ ] script: String - The script that will be run on each file. This ormust be defined.script
- [ ] compilerSpec: String: A reference to a built in apple tool to run on each file. This is for advanced use and the the values for this must be checked. This ormust be defined.Build Rule
- [ ] name: String - The name of a build rule. Defaults to
- [ ] outputFiles: [String] - The list of output files
- [ ] outputFilesCompilerFlags: [String] - The list of compiler flags to apply to the output files
- [ ] runOncePerArchitecture: Bool - a boolean that indicates if this rule should run once per architecture. This defaults to true
targets:
MyTarget:
buildRules:
- filePattern: "*.xcassets"
script: generate_assets.py
- fileType: sourcecode.swift
script: pre_process_swift.py
- filePattern: "*.txt"
name: My Build Rule
compilerSpec: com.apple.xcode.tools.swift.compiler
outputFiles:
- $(SRCROOT)/Generated.swift
runOncePerArchitecture: false
trueTarget Scheme
This is a convenience used to automatically generate schemes for a target based on different configs or included tests. If you want more control check out the top level Scheme.
- [x] configVariants: [String] - This generates a scheme for each entry, using configs that contain the name with debug and release variants. This is useful for having different environment schemes.
- [ ] testTargets: [Test Target] - a list of test targets that should be included in the scheme. These will be added to the build targets and the test entries. Each entry can either be a simple string, or a Test Target
- [ ] gatherCoverageData: Bool - a boolean that indicates if this scheme should gather coverage data. This defaults to false
- [ ] coverageTargets: [Testable Target Reference - a list of targets to gather code coverage. Each entry can either be a simple string, a string using Project Reference or Testable Target Reference
- [ ] disableMainThreadChecker: Bool - a boolean that indicates if this scheme should disable the Main Thread Checker. This defaults to false
- [ ] stopOnEveryMainThreadCheckerIssue: Bool - a boolean that indicates if this scheme should stop at every Main Thread Checker issue. This defaults to false
- [ ] disableThreadPerformanceChecker: Bool - a boolean that indicates if this scheme should disable the Thread Performance Checker. This defaults to false
- [ ] buildImplicitDependencies: Bool - Flag to determine if Xcode should build implicit dependencies of this scheme. By default this isif not set.String
- [ ] language: String - a String that indicates the language used for running and testing. This defaults to nil
- [ ] region: String - a String that indicates the region used for running and testing. This defaults to nil
- [ ] commandLineArguments: [String:Bool] - a dictionary from the argument name () to if it is enabled (Bool). These arguments will be added to the Test, Profile and Run scheme actionsrun
- [ ] environmentVariables: [Environment Variable] or [String:String] - environment variables for Run, Test and Profile scheme actions. When passing a dictionary, every key-value entry maps to a corresponding variable that is enabled.
- [ ] testPlans: [Test Plan] - List of test plan locations that will be referenced in the scheme.
- [ ] preActions: [Execution Action] - Scripts that are run before the build action
- [ ] postActions: [Execution Action] - Scripts that are run after the build action
- [ ] management: Scheme Management - Management options for the scheme
- [ ] storeKitConfiguration: String - specify storekit configuration to use during run. See Options.For example, the spec below would create 3 schemes called:
- MyApp Test
- MyApp Staging
- MyApp ProductionEach scheme would use different build configuration for the different build types, specifically debug configs for
,test, andanalyze, and release configs forprofileandarchive.
The MyUnitTests target would also be linked.
configs:
Test Debug: debug
Staging Debug: debug
Production Debug: debug
Test Release: release
Staging Release: release
Production Release: release
targets:
MyApp:
scheme:
testTargets:
- MyUnitTests
configVariants:
- Test
- Staging
- Production
gatherCoverageData: true
coverageTargets:
- MyTarget1
- ExternalTarget/OtherTarget1
commandLineArguments:
"-MyEnabledArg": true
"-MyDisabledArg": false
environmentVariables:
MY_ENV_VAR: VALUE
MyUnitTests:
sources: Tests
.xcconfigLegacy Target
By providing a legacy target, you are opting in to the "Legacy Target" mode. This is the "External Build Tool" from the Xcode GUI. This is useful for scripts that you want to run as dependencies of other targets, but you want to make sure that it only runs once even if it is specified as a dependency from multiple other targets.
- [x] toolPath: String - Path to the build tool used in the legacy target.
- [ ] arguments: String - Build arguments used for the build tool in the legacy target
- [ ] passSettings: Bool - Whether or not to pass build settings down to the build tool in the legacy target.
- [ ] workingDirectory: String - The working directory under which the build tool will be invoked in the legacy target.Aggregate Target
This is used to override settings or run build scripts in specific targets
- [x] targets: [String] - The list of target names to include as target dependencies
- [ ] configFiles: Config Files -files per configTargetAttributes
- [ ] settings: Settings - Target specific build settings.
- [ ] buildToolPlugins: [Build Tool Plug-ins] - Commands for the build system that run automatically during the build
- [ ] buildScripts: [Build Script] - Build scripts to run
- [ ] scheme: Target Scheme - Generated scheme
- [ ] attributes: [String: Any] - This sets values in the project. It is merged withattributesfrom the project and anything automatically added by XcodeGen, with any duplicate values being override by values specified heretemplatesTarget Template
This is a template that can be referenced from a normal target using the
property. The properties of this template are the same as a Target.${target_name}
Any instances ofwithin each template will be replaced by the final target name which references the template.templateAttributes
Any attributes defined within a targetswill be used to replace any attribute references in the template using the syntax${attribute_name}.
targets:
MyFramework:
templates:
- Framework
templateAttributes:
frameworkName: AwesomeFramework
sources:
- SomeSources
targetTemplates:
Framework:
platform: iOS
type: framework
sources:
- ${frameworkName}/${target_name}
allScheme
Schemes allows for more control than the convenience Target Scheme on Target
- [x] build: Build options
- [ ] run: The run action
- [ ] test: The test action
- [ ] profile: The profile action
- [ ] analyze: The analyze action
- [ ] archive: The archive action
- [ ] management: management metadataBuild
- [x] targets: [String:String] or [String:[String]] - A map of target names to build and which build types they should be enabled for. The build types can be
,none, or an array of the following types:run
-orrunningtest
-ortestingprofile
-orprofilinganalyze
-oranalyzingarchive
-orarchivingtrue- [ ] parallelizeBuild: Bool - Whether or not your targets should be built in parallel. By default this is
if not set.true
-: Build targets in parallelfalse
-: Build targets seriallytrue
- [ ] buildImplicitDependencies: Bool - Flag to determine if Xcode should build implicit dependencies of this scheme. By default this isif not set.true-
: Discover implicit dependencies of this schemefalse
-: Only build explicit dependencies of this schemefalse- [ ] runPostActionsOnFailure: Bool - Flag to determine if Xcode should run post scripts despite failure build. By default this is
if not set.true
-: Run post scripts even if build is failedfalse
-: Only run post scripts if build success
targets:
MyTarget: all
FooLib/FooTarget: [test, run]
parallelizeBuild: true
buildImplicitDependencies: true
debugCommon Build Action options
The different actions share some properties:
- [ ] config: String - All build actions can be set to use a certain config. If a config, or the build action itself, is not defined the first configuration found of a certain type will be used, depending on the type:
-: run, test, analyzerelease
-: profile, archiverun
- [ ] commandLineArguments: [String:Bool] -,testandprofileactions have a map of command line arguments to whether they are enabledrun
- [ ] preActions: [Execution Action] - Scripts that are run before the action
- [ ] postActions: [Execution Action] - Scripts that are run after the action
- [ ] environmentVariables: [Environment Variable] or [String:String] -,testandprofileactions can define the environment variables. When passing a dictionary, every key-value entry maps to a corresponding variable that is enabled.GPU Frame Capture
- [ ] enableGPUFrameCaptureMode: GPUFrameCaptureMode - Property value set for. Possible values areautoEnabled,metal,openGL,disabled. Default isautoEnabled.Metal API Validation
- [ ] enableGPUValidationMode: Bool - Property value set for. This defaults to true.run
- [ ] disableMainThreadChecker: Bool -andtestactions can define a boolean that indicates that this scheme should disable the Main Thread Checker. This defaults to falserun
- [ ] stopOnEveryMainThreadCheckerIssue: Bool - a boolean that indicates if this scheme should stop at every Main Thread Checker issue. This defaults to false
- [ ] disableThreadPerformanceChecker: Bool -action can define a boolean that indicates that this scheme should disable the Thread Performance Checker. This defaults to falserun
- [ ] language: String -andtestactions can define a language that is used for Application Languagerun
- [ ] region: String -andtestactions can define a language that is used for Application Regionrun
- [ ] debugEnabled: Bool -andtestactions can define a whether debugger should be used. This defaults to true.run
- [ ] simulateLocation: Simulate Location -action can define a simulated locationrun
- [ ] askForAppToLaunch: Bool -andprofileactions can define the executable set to ask to launch. This defaults to false.run
- [ ] launchAutomaticallySubstyle: String -action can define the launch automatically substyle ('2' for extensions).run
- [ ] storeKitConfiguration: String -action can specify a storekit configuration. See Options.run
- [ ] macroExpansion: String -andtestactions can define the macro expansion from other target. This defaults to nil.Run ScriptExecution Action
Scheme run scripts added via preActions or postActions. They run before or after a build action, respectively, and in the order defined. Each execution action can contain:
- [x] script: String - an inline shell script
- [ ] name: String - name of a script. Defaults to|
- [ ] settingsTarget: String - name of a build or test target whose settings will be available as environment variables.A multiline script can be written using the various YAML multiline methods, for example with
. See Build Script..lldbinitRun Action
- [ ] executable: String - the name of the target to launch as an executable. Defaults to the first runnable build target in the scheme, or the first build target if a runnable build target is not found
- [ ] customLLDBInit: String - the absolute path to the customfile.lldbinit
- [ ] customWorkingDirectory: String - a path to use as the working directory when launching the executable.Test Action
- [ ] gatherCoverageData: Bool - a boolean that indicates if this scheme should gather coverage data. This defaults to false
- [ ] coverageTargets: [Testable Target Reference] - a list of targets to gather code coverage. Each entry can either be a simple string, a string using Project Reference or Testable Target Reference
- [ ] targets: [Test Target] - a list of targets to test. Each entry can either be a simple string, or a Test Target
- [ ] customLLDBInit: String - the absolute path to the customfilecaptureScreenshotsAutomatically
- [ ] captureScreenshotsAutomatically: Bool - indicates whether screenshots should be captured automatically while UI Testing. This defaults to true.
- [ ] deleteScreenshotsWhenEachTestSucceeds: Bool - whether successful UI tests should cause automatically-captured screenshots to be deleted. Ifis false, this value is ignored. This defaults to true.screenshots
- [ ] testPlans: [Test Plan] - List of test plan locations that will be referenced in the scheme.
- [ ] preferredScreenCaptureFormat: String - automatic screen capture format to use while UI Testing. Possible values are,screenRecording. Default isscreenRecording.name:#### Test Target
A target can be one of a 2 types:- name: String - The name of the target.
- target: Testable Target Reference - The information of the target. You can specify more detailed information than.targetAs syntax sugar, you can also specify Testable Target Reference without
.skippedTests#### Other Parameters
- [ ] parallelizable: Bool - Whether to run tests in parallel. Defaults to false
- [ ] randomExecutionOrder: Bool - Whether to run tests in a random order. Defaults to false
- [ ] location: String - GPX file or predefined value for simulating location. See Simulate Location for location examples.
- [ ] skipped: Bool - Whether to skip all of the test target tests. Defaults to false
- [ ] skippedTests: [String] - List of tests in the test target to skip. Defaults to empty
- [ ] selectedTests: [String] - List of tests in the test target to whitelist and select. Defaults to empty. This will overrideif providedpackage: {local-swift-package-name}/{target-name}#### Testable Target Reference
A Testable Target Reference can be one of 3 types:
-: Name of local swift package and its target.local: {target-name}
-: Name of local target.project: {project-reference-name}/{target-name}
-: Name of local swift package and its target.London, EnglandArchive Action
- [ ] customArchiveName: String - the custom name to give to the archive
- [ ] revealArchiveInOrganizer: Bool - flag to determine whether the archive will be revealed in Xcode's Organizer after it's done building
Simulate Location
- [x] allow: Bool - enable location simulation
- [ ] defaultLocation: String - set the default location, possible values:
-Johannesburg, South Africa
-Moscow, Russia
-Mumbai, India
-Tokyo, Japan
-Sydney, Australia
-Hong Kong, China
-Honolulu, HI, USA
-San Francisco, CA, USA
-Mexico City, Mexico
-New York, NY, USA
-Rio de Janeiro, Brazil
-<relative-path-to-gpx-file>
-(e.g. ./location.gpx)fileGroups
Setting the defaultLocation to a custom gpx file, you also need to add that file tofor Xcode be able to use it:
targets:
MyTarget:
fileGroups:
- location.gpx
Note that the path the gpx file will be prefixed according to theschemePathPrefixoption in order to support both.xcodeprojand.xcworkspacesetups. See Options.Scheme Management
- [ ] shared: Bool - indicates whether the scheme is shared
- [ ] orderHint: Int - used by Xcode to sort the schemes
- [ ] isShown: Bool - indicates whether the sheme is shown in the scheme listEnvironment Variable
- [x] variable: String - variable's name.
- [x] value: String - variable's value.
- [ ] isEnabled: Bool - indicates whether the environment variable is enabled. This defaults to true.
schemes:
Production:
build:
targets:
MyTarget1: all
MyTarget2: [run, archive]
run:
config: prod-debug
commandLineArguments:
"-MyEnabledArg": true
"-MyDisabledArg": false
environmentVariables:
RUN_ENV_VAR: VALUE
test:
config: prod-debug
commandLineArguments:
"-MyEnabledArg": true
"-MyDisabledArg": false
gatherCoverageData: true
coverageTargets:
- MyTarget1
- ExternalTarget/OtherTarget1
- package: LocalPackage/TestTarget
targets:
- Tester1
- name: Tester2
parallelizable: true
randomExecutionOrder: true
skippedTests: [Test/testExample()]
- package: APIClient/APIClientTests
parallelizable: true
randomExecutionOrder: true
environmentVariables:
- variable: TEST_ENV_VAR
value: VALUE
isEnabled: false
profile:
config: prod-release
analyze:
config: prod-debug
archive:
config: prod-release
customArchiveName: MyTarget
revealArchiveInOrganizer: false
xctestplanTest Plan
For now test plans are not generated by XcodeGen and must be created in Xcode and checked in, and then referenced by path. If the test targets are added, removed or renamed, the test plans may need to be updated in Xcode.- [x] path: String - path that provides the
location.
- [ ] defaultPlan: Bool - a bool that defines if given plan is the default one. Defaults to false. If no default is set on any test plan, the first plan is set as the default.
schemes:
TestTarget:
test:
testPlans:
- path: app.xctestplan
defaultPlan: true
templatesScheme Template
This is a template that can be referenced from a normal scheme using the
property. The properties of this template are the same as a Scheme. This functions identically in practice to Target Template.${scheme_name}
Any instances ofwithin each template will be replaced by the final scheme name which references the template.templateAttributes
Any attributes defined within a scheme'swill be used to replace any attribute references in the template using the syntax${attribute_name}.
schemes:
MyModule:
templates:
- FeatureModuleScheme
templateAttributes:
testTargetName: MyModuleTests
schemeTemplates:
FeatureModuleScheme:
templates:
- TestScheme
build:
targets:
${scheme_name}: build
TestScheme:
test:
gatherCoverageData: true
targets:
- name: ${testTargetName}
parallelizable: true
randomExecutionOrder: true
The result will be a scheme that buildsMyModulewhen you request a build, and will test againstMyModuleTestswhen you request to run tests. This is particularly useful when you work in a very modular application and each module has a similar structure.majorVersion: 1.2.0Swift Package
Swift packages are defined at a project level, and then linked to individual targets via a Dependency.Remote Package
- [x] url: URL - the url to the package
- [x] version: String - the version of the package to use. It can take a few forms:
-orfrom: 1.2.0minorVersion: 1.2.1
-exactVersion: 1.2.1
-orversion: 1.2.1minVersion: 1.0.0, maxVersion: 1.2.9
-branch: master
-revision: xxxxxx
-url
- [ ] github : String- this is an optional helper you can use for github repos. Instead of specifying the full url inyou can just specify the github org and repoPackage.swift
- [ ] traits: [String] - Optional Swift package traits to enable for this package reference. Trait names are written to the Xcode project in the specified order.
Local Package
- [x] path: String - the path to the package in local. The path must be directory with a
.""
- [ ] group : String- Optional path that specifies the location where the package will live in your xcode project. Useto specify the project root.false
- [ ] excludeFromProject : String- Optional flag to exclude the package from the generated project (useful if the package is already added via xcworkspace and the project is not intended for standalone use), defaults topackages
- [ ] traits: [String] - Optional Swift package traits to enable for this package reference. Use the top-levelmapping because the legacylocalPackagessyntax cannot specify traits.
packages:
Yams:
url: https://github.com/jpsim/Yams
from: 2.0.0
traits:
- StrictConcurrency
Ink:
github: JohnSundell/Ink
from: 0.5.0
Sentry:
path: ../..
traits:
- NoUIFramework
RxClient:
path: ../RxClient
AppFeature:
path: ../Packages
group: Domains/AppFeature
excludeFromProject: false
xcodeprojProject Reference
Project References are defined at a project level, and then you can use the project name to refer its target via a Scheme
- [x] path: String - The path to the
file to reference.
projectReferences:
YamsProject:
path: ./Carthage/Checkouts/Yams/Yams.xcodeproj
schemes:
TestTarget:
build:
targets:
YamsProject/Yams: ["run"]
---LevelsDocs/Usage
- Configuring build settings
- Setting Presets
- Settings
- Setting Groups
- xcconfig files
- Dependencies
- CocoaPods
- Carthage
- Swift Package
- SDK
- FrameworkConfiguring build settings
There are various ways of configuring build settingsXcode resolves a certain build setting for a configuration and target by looking up the different levels until it finds a value. This can be seen in Xcode when the
option is on in theBuild Settingstab. The different levels of build settings are:base- target
- target xcconfig file
- project
- project xcconfig file
- sdk defaultsXcodeGen will apply settings to a target or project level by merging different methods
- Setting Presets
- Setting Groups
- Settingsconfig
- Settings for a specificBuild SettingsThe values from xcconfig files will then sit a level above this. Note that as a convenience, any settings in an xcconfig file will also overwrite any settings from Setting Presets
>Note that when defining build settings you need to know the write name and value. In Xcode build settings are shown by default with a nicely formatted title and value. To be able to see what the actual build setting names and values are make sure you're in a
tab and goEditor -> Show Setting Titlesand alsoEditor -> Show Definitions. This will then give you the actual names and values that XcodeGen expects.options.settingPresetsSetting Presets
XcodeGen applies default settings to your project and targets similar to how Xcode creates them when you create a new project or target.
Debug and Release settings will be applied to your project. Targets will also get specific settings depending on the platform and product type.>You can change or disable how these setting presets are applied via the
which you can find more about in OptionsprojectSettings
Theand eachtargethave asettingsobject that you can define. This can be a simple map of build settings or can provide build settings perconfigviaconfigsorbase. See Settings for more details.
settings:
DEVELOPMENT_TEAM: T45H45J
targets:
App:
settings:
base:
CODE_SIGN_ENTITLEMENTS: App/Entitlements.entitlements
configs:
Debug:
DEBUG_MODE: YES
Release:
DEBUG_MODE: NO
settingsSetting Groups
Eachcan also reference one or more setting groups which let you reuse groups of build settings across targets or configurations. See Setting Groups for more details. Note that each setting group is also a full Settings object, so you can reference other groups or define settings by config.
settingGroups:
app:
DEVELOPMENT_TEAM: T45H45J
targets:
App:
settings:
groups: [app]
projectxcconfig files
Theand eachtargethave aconfigFilesobject that lets you reference.xcconfigfiles per configuration.>This is good guide to xcconfig files https://pewpewthespells.com/blog/xcconfig_guide
configFiles:
Debug: debug.xcconfig
Release: release.xcconfig
targets:
App:
configFiles:
Debug: App/debug.xcconfig
Release: App/release.xcconfig
xcodebuild environment variables
You can also always override any build settings on CI when building by passing specific build settings to xcodebuild like so:DEVELOPMENT_TEAM=XXXXXXXXX xcodebuild ...
PodfileDependencies
Each target can declare one or more dependencies. See Dependency in the ProjectSpec for more info about all the properties
CocoaPods
Use youras normal. The pods themselves don't need to be referenced in the project spec. After you generate your project simply runpod installwhich will integrate with your project and create a workspace.Carthage
XcodeGen makes integrating Carthage dependencies super easy!You simply reference them in each target that requires them and XcodeGen does the rest by automatically linking and embedding the carthage frameworks where necessary.
targets:
App:
dependencies:
- target: Framework
- carthage: Kingfisher
Framework:
dependencies:
- carthage: Alamofire
Some Carthage dependencies actually vend multiple frameworks. For examplegithub "ReactiveCocoa/ReactiveCocoa" ~> 8.0vends 2 frameworksReactiveCocoaandReactiveMapKit.
By default these all have to be listed if you want to link and use them:
targets:
App:
dependencies:
- carthage: ReactiveCocoa
- carthage: ReactiveMapKit
XcodeGen can look these up for you automatically! This can be enabled with a globaloptions.findCarthageFrameworksor can be overridden for each Carthage dependency. Note that if this is enabled, the Carthage dependencies need to have already been built before XcodeGen is run. This is because XcodeGen loads.versionfiles that Carthage writes in theCarthage/Builddirectory which lists the all the frameworks. The name you use must also be the name of the.versionfile Carthage writes toCarthage/Build. Be aware that in some cases this name can differ from the name of the repo in the Cartfile and even the framework name. If the.versionfile is not found or fails parsing, XcodeGen will fallback to the regular Framework lookup in the relevant Carthage directory.
options:
findCarthageFrameworks: true
targets:
App:
dependencies:
- carthage: ReactiveCocoa # will find ReactiveMapKit as well
- carthage: OtherCarthageDependency
findFrameworks: false # disables the global option
XcodeGen automatically creates the build phase that Carthage requires which lists all the files and runscarthage copy-frameworks. You can change the invocation of carthage to something different, for example if you are running it with Mint. This is then prepended tocopy frameworks
options:
carthageExecutablePath: mint run Carthage/Carthage
By default XcodeGen looks for carthage frameworks inCarthage/Build. You can change this with thecarthageBuildPathoption
options:
carthageBuildPath: ../../Carthage/Build
Swift Package
Swift Packages can be integrated by defining them at the project level and then referencing them in targetspackages:
Yams:
url: https://github.com/jpsim/Yams
from: 2.0.0
SwiftPM:
url: https://github.com/apple/swift-package-manager
branch: swift-5.0-branch
RxClient:
path: ../RxClient
targets:
App:
dependencies:
# by default the package product that is linked to is the same as the package name
- package: Yams
- package: SwiftPM
- package: RxClient
- package: SwiftPM
product: SPMUtility # specify a specific product
If you want to check in thePackage.resolvedfile so that everyone is on the same versions, you need to check inProjectName.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolvedDebugNote that Swift Packages don't work in projects with configurations other thanandRelease. That limitation is tracked here bugs.swift.org/browse/SR-10927PackagesSpecified local packages get put into a
group in the root of the project by default. This can be changed withoptions.localPackagesGroup.sdkSDK
System frameworks and libs can be linked by using thedependency type. You can either specify frameworks or libs by using a.framework,.tbdordylibfilename, respectively
targets:
App:
dependencies:
- sdk: Contacts.framework
- sdk: libc++.tbd
- sdk: libz.dylib
Framework
Individual frameworks can also be linked by specifying a path to themtargets:
App:
dependencies:
- framework: Vendor/MyFramework.framework
Build Tool Plug-ins
XCodeGen supports working with Swift Package Plug-ins.To use plugins, you need to specify in your target which plugin you want to connect, and don't forget to connect the package to target.
packages:
Prefire:
url: https://github.com/BarredEwe/Prefire
from: 1.3.0
targets:
App:
buildToolPlugins:
- plugin: PrefirePlaybookPlugin
package: Prefire
---traitsCHANGELOG
Change Log
2.46.0
Added
- Added support for Swift packageon remote and local package references, so generated projects preserve the configured trait selections #1629 @philprimexcodebuild -listChanged
- Targets in the generated project now follow the declaration order from the source spec (Xcode sidebar,output). Previously they were always sorted alphabetically. Applies to both YAML and JSON specs. Declaration order is now also preserved for targets whoseplatform/namecome from a target template and for targets whose key is a${VARIABLE}. #1619 @mirkokg.iconInternal
- Update to XcodeProj 9.14.0 #1629 @philprime2.45.4
Fixed
- Fix makePathRelative using wrong base path when projectDirectory differs #1608 @yonaskolb
- Fix synced folder configFiles creating duplicate groups #1607 @AlexNsbmr
- Fix synced folder root group duplication for paths referenced by multiple targets #1607 @AlexNsbmr
- Fix synced folder directory-level membershipExceptions not working #1607 @AlexNsbmr2.45.3
Fixed
- Fix folder source PBXFileReference path regression with createIntermediateGroups #1605 @yonaskolb
- Fix synced folders: includes silently ignored + no deduplication across targets #1604 @4brunu2.45.2
Fixed
- Validate empty source paths to prevent project root inclusion #1601 @yonaskolb
- Fix missing productRefGroup in generated projects #1591 @ruslic192.45.1
Added
- Added built infolder support for IconComposer #1600 @yonaskolbprojectFormat2.45.0
Added
- Added ability to specify project format version viaoption #1566 @anivarosexplicitFolders
- Addedproperty toTargetSourcethat is passed through toPBXFileSystemSynchronizedRootGroup, to turn entire subfolders into Resources #1596 @macgurugroupOrdering
- Allow synced folders to be sorted using#1596 @macguruexcludes
- Addedsupport forsyncedFoldersources with glob pattern matching #1587 @mirkokgcreateIntermediateGroups=YESFixed
- Fixed synced folders ignoringand always being created at the root level #1596 @macgurusupportedDestinations
- Fix membership exceptions not working for nested synced folders with intermediate groups enabled #1596 @macguru
- Fixpresets being injected whensettingPresetsisnone#1599 @macguruInfo.plist
- Automatically excludefrom synced folder membership when it's within the synced folder #1587 @mirkokgparallelizable
- Add empty copy resources build phase for synced folders so resources are copied correctly #1587 @mirkokgInternal
- Update to XcodeProj 9.10.1 #1597 @yonaskolb
- Fix CI: add explicit xcodebuild destinations and update Xcode matrix #1594 @yonaskolb
- Update ArtifactBundleGen to 0.0.8 #1570 @georgenavarro2.44.1
Fixed
- Set the correct object version of 77 for Xcode 16 projects @jakobfelsatdm #1563
- Support major.minor SPM package versions which would otherwise fail to decode to a string in yaml specs #1546 @RomanPodymov
- Fix regression forin scheme. It now resolves to "Enabled" and not "Swift Testing Only" #1565 @CraigSiemensTargetSource.type2.44.0
Added
- Basic support for Xcode 16's synchronized folders #1541 @yonaskolb
-can now besyncedFolderOptions.defaultSourceDirectoryType
-can be set tosyncedFolderfor the default type in all sources in the project (defaults togroup)settings.configs
- Benefits include faster generation and no cache invalidation or need to regenerate when files are added or removed from these folders
- Note that not all TargetSource options like excludes are supported, just a simple path. Please test and see what is missing in your projects
- Added sanitizer options to run and test actions in Scheme #1550 @hi-kumarFixed
- Added validation to ensure that all values inare mappings. Previously, passing non-mapping values did not raise an error, making it difficult to detect misconfigurations. Now,SpecParsingError.invalidConfigsMappingFormatis thrown if misused. #1547 @Ryu0118USER
- Useinstead ofLOGNAMEfor XCUserData #1559 @KostyaShaexcludeFromProject2.43.0
Added
- Added
from local packages #1512 @maximkroukpreferredScreenCaptureFormat
- Added support forin schemes #1450 @vakhidbetrakhmadov.appexChanges
-
files are now copied to plugins directory by default #1531 @iljaiwaspreGenCommand
- Theis now run before validation and caching #1500 #1519 @simonbs @dalemyersenableGPUValidationMode
- Improve performance of spec validation #1522 @zewuchen
- Theenum is deprecated and is now a boolean #1515 @marcosgriselli @yonaskolbfileGroupsFixed
- Breaking:
are now relative paths when in included files, like other paths #1534 @shnhrrsnmacroExpansion
- Breaking: Local package paths are now relative paths when in included files, like other paths #1498 @juri
- Optional groups are no longer skipped when missing and generating projects from a different directory #1529 @SSheldonInternal
- Fix Swift 6.0 warnings #1513 @marcosgriselli
- Update package swift tools to 5.9 #1489 @0111b
- Add Xcode 16 to CI #1439 @giginet
- Fix test project building on CI #1537 @yonaskolb
- Skip failing tests on Linux #1517 @marcosgriselli
- XcodeProj updated to 8.24.3 #1515 @marcosgriselli @yonaskolb2.42.0
Added
- Better support for local Swift packages in Xcode 15 #1465 @kinnarr
- Addedto test actions in schemes #1468 @erneestocxcodegen dump --type graphvizChanged
- Better default macroExpansion target in schemes #1471 @erneestoc
Removed
- Removed
as graphviz no longer builds in Swift 6 and is no longer maintained. If anyone uses this feature and wishes to keep it, please submit a PR providing a suitable alternative. #1485 @giginetxcodegen cache2.41.0
Added
- Added
command that writes the cache. Useful forpost-commitgit hook integration #1476 @yonaskolbsupportedDestinationsChanged
- Include folders in file sorting #1466 @jflan-dd
Fixed
- Fixed
validation when it contains watchOS for multiplatform apps. #1470 @tatsuky.xcprivacy2.40.1
Fixed
- Reverted
handling. They will now again be treated as resources by default @yonaskolbshell2.40.0
Added
- Added support for local Swift packages at the project root by specifying a "" group #1413 @hiltonc
- Added a customto a scheme's pre and post actions #1430 @balazs-vimn.xcprivacyChanged
-
files are now not added to any build phases by default #1464 @yonaskolb.cp2.39.1
Added
- Proper defaults for
and.cxxfiles #1447 @eschwieb.xcstringsFixed
- Fixed bundle access crash #1448 @freddi-kit
- Pinned XcodeProj version to fix breaking changes when XcodeGen is used as a dependency #1449 @yonaskolb2.39.0
Added
- Support Artifact Bundle #1388 @freddi-kit
- Added support forString Catalogs #1421 @nicolasbosi95LD_RUNPATH_SEARCH_PATHS
- Added defaultfor visionOS #1444 @DahlgrenwatchOS
- Addedas a supported cross platform destination #1438 @tatsukysupportedDestinationsFixed
- Fixed custom local package groups not being created #1416 @JaapManenschijn
- Fixed spec validation error type #1439 @Lutzifer
- Create parent group for local package groups if it does not exist already #1417 @JaapManenschijnInternal
- Updated Rainbow version #1424 @nysander
2.38.0
Added
- Multi-destination targets #1336 @amatig
- Addedto targetplatform
- Added optional newvalue ofautowhen usingsupportedDestinationsdestinationFilters
- Addedfor sources and dependenciesinferDestinationFiltersByPath
- Added, a convenience filter for sources.mlpackage
-files now default to being a source type #1398 @aaron-foreflightBuild Tool Plug-ins
- Added support forinAggregateTarget#1390 @BarredEweincludesFixed
- Fixed source file
not working when no paths were found #1337 @shnhrrsnBuild Tool Plug-ins
- Supports specifying multiple package products #1395 @simonbs2.37.0
Added
- Added support for adding
to targets #1374 @BarredEweENABLE_MODULE_VERIFIER2.36.1
Fixed
- Revert addition of
build setting for causing issues in tests and some setups #1387 @yonaskolbscheme.enableGPUValidationMode2.36.0
Added
- Added
#1294 @LouisLWangRuntimeIssue
- Added visionOS support #1379 @shiba1014
- Added ability to disable Thread performance checker in Schemes #1380 @piellarda
- Added support forbreakpoints #1384 @yonaskolbputResourcesBeforeSourcesBuildPhaseChanged
- The project object version has been updated for Xcode 14.3 #1368 @leonardorock
- Updated recommended settings for Xcode 14.3 #1385 @yonaskolb
- Dropped support for Xcode 12 and 13, due to XcodeProj update #1384 @yonaskolbFixed
- Fix external dependencies from being removed by Xcode #1354 @OdNairy
- Stop creating orphaned object references when reusing references to external dependencies #1377 @liamnichols2.35.0
Added
- Added support for shared breakpoints #177 @alexruperez @myihsan
- Added support forin a target #1351 @mat1thswiftcrossimportFixed
- Fix case where source paths may not be deduplicated correctly resulting in duplicate groups and/or a crash in running Xcodegen #1341 @dalemyers
2.34.0
Changed
- Added support for
folders. #1317 @Iron-HamEmbed App Extensions
- Added support for Scheme Management #1142 @wendyliga, @teamehFixed
- Fix includes when the projectRoot is a relative path #1262 @CraigSiemens
- Renamed build phasetoEmbed Foundation Extensionsto fix Xcode 14 warning #1310 @casperriboeenableGPUFrameCaptureMode2.33.0
Added
- Added support for
#1251 @bsudekumtry
- Config setting presets can now also be loaded from the main bundle when bundling XcodeGenKit #1135 @SofteqDG
- Added ability to generate multiple projects in one XcodeGen launch #1270 @skofgar
- Use memoization during recursive SpecFiles creation. This provides a drastic performance boost with lots of recursive includes #1275 @ma-oliFixed
- Fix scheme not being generated for aggregate targets #1250 @CraigSiemens
- Fix recursive include path when relativePath is not set #1275 @ma-oli
- Include projectRoot in include paths #1275 @ma-oliInternal
- Updated to Yams 5.0.1 #1297 @s2mr
- Delete ignoredkeyword #1298 @s2mrmlmodelc2.32.0
Added
- Add support for
files #1236 @antonsergeev88enable
- Addoption forinclude#1242 @freddi-kitincludeFixed
- Fix checking environment variable in
#1242 @freddi-kitextensionkit-extension
- Fix profile action for frameworks in Xcode 14 #1245 @SSheldon2.31.0
Added
- Added a new CopyFilesBuildPhase, "Embed ExtensionKit Extensions" #1230 @mtj0928
- Added duplicate dependencies validation #1234 @aleksproger2.30.0
Added
- Added support for new target type
in Xcode 14 #1228 @aleksproger{scheme}.test.testPlansChanged
- Speed up generating build settings for large projects #1221 @jpsim
Fixed
- Fix XcodeGen building as library after breaking XcodeProj update 8.8.0 #1228 @aleksproger
2.29.0
Some support for Xcode Test Plans has been added. For now test plans are not generated by XcodeGen and must be created in Xcode and checked in, and then referenced by path. If the test targets are added, removed or renamed, the test plans may need to be updated in Xcode
#### Added
- Schemes and Target Schemes can now reference existing Test Plans under
and{target}.scheme.testPlans, respectively. #716 @yonaskolb @omarescoverageTargets#### Fixed
- Fixed an issue where DocC was not added to source file list #1202 @hiragram
#### Changed
- Updated XcodeProj to 8.7.1 #1213 @yonaskolb
2.28.0
#### Added
- Support for specifying custom group locations for SPM packages. #1173 @John-Connolly
Fixed
- Fix Monterey macOS shell version, shell login flag for environments #1167 @bimawa
- Fixed crash caused by a simultaneous write during a glob processing #1177 @tr1ckyf0xChanged
- Run target source pattern matching in parallel #1197 @alvarhansen
2.27.0
#### Added
- Support test target for local Swift Package #1074 @freddi-kit
- Addedfor target test schemes. This enables to gather code coverage for specific targets. #1189 @gabriellanatalocation
- Fixed issue where .gyb files could not be added to source file list #1191 @hakkurishianFixed
- Fixed crash caused by a simultaneous write during a glob processing #1177 @tr1ckyf0x
- Skip generating empty compile sources build phases for watch apps #1185 @evandcoleman2.26.0
Added
- Added the option to specify a
in a test target #1150 @KrisRJackcopyChanged
- Speed up source inclusion checking for big projects #1122 @PaulTaykalo
2.25.0
Added
- Allow specifying a
setting for each dependency. #1038 @JakubBednarplatformFixed
- Fix broken codesign option for bundle dependency #1104 @kateinoigakukun
- Ensure fileTypes are mapped to JSON value #1112 @namolnad
- Fix platform filter for package dependecies #1123 @raptorxcz
- Fix Xcode 13 build #1130 @raptorxcz @mtholeChanged
- Update XcodeProj to 8.2.0 #1125 @nnsnodnb
2.24.0
Added
- Added support for DocC Catalogs #1091 @brevansio
- Added support for "driver-extension" and "system-extension" product types #1092 @vgorloff
- Add support for conditionally linking dependencies for specific platforms #1087 @daltonclaybrook
- Add ability to specify UI testing screenshot behavior in test schemes #942 @daltonclaybrookChanged
- Breaking: Rename the
field onDependencytoplatformFilter#1087 @daltonclaybrook()2.23.1
Changed
- Reverted "Change FRAMEWORK_SEARCH_PATH for xcframeworks (#1015)", introduced in 2.20.0. XCFrameworks need to be
referenced directly in the project for Xcode's build system to extract the appropriate frameworks #1081 @elliottwilliams2.23.0
#### Added
- Added ability to set custom platform for dependency #934 @raptorxcz
#### Fixed
- Added
to config variant trimming charater set to fix scheme config variant lookups for some configs likeDebug (Development)that broke in 2.22.0 #1078 @DavidWoohyunLeerunPostActionsOnFailure
- Fixed Linux builds on Swift 5.4 #1083 @yonaskolb2.22.0
#### Added
- Support
for running build post scripts on failing build #1075 @freddi-kitDOT#### Changed
- Xcode no longer alerts to project changes after regeneration, due to internal workspace not regenerating if identical #1072 @yonaskolb
#### Fixed
- Fixed no such module
error when package is used as a dependency #1067 @yanamuraProdDebug
- Fixed scheme config variant lookups for some configs likeandProd-Debugthat broke in 2.21.0 #1070 @yonaskolbCore2.21.0
#### Added
- Support weak link for Swift Package Dependency #1064 @freddi-kit
#### Changed
- Carthage frameworks are no longer embedded for "order-only" target dependencies. This avoid redundant embeds in situations where a target's sources _import_ a Carthage framework but do not have a binary dependency on it (like a test target which runs in a host app). #1041 @elliottwilliams
#### Fixed
- The
target is renamed to avoid collisions with other packages. #1057 @elliottwilliamsgithub
- Lookup scheme config variants by whole words, fixing incorrect assignment in names that contain subtrings of each other (eg PreProd and Prod) #976 @stefanomondino2.20.0
#### Added
- Allow specifying a
name likeJohnSundell/Inkinstead of a fullurlfor Swift Packages #1029 @yonaskolbLastUpgradeCheck
- Added explicitandLastUpgradeVersionoverride support so it's possible to override these properties without using theproject.xcodeVersion. 1013 @Andre113macroExpansion
- Addedforruninschemes#1036 @freddi-kitaskForAppToLaunch
- Addedforprofileinschemes#1035 @freddi-kitTest
- Added support for selectedTests in schemesconfiguration. #913 @ooodin.storekit#### Fixed
- Fixed regression on
configuration files' default build phase. #1026 @jcolicchio.xcframework
- Fixed framework search paths when usings. #1015 @FranzBuschuseBaseInternationalization
- Fixed bug where schemes without a build target would crash instead of displaying an error #1040 @dalemyers
- Fixed files with names ending in Info.plist (such as GoogleServices-Info.plist) from being omitted from the Copy Resources build phase. Now, only the resolved info plist file for each specific target is omitted. #1027 @liamnichols#### Internal
- Build universal binaries for release. XcodeGen now runs natively on Apple Silicon. #1024 @thii
2.19.0
#### Added
- Added support for building and running on Linux platforms. Tested for compatibility with Swift 5.3+ and Ubuntu 18.04. #988 @elliottwilliams
- Addedto Project Spec Options to opt out of Base Internationalization. #961 @liamnicholsstoreKitConfiguration
- Addedto allow specifying StoreKit Configuration in Scheme and TargetScheme, supporting either xcodeproj or xcworkspace viaschemePathPrefixoption. #964 @jcolicchiobasedOnDependencyAnalysis
- Added more detailed error message with method arguments. #990 @bannzai
- Addedto Project Spec Build Script to be able to choose not to skip the script. #992 @myihsanBuildRule.runOncePerArchitecture
- Addedto allow running build rules once per architecture. #950 @saschaworkingDirectory
- Added discovered dependency file for a build script #1012 @polac24 @fggeraissate#### Changed
- Breaking: Info.plists with custom prefixes are no longer added to the Copy Bundle Resources build phase #945 @anivaros
- Breaking:of included legacy targets is now made relative to including project #981 @jcolicchiosimulateLocation
- Breaking: MakerespectschemePathPrefixoption. #973 @jcolicchiominimumXcodeGenVersion#### Fixed
- Fixed error message output for
. #967 @joshwalkerLegacyTarget
- Remove force-unwrapping causing crash fors #982 @jcolicchioParsing project spec failed: Error Domain=Unspecified error Code=0
- Fixed a race condition in an internal JSON decoder, which would occasionally fail with an error like. #995 @elliottwilliamsMACH_O_TYPE: staticlib
- Fixed issue where frameworks withwere being incorrectly embedded. #1003 @mrabiciuScheme.Test.TestTarget.skipped#### Internal
- Updated to Yams 4.0.0 #984 @swiftty
2.18.0
#### Added
- Add
to allow skipping of an entire test target. #916 @codeman9launchAutomaticallySubstyle = 2
- Added ability to set custom LLDBInit scripts for launch and test schemes #929 @polac24
- Adds App Clip support. #909 @brentleyjones @dflems
- Application extension schemes now default toand the correct debugger and launcher identifiers #932 @brentleyjonesonlyCopyFilesOnInstall
- Updated SettingsPresets to use new defaults from Xcode 12. #953 @liamnichols
- Enable Base Internationalization by default as per Xcode 12 behavior. #954 @liamnichols#### Changed
- Change default project version to Xcode 12 #960 @yonaskolb
#### Internal
- Updates CI to run on Xcode 12. #936 @dflems @yonaskolb
#### Fixed
- Select the first runnable build target, if present. #957 @codeman9
- Allow SDK dependencies to be embedded. #922 @k-thorat
- Allow creating intermediary groups outside of the project directory. #892 @segiddins
- Fix appex's Runpath Search Paths under macOS target. #952 @rinsuki
-is extended for the Embed App Extensions build phase. #948 @RomanPodymovoptions.fileTypes2.17.0
#### Added
- Added
which lets you set cross project defaults for certain file extensions #914 @yonaskolbonlyCopyFilesOnInstall
- Addedoption to targets for the Embed Files build phase. #912 @jsorgewasCreatedForAppExtension = YES#### Fixed
- Treat all directories with known UTI as file wrapper. #896 @KhaosT
- Generated schemes for application extensions now contain. #898 @muizidnlink: false
- Allow package dependencies to use#920 @k-thoratlaunchAutomaticallySubstyle
- Fixed issue computing relative paths. #915 @andrewreach#### Internal
- Updated to XcodeProj 7.13.0 #908 @brentleyjones
2.16.0
#### Added
- Improve speed of metadata parsing and dependency resolution. #803 @michaeleisel
- Improve support for iOS sticker packs and add support forto run schemes. #824 @scelisoptions.groupOrdering
- Add --project-root option to generate command. #828 @ileitch
- Add an ability to set an order of groups with#613 @BeniamiiinpreActions
- Add the ability to output a dependency graph in graphviz format #852 @jeffctown
- Adds uncluttering the project manifest dumped to YAML from empty values #858 @paciej00
- Added ability to name the executable target when declaring schemes. #869 @elland
- Added ability to set executable to Ask to Launch. #871 @pinda#### Fixed
- Fixed issue when linking and embedding static frameworks: they should be linked and NOT embed. #820 @acecilia
- Fixed issue when generating projects for paths with a dot in the folder for swift sources. #826 @asifmohd
- Prefix static library target filenames with 'lib' to match Xcode. #831 @ileitch
- Fixed duplicate addition of carthage static frameworks. #829 @funzin
- Fix handling of SWIFT_INSTALL_OBJC_HEADER when its value is YES/NO. #827 @ileitch
- SetandpostActionson thebuildaction of a TargetScheme instead of the other actions. #823 @brentleyjonesinclude
- Prevent test targets from being set as a scheme's launch action #835 @brentleyjones
- Implicitly include bundles in the Copy Bundle Resources build phase. #838 @skirchmeier
- Fixed dumping a project manifest which contains an array of project references #840 @paciej00
- Generate correct PBXTargetDependency for external targets. #843 @ileitch
- Fix linking of multiple products from the same Swift Package #830 @toshi0383
- Don't deduplicate files inwith different path but same name. #849 @akkyiexcmappingmodel
- Don't link transitive static carthage libraries. #853 @akkyie
- Optimize simplifying paths for faster project generation. #857 @akkyie
- Fixed issue where wrapper folders may not include correctly in the generated project. #862 @KhaosT
- Compilefiles instead of copying bundle resources. #834 @jcolicchioComplie Sources
- Fixed issue wherebuild phase is generated for resource bundles even when they have no files to compile #878 @nkukushkinframework.static2.15.1
#### Fixed
- Fixed issue which caused watch app schemes to be generated incorrectly, preventing these apps from launching. #798 @daltonclaybrook
- Added build presets for the target type. #819 @aceciliapackages
- Fixed XcodeProj resolution and updated to 7.10.0 #822 @soffes2.15.0
#### Added
- Add support for local Swift Packages in
usingpath. #808 @freddi-kitbuildImplicitDependencies
- Addas an option onTargetScheme. #810 @evandcolemandefaultConfigurationName#### Fixed
- Fixed resolving path to local Swift Packages #796 @freddi-kit
- Added ability to stop on every main thread checker issue on Run schemes and TargetSchemes #799 @ionutivan
- Avoid copying ObjC interface header when SWIFT_INSTALL_OBJC_HEADER=false. #805 @kateinoigakukun2.14.0
#### Added
- Add ability to embed and code sign Swift package dependencies with dynamic products. #788 @alexruperez
#### Fixed
- Revert "Add Base to known regions even if one doesn't exist" #791 @bryansum
- Setfor every target which is defined in a project. #787 @ken0nekTEST_TARGET_NAME
- Setonly when a project has UITest bundle. #792 @ken0nekCopy Bundle Resources
- Set xcodeproj path in project.xcworkspace/contents.xcworkspacedata #793 @ken0nek2.13.1
#### Fixed
- Validate scheme test action and test coverage target references before generating. #775 @liamnichols
- Fixed parsing prerelease identifiers in Swift package versions #779 @yonaskolb
- Fixed using legacy targets as dependencies #778 @yonaskolb#### Internal
- Updated to XcodeProj 7.8.0 #777 @yonaskolb
- Use <https://github.com/mxcl/Version> #779 @yonaskolb2.13.0
#### Added
- Support External Target References via subprojects. #701 @evandcoleman
#### Fixed
- Fixed compilation as library by locking down XcodeProj version #767 @yonaskolb
- Stabilized sorting of groups with duplicate names/paths. #671 @ChristopherRogers
- Movedto afterLink with Librariesbuild phase #768 @yonaskolbpod install#### Internal
- Updated to XcodeProj 7.7.0 #767 @yonaskolb
2.12.0
#### Added
- Added pre and post command options. Useful for running
in combination with--use-cache#759 @yonaskolb--only-plists
- Support for language and region settings on a target basis #728 @FranzBusch
- Added option to generate only Info.plist files with#739 @namolnadsimulateLocation
- Added the option to specify ain a scheme #722 @basvankuijckprojectReference.path
- Support for On Demand Resources tags #753 @sipao#### Fixed
- Fixed resolving a relative path for
#740 @kateinoigakukunFRAMEWORK_SEARCH_PATHS
- Don't add framework dependency's directory toif it is implicit #744 @ikesyo @yutailang0119XcodeProj
- Fixed resolving relative path passed to#751 @PycKamilxcodegen dump
- Prefer configurations named "Debug" or "Release" for default scheme build configurations #752 @john-flanagan
- Added an extra check for package versions. #755 @basvankuijck#### Internal
- Update to SwiftCLI 6.0 and use the new property wrappers #749 @yonaskolb
2.11.0
#### Added
- Add Carthage static framework dependencies support. #688 @giginet
- Addedcommand #710 @yonaskolb--no-env
- Addedoption to disable environment variables expansion #704 @rcaribundle
- Added custom group support for target sources #621 @sroebert @rcari
- Added new dependency type,. This allows targets to copy bundles from other projects #616 @bsmith11*.intentdefinition#### Fixed
- Improved variable expansion runtime #704 @rcari
- Fixed missing headers for static framework targets #705 @wag-miles
- Using more file types from XcodeProj for PBXFileReferences resulting in less project diffs #715 @yonaskolb
- Fixed localizednot being added to build source phases #720 @giginetselectedLauncherIdentifier
- Fixednot being setXcode.IDEFoundation.Launcher.PosixSpawnwhendebugEnabled: falseis defined in test action #725 @ken0nek$old_form
- Fixed unnecessary dependencies related to SwiftPM #726 @tid-kijyun#### Changed
- Deprecated
variables in favor of${new_form}variables #704 @rcarionlyGenerateCoverageForSpecifiedTargets
- Updated XcodeProj to 7.4.0 #709 @yonaskolb
- Updated to Swift 5.1 #714 @yonaskolb2.10.1
#### Fixed
- Add Base to knownRegions even if one doesn't exist #694 @bryansum
- Fixed missingissue #700 @kateinoigakukunlink
- Fixed regression on dependenciesflag #703 @rcaricoverageTargets2.10.0
#### Added
- Support Target Reference to another project. #655 @kateinoigakukun
- Addedfor test target. This enables to gather code coverage for specific targets. #656 @kateinoigakukunbundle#### Fixed
- Add base localisation by default even if no base localised files were found. Fixes warning in Xcode 11 #685 @yonaskolb
- Don't generate CFBundleExecutable in default generated Info.plist fortarget types #689 @FranzBuschrcproject
- Fixed resolving relative paths with custom project destination #681 @giginet
- Fixed resolving relative paths for Info.plist #683 @giginet
- Fixed macOS unit test target TEST_HOST #696 @mjarvis#### Internal
- Restructure targets #698 @yonaskolb
2.9.0
#### Added
- Added Scheme Templates #672 @bclymer
#### Fixed
- Fixed macOS unit test setting preset #665 @yonaskolb
- Addfiles to sources build phase instead of resources #669 @Qusicincludes
- Prefer default configuration names for generated schemes #673 @giginet
- Fixed some resource files being placed to "Recovered References" group #679 @nivanchikov#### Internal
- Updated to SwiftCLI 5.3.2 #667 @giginet
- Fixed tests in case-sensitive file system #670 @Qusic2.8.0
#### Added
- Added support for Swift Package dependencies #624 @yonaskolb
- Addedtosourcesfor a Target. This follows the same glob-style asexcludesbut functions as a way to only include files that match a specified pattern. Useful if you only want a certain file type, for example specifying/*.swift. #637 @bclymerdylib
- SupportSDK. #650 @kateinoigakukunlanguage
- Addedandregionoptions forrunandtestscheme #654 @kateinoigakukundebugEnabled
- Addedoption forrunandtestscheme #657 @kateinoigakukunArray#### Fixed
- Expand template variable in Array of Any #651 @kateinoigakukun
- Significantly improve performance when running with a large number files. #658 @kateinoigakukun
- Removed some more diffs between the generated .pbxproj and when Xcode resaves it #663 @yonaskolb#### Internal
- Removed needless
initialization. #661 @RomanPodymov/*
- Updated to XcodeProj 7.1.0 #624 @yonaskolb2.7.0
#### Added
- Added Bash 4 style recursive globbing (
) in target sourcesexcludes#636 @bclymer.orig
- Added ability to disable main thread checker in Schemes #601 @wag-miles#### Fixed
- Fixed included specs that were referenced multiple times from duplicating content #599 @haritowa
- Fixedfiles being added to the project #627 @keithlink#### Changed
- Allow linking of dependencies into static libraries when
is set to true #635 @kateinoigakukunattributes2.6.0
#### Added
- Added ability to skip tests #582 @kadarandras
- Added ability to seton build files #583 @min${SOME_VARIABLE}
- Allow using environment variables in the form of. This might be a breaking change when a target template attribute is also defined as an environment variable #594 @tomquistwatchapp2-container
- Added support forandframework.staticproduct types #604 @yonaskolb.pch#### Fixed
- Fixed
files being bundled as resources #597 @thiicompatibilityVersion
- Fixed an issue that prevents watchOS Intents Extension from running correctly. #571 @KhaosT#### Changed
- Updated the default
project setting fromXcode 9.3toXcode 10.0#581 @aceciliaapp-extension.intents-service
- Updated to XcodeProj 7.0.0. Note that the length of generated UUIDs has changed #604 @yonaskolb#### Internal
- Added ability to encode ProjectSpec #545 @ryohey
2.5.0
#### Added
- Added support for
target type #536 @yonaskolbroot
- Added support for custominsdkdependency #562 @raptorxczoptional#### Changed
- Updated to xcodeproj 6.7.0 including its performance improvements #536 @yonaskolb
- Updated default generated settings for Xcode 10.2 #555 @yonaskolb
- Changed order of file generation so that plists are now generated before the project, so they will be included in the projects files #544 @tomquist
- Updated Yams to 2.0.0 @yonaskolb#### Fixed
- Fixed groups from sources outside a project spec's directory from being flattened. #550 @sroebert
- Fixedfile sources not being added to the project #557 @yonaskolboptions.findCarthageFrameworks
- Fixed Carthage dependencies being incorrectly embedded in WatchKit app bundles instead of a WatchKit app extension #558 @KhaosT2.4.0
#### Fixed
- Fixed installation when building in Swift 5 #549 @yonaskolb
#### Changed
- Updated to Swift 5 and dropped Swift 4.2 #549 @yonaskolb
2.3.0
#### Added
- Added ability to automatically find all the frameworks for Carthage dependencies via the global
or dependency specificdependency.findFrameworks. See the Carthage usage docs for more info #506 @rpassis @yonaskolbtemplateAttributes
- Added support for nested target templates #534 @tomquist
- Added ability to definewithin a target to be able to parameterize templates. #533 @tomquistlink
- Added ability to setto false in framework dependencies #532 @dimatosaurusmissingConfigFiles
- Addedtooptions.disabledValidationsto optionally skip checking for the existence of config files.deploymentTarget
- Added ability to define a per-platformfor Multi-Platform targets. #510 @ainopara$target_name#### Changed
- DEPRECATION: Placeholders
and$platformhave been deprecated in favour of${target_name}and${platform}. Support for the old placeholders will be removed in a future version #533 @tomquistoptional#### Fixed
- Sources outside a project spec's directory will be correctly referenced as relative paths in the project file. #524
- Fixed error whendirectory source is missing #527 @yonaskolboptions.generateEmptyDirectories
- Fixed excludes within included spec #535 @yonaskolb
- Fixed paths in target templates within included files not being relative #537 @yonaskolb
- Fix multi-platform target templates #541 @yonaskolb
- Fixed sources in an included target not being relative when the sources are mix of string and dictionaries #542 @yonaskolb2.2.0
#### Added
- Added ability to generate empty directories via
#480 @BeniamiiininstrumentsPackage
- Added support for theproduct type #482 @ksullivainputFileLists
- Added support forandoutputFileListswithin project build scripts #500 @lukewakeford$target_name
- Added support for areplacement string within target templates #504 @yonaskolbcreateIntermediateGroups
- Addedto individual Target Sources which overrides the top level option #505 @yonaskolbinclude#### Changed
- BREAKING: All the paths within
files are now relative to that file and not the root spec. This can be disabled with arelativePaths: falseon the include. See the documentation for more details #489 @ellneal--project
- Updated the Xcode compatibility version from 3.2 to 9.3 #497 @yonaskolb
- Exact matches to config names in build settings won't partial apply to other configs #503 @yonaskolb
- UUIDs in the project are standard and don't contain any type prefixes anymore#### Fixed
- Fixed
argument not taking effect #487 @monowerker--use-cache
- Fixed Sticker Packs from generating an empty Source file phase which caused in error in the new build system #492 @rpassis
- Fixed generated schemes for tool targets not setting the executable #496 @yonaskolb
- Fixed resolving Carthage dependencies for iOS app with watchOS target. 465 @raptorxcz2.1.0
#### Added
- Added an experiment new caching feature. Pass
to opt in. This will read and write from a cache file to prevent unnecessarily generating the project. Give it a try as it may become the default in a future release #412 @yonaskolbxcodegen generate#### Changed
- Changed spelling of build phases to preBuildPhase and postBuildPhase. The older names are deprecated but still work 402 @brentleyjones
- Moved generation to a specific subcommand. Simplexcodegenwill continue to work for now #437 @yonaskolbINFOPLIST_FILE
- Ifhas been set on a target, then aninfopath won't ovewrite it #443 @feischl97Info.plist#### Fixed
- Fixed XPC Service package type in generated
#435 @alvarhansenxcodegen
- Fixed phase ordering for modulemap and static library header Copy File phases. 402 @brentleyjones
- Fixed intermittent errors when running multiples concurrently #450 @bryansum--project
- Fixedargument not working #437 @yonaskolbTEST_HOST
- Fixed unit tests not hooking up to host applications properly by default. They now generate aand aTestTargetID#452 @yonaskolb.intentdefinition
- Fixed static libraries not including external frameworks in their search paths #454 @brentleyjones
- Addfiles to sources build phase instead of resources #442 @yonaskolbmlmodel
- Addfiles to sources build phase instead of resources #457 @dwb357weak2.0.0
#### Added
- Added
linking setting for dependencies #411 @alvarhanseninfo
- Addedto targets for generating anInfo.plist#415 @yonaskolbentitlements
- Addedto targets for generating an.entitlementfile #415 @yonaskolbsdk
- Addeddependency type for linking system frameworks and libs #430 @yonaskolbparallelizable
- AddedandrandomExecutionOrdertoSchemetest targets in an expanded form #434 @yonaskolbSDKROOT
- Validate incorrect config setting definitions #431 @yonaskolb
- Automatically set projectif there is only a single platform within the project #433 @yonaskolbTargetSource.headerVisibility#### Changed
- Performance improvements for large projects #388 @yonaskolb @kastiglione
- Upgraded to xcodeproj 6 #388 @yonaskolb
- Upgraded to Swift 4.2 #388 @yonaskolb
- Remove iOS codesigning sdk restriction in setting preset #414 @yonaskolb
- Changed default project version to Xcode 10.0 and default Swift version to 4.2 #423 @yonaskolb
- Added ability to not link Carthage frameworks #432 @yonaskolb#### Fixed
- Fixed code signing issues #414 @yonaskolb
- Fixednot being set in initializer #419 @jerrymarinoen
- Fixed crash when using Xcode Legacy targets as dependencies #427 @dflems1.11.2
If XcodeGen is compiled with Swift 4.2, then UUID's in the generated project will not be deterministic. This will be fixed in an upcoming release with an update to xcodeproj 6.0
#### Fixed
- Fixed release builds in Swift 4.2 #404 @pepibumur
- Fixed default settings for macOS unit-tests #387 @frankdilo
- Fixed Copy Headers phase ordering for Xcode 10 #401 @brentleyjones
- Fixed generated schemes on aggregate targets #394 @vgorloff#### Changed
- Added
as default value for knownRegions #390 @Saik0sPathKit
- Update,Spectre,YamsandxcodeprojdependenciesFRAMEWORK_SEARCH_PATHS1.11.1
#### Fixed
- Fixed
forframeworkdependency paths with spaces #382 @brentleyjonestransitivelyLinkDependencies
- Fixed aggregate targets not being found with#383 @brentleyjonesshowEnvVars1.11.0
#### Added
- Added
to build scripts to disable printing the environment #351 @keithrequiresObjCLinking
- Addedtotarget#354 @brentleyjonestargetTemplates
- Added#355 @yonaskolbaggregateTargets
- Added#353 @yonaskolboptions.groupSortPosition
- Added#356 @yonaskolbcopyFiles
- Added ability to specifybuild phase for sources #345 @brentleyjonesminimumXcodeGenVersion
- Added ability to specify a#349 @brentleyjonescustomArchiveName
- AddedandrevealArchiveInOrganizertoarchive#367 @sxuaxcdatamodel#### Fixed
- Sort files using localizedStandardCompare #341 @rohitpal440
- Use the latestwhen sorted by version #341 @rohitpal440options.xcodeVersion
- Fixed compiler flags being set on non source files in mixed build phase target sources #347 @brentleyjones
- Fixednot being parsed #348 @brentleyjonescarthage copy-frameworks
- Fixed non-application targets using#361 @brentleyjonesxcdatamodel
- Setbased onxccurrentversionif available #364 @rpassis.metal
- XPC Services are now correctly copied #368 @brentley
- Fixedfiles being added to resources #380 @vgorloffstatic.library#### Changed
- Improved linking for
targets #352 @brentleyjonesFrameworks
- Changed default group sorting to be after files #356 @yonaskolb
- MovedandProductstop level groups to bottom #356 @yonaskolbmodulemap
-files are automatically copied to the products directory for static library targets #346 @brentleyjonesFRAMEWORK_SEARCH_PATHS
- Public header files are automatically copied to the products directory for static library targets #365 @brentleyjones
- Swift Objective-C Interface Header files are automatically copied to the products directory for static library targets #366 @brentleyjones
-are adjusted forframeworkdependencies #373 @brentleylibrary.static
-targets haveSKIP_INSTALLset toYES#358 @brentleyCONTRIBUTING.md
- Copy files phases have descriptive names #360 @brentley#### Internal
- Moved brew formula to homebrew core
- AddedSettingPresets1.10.3
#### Fixed
- Fixed Mint installations finding
#338 @yonaskolbtransitivelyLinkDependencies1.10.2
#### Changed
- Set
to false by defaulttransitivelyLinkDependencies1.10.1
#### Fixed
- Fixed
typo #332 @brentleyjonestransitivelyLinkDependencies
- Fixed framework target dependencies not being code signed by default #332 @yonaskolb#### Changed
- Code sign all dependencies by default except target executables #332 @yonaskolb
1.10.0
#### Added
- Added build rule support #306 @yonaskolb
- Added support for frameworks in sources #308 @keith
- Added ability to automatically embed transient dependencies. Controlled with#327 @brentleyjonestarget#### Changed
- Upgraded to Swift 4.1
- Improved Carthage dependency lookup performance with many targets #298 @keith
- By default don't CodeSignOnCopydependencies. This can still be controlled withDependency.codeSign#324 @yonaskolbENABLE_TESTABILITY#### Fixed
- Fixed PBXBuildFile and PBXFileReference being incorrectly generated for Legacy targets #296 @sascha
- Fixed required sources build phase not being generated if there are no sources #307 @yonaskolb
- Fixed install script in binary release #303 @alvarhansen
- Removedfrom framework setting presets #299 @allu22cc
- Fixed homebrew installation #297 @vhbit
-files are now automatically recognized as source files #317 @maickicommandLineArguments
- Fixednot parsing when they had dots in them #323 @yonaskolbPBXContainerItemProxy
- Fixed excluding directories that only have sub directories #326 @brentleyjones
- MadeID more deterministictarget.scheme
- Fixed generated framework schemes from being executable #328 @brentleyjones1.9.0
#### Added
- Scheme pre and post actions can now be added to
#280 @yonaskolbfileGroups
- Individual files can now be added to#293 @yonaskolbxcproj#### Changed
- Updated to
4.3.0 for Xcode 9.3 updatesProjectSpec
- Update default Xcode version to 9.3 including new settings #284 @LinusU
- Breaking for ProjectSpec library users ChangedtoProjectandProjectSpec.OptionstoSpecOptions#281 @jerrymarinonone#### Fixed
- Fixed manual build phase of
not being applied to folders #288 @yonaskolbcreateIntermediateGroups
- Quoted values now correctly get parsed as strings #282 @yonaskolb
- Fixed adding a root source folder whenis on #291 @yonaskolbdefaultConfig
- Fixed Homebrew installations issues on some machines #289 @vhbit
- Fixed files that are added as root sources from having invalid parent groups outside the project directory #293 @yonaskolb1.8.0
#### Added
- Added Project
#269 @keithattributes
- Added Target#276 @yonaskolbDevelopmentTeam
- Automatically setandProvisioningStylewithinTargetAttributesif relevant build settings are defined #277 @yonaskolbLD_RUNPATH_SEARCH_PATHS#### Fixed
- Fixed default
for app extensions #272 @LinusULegacyTarget#### Internal
- Make
init public #264 @jerrymarinocarthageExecutablePath
- Upgrade to _xcproj_ to 4.2.0, _Yams_ to 0.6.0 and _PathKit_ to 0.9.1 @yonaskolb1.7.0
#### Added
- Added support for scheme environment variables #239 @turekj @toshi0383
- Addedoption #244 @akkyieparallelizeBuild
- AddedandbuildImplicitDependenciesto Schemes #241 @rahul-malikxcdatamodeld
@yonaskolb
- Added support for Core Datafiles #249 @yonaskolbheaderVisibilty
- Projects are now generated atomically by writing to a temporary directory first #250 @yonaskolb
- Added script for adding precompiled binary to releases #246 @toshi0383
- Added optionalto target source. This still defaults to public #252 @yonaskolbbuildPhase
- Releases now include a pre-compiled binary and setting presets, including an install script#### Fixed
- Fixed Mint installation from reading setting presets #248 @yonaskolb
- Fixed settingon afoldersource. This allows for a folder of header files #254 @toshi0383embed
- Carthage dependencies are not automatically embedded into test targets #256 @yonaskolb
- Carthage dependencies now respect theproperty #256 @yonaskolboptions.disabledValidations
- iMessage extensions now have proper setting presets in regards to app icon and runtime search paths #255 @yonaskolb
- Excluded files are not added within .lproj directories #238 @toshi03831.6.0
#### Added
- Added scheme pre-actions and post-actions #231 @kastiglione
- AddedincludingmissingConfigsto disable project validation errors #220 @keithlastKnownFileType
- Generate UI Test Target Attributes #221 @anreitersimon#### Fixed
- Filter out duplicate source files #217 @allu22
- Fixed howandexplicitFileTypewere generated across platforms #115 @toshi0383gatherCoverageData
- Removed a few cases of project diffs when opening the project in Xcode @yonaskolb
- Fixed Swift not being embedded by default in watch apps @yonaskolb#### Changed
- Change arrays to strings in setting presets #218 @allu22
- Updated to xcproj 4.0 #2271.5.0
#### Added
- added support for
flag in target schemes #170 @alexruperezcommandLineOptions
- added support forin target schemes #172 @rahul-malikimplicit
- added Project spec as a SwiftPM library for reuse in other projects #164 @soffes
- addedoption for framework dependencies #166 @sbarow--quite
- addedoption to CLI #167 @soffes-v
- can now print version within addition to--version#174 @kastiglioneoptions.xcodeVersion
- added support for legacy targets #175 @bkase
- added support for indentation options #190 @bkase
- added source excludes #135 @peymankh @
- added#197 @yonaskolb @peymankhbuildPhase
- add test targets to Scheme #195 @vhbit
- add option to make a source file optional incase it will be generated later #200 @vhbit
- finalize Scheme spec #201 @yonaskolb
- addedsetting to target source for overriding the guessed build phase of files #206 @yonaskolbdeploymentTarget
- addedsetting to project and target #205 @yonaskolbInfo.plist#### Changed
- huge performance improvements when writing the project file due to changes in xcproj
- updated dependencies
- minor logging changes
- updated Project Spec documentation
- scan forlazely #194 @kastiglione--spec
- change setting presets so that icon settings only get applied to application targets #204 @yonaskolb
- changed scheme build targets format #203 @yonaskolb
- when specifying aargument, the default for the--projectpath is now the directory containing the spec #211 @yonaskolbcreateIntermediateGroups#### Fixed
- fixed shell scripts escaping quotes twice #186 @allu22
- fixedwhen using a relative spec path #184 @kastiglione--version
- fixed command line arguments for test and profile from being overridden #199 @vhbit
- fixed files deep within a hierarchy having the path for a name
- fixed source files from being duplicated if referenced with different casing #212 @yonaskolb
- fixed target product name not being written. Fixes integration with R.swift #213 @yonaskolb1.4.0
#### Added
- added
flag #112 @mironalProjectSpec.options.createIntermediateGroups
- added support for adding individual file sources #106 @bkase
- added source compiler flag support #121 @bkase
- added#108 @bkasename
- added better json loading support #127 @rahul-malik
- added sourcefor customizing names of source directories and file #146 @yonaskolbtype
- added folder reference source support via a newproperty #151 @yonaskolbProjectSpec.options.developmentLanguage
- added#155 @yonaskolbxcconfig#### Changed
- updated to xcproj 1.2.0 #113 @yonaskolb
- build settings from presets will be removed if they are provided infiles #77 @toshi0383mm
- all files and groups are sorted by type and then alphabetically #144 @yonaskolb
- target sources can now have an expanded form #119 @yonaskolb
- empty build phases are now not generated #149 @yonaskolb
- make UUIDs more deterministic #154 @yonaskolb#### Fixed
- only add headers to frameworks and libraries #118 @ryohey
- fixed localized files with the same name #126 @ryohey
- fix intermediate sources #144 @yonaskolb
- fix cyclical target dependencies not working #147 @yonaskolb
- fix directory bundles not being added properly when referenced directly #148 @yonaskolb
- made,candSfile be parsed as source files #120 @bkase @enmillerBase.lproj
- fix the generation of localized variant groups if there is no#157 @ryoheylink
- all localizations found are added to a projects known regions #157 @ryohey#### Internal
- refactoring
- more tests
- added release scripts1.3.0
#### Added
- generate output files for Carthage copy-frameworks script #84 @mironal
- added options.settingPreset to choose which setting presets get applied #100 @yonaskolb
- addedoption for target dependencies #109 @keithALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: YES#### Changed
- updated to xcproj 0.4.1 #85 @enmiller
- don't copy base settings if config type has been left out #100 @yonaskolb
- generate localised files under a single variant group #70 @ryohey
- don't apply common project settings to configs with no type #100 @yonaskolb
- config references in settings can now be partially matched and are case insensitive #111 @yonaskolb
- other small internal changes @yonaskolb#### Fixed
- embed Carthage frameworks for macOS #82 @toshi0383
- fixed copying of watchOS app resources #96 @keith
- automatically ignore more file types for a target's sources (entitlements, gpx, apns) #94 @keith
- change make build to a PHONY task #98 @keith
- allow copying of resource files from dependant targets #95 @keith
- fixed library linking #93 @keith
- fixed duplicate carthage file references #107 @yonaskolb
- an error is now shown if you try and generate a target scheme and don't have debug and release builds @yonaskolb1.2.4
#### Fixed
- setting presets only apply
to applicationscopy-frameworks
- don't add carthage dependency toscript ifembed: falsecarthage copy-frameworks
- sort group children on APFS#### Changed
- update to xcproj 0.3.0
1.2.3
#### Fixed
- Fixed wrong carthage directory name reference for macOS #74 @toshi0383
- Removed unnecessaryfor macOS app target #76 @toshi0383SKIP_INSTALL: YES
- Added some missing default settings for framework targets.fixes archivingTEST_TARGET_NAME
- Filter out nulls from setting presets if specifying an empty string1.2.2
#### Added
- automatically set
on UI test targets if one of the dependencies is an application targetDYLIB_INSTALL_NAME_BASE#### Fixed
- set
to@rpathin framework target presetsASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME
- fixed tvOS launch screen setting.is nowLaunchImagenottvOS LaunchImageinclude1.2.0
#### Added
-
now supports a single string as well as a listconfigFiles
- add support setting xcconfig files on a project with#64fileGroups
- addto project spec for adding groups of files that aren't target source files #64options.bundleIdPrefix
- better output (more info, emoji, colors)
- addfor autogeneratingPRODUCT_BUNDLE_IDENTIFIER#67:REPLACE
- addsyntax when merginginclude#68mint
- addinstallation supportconfigFiles#### Fixed
- fixed homebrew installation
- fixed target xcconfig files not working via#64INFOPLIST_FILE
- look forsetting in project and xcconfig files before adding it automatically. It was just looking in target settings before #64LastUpgradeVersion
- exit with error on failure1.1.0
#### Changed
- set project version to Xcode 9 -
attribute to0900SWIFT_VERSION
- set default Swift version to 4.0 -build setting to4.0project.yml1.0.1
Fixed
- fixed incorrect default build script shell path
- fixed install scripts1.0.0
#### Added
- Swift 4 support #52
- Support for C and C++ files #48 by @antoniocasero
- Xcode 9 default settings#### Fixed
- fixed empty string in YAML not being parsed properly #50 by @antoniocasero
#### Changed
- updated to xcodeproj 0.1.2 #56
- BREAKING: changed target definitions from list to map #540.6.1
#### Added
- Ability to set PBXProject attributes #45
#### Changed
- Don't bother linking target frameworks for target dependencies.
- Move code signing default settings from all iOS targets to iOS application targets, via Product + Platform setting preset files #460.6.0
#### Added
- Allow a project spec to include other project specs #44
#### Changed
- Changed default spec path to
CODE_SIGN_IDENTITY[sdk=iphoneos*]
- Changed default project directory to the current directory instead of the spec file's directory0.5.1
#### Fixed
- Fix embedded framework dependencies
- Addback to iOS targetsFRAMEWORK_SEARCH_PATHS
- Fix build scripts with "" generating invalid projects #430.5.0
#### Added
- Added multi platform targets #35
- Automatically generate platform specificfor Carthage dependencies #38INFOPLIST_FILE
- Automatically find Info.plist and setbuild setting if it doesn't exist on a target #40runOnlyWhenInstalling
- Add options for controlling embedding of dependencies #37#### Fixed
- Fixed localized files not being added to a target's resources
#### Changed
- Renamed Setting Presets to Setting Groups
- Carthage group is now created under top level Frameworks group0.4.0
##### Added
- Homebrew support #16 by @pepibumur
- Addedto build scripts #32carthageBuildPath
- Addedoption #34target: MyExtension#### Fixed
- Fixed installations of XcodeGen not applying build setting presets for configs, products, and platforms, due to missing resources
#### Changed
- Upgraded to <https://github.com/swift-xcode/xcodeproj> 0.1.1 #33
0.3.0 - Extensions and Scheme Tests
#### Added
- Support for app extension dependencies, using the same
syntax #19Target.scheme.testTargets
- Added test targets to generated target schemes via#21Target.generatedSchemes#### Changed
- Updated xcodeproj to 0.0.9
#### Fixed
- Fixed watch and messages apps not copying carthage dependencies
#### Breaking changes
- Changed
toTarget.scheme.configVariantsTarget.prebuildScripts0.2.0 - Build scripts
#### Added
- Added Target build scripts with
andTarget.postbuildScripts#17Target.configFiles
- Support for absolute paths in target sources, run script files, and config files
- Add validation for incorrectxcodegen --version#### Fixed
- Fixed some project objects sometimes having duplicate ids
0.1.0
First official release
---
CONTRIBUTING
Contributing to XcodeGen
There are various ways to contribute to XcodeGen, and all are welcome and appreciated!
- Bug Reports
- Feature Requests
- Answering Questions
- Example Specs
- Documentation
- CodeBug reports
Open issues about problems you may be encountering. When doing so please mention the version you're using.Feature Requests
If you have a good idea for a feature or enhancement open an issue.Answering Questions
Look through the open issues and answer any questions you can.Example specs
Submit your open source xcodegen spec to the Examples page.Documentation
Improve the documentation in the Docs directory.Code
You can submit your own code. This can be bug fixes or new features. If you're not sure what to work on check out the open IssuesGetting started
Make sure you have at least Xcode 9.2 installed.First clone the repo:
git clone https://github.com/yonaskolb/XcodeGen.git
cd XcodeGen
make
To make editing easier you can generate the Xcode project using Swift PM:swift package generate-xcodeproj
ProjectSpecTargets
-: Project spec definitions, loading, parsing and validationXcodeGen
-: XcodeGen CLIXcodeGenKit
-: All the logic for generationXcodeGenKitTests
-: Generation testsswift testTests
Before submitting your PR run the tests to make sure they pass. This can be done either in Xcode or by running.TestProjectAs part of the tests there is a TestProject fixture that will be generated, and if the generated xcode project has any diff in it the test will fail. If the diff is a valid change, commit it as part of your changes.
Note that sometimes having theopen in Xcode will generate it's own diffs, so make sure to have it closed when running the tests.TestProjectIf your change contains any new features or logic changes please add a unit test of your own to cover it. If it's a new feature, see if it can be integrated into the
by adding any required files and then editing the project spec.Resolves #100Submitting your PR
Please give a small summary of what has changed. Also add any github issues links ()..xcodeprojOnce your PR is created, please add a changelog entry to CHANGELOG.md along with the PR number.
---
README
<p align="center">
<a href="https://github.com/yonaskolb/XcodeGen">
<img src="Assets/Logo_animated.gif" alt="XcodeGen" />
</a>
</p>
<p align="center">
<a href="https://github.com/yonaskolb/XcodeGen/releases">
<img src="https://img.shields.io/github/release/yonaskolb/xcodegen.svg"/>
</a>
<a href="https://swiftpackageindex.com/yonaskolb/XcodeGen">
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fyonaskolb%2FXcodeGen%2Fbadge%3Ftype%3Dplatforms" alt="Swift Package Manager Platforms" />
</a>
<a href="https://swiftpackageindex.com/yonaskolb/XcodeGen">
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fyonaskolb%2FXcodeGen%2Fbadge%3Ftype%3Dswift-versions" alt="Swift Versions" />
</a>
<a href="https://github.com/yonaskolb/XcodeGen/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/yonaskolb/XcodeGen.svg"/>
</a>
</p>XcodeGen
XcodeGen is a command line tool written in Swift that generates your Xcode project using your folder structure and a project spec.
The project spec is a YAML or JSON file that defines your targets, configurations, schemes, custom build settings and many other options. All your source directories are automatically parsed and referenced appropriately while preserving your folder structure. Sensible defaults are used in many places, so you only need to customize what is needed. Very complex projects can also be defined using more advanced features.
- ✅ Generate projects on demand and remove your
from git, which means no more merge conflicts!
- ✅ Groups and files in Xcode are always synced to your directories on disk
- ✅ Easy configuration of projects which is human readable and git friendly
- ✅ Easily copy and paste files and directories without having to edit anything in Xcode
- ✅ Share build settings across multiple targets with build setting groups
- ✅ Automatically generate Schemes for different environments like test and production
- ✅ Easily create new projects with complicated setups on demand without messing around with Xcode
- ✅ Generate from anywhere including on CI
- ✅ Distribute your spec amongst multiple files for easy sharing and overriding
- ✅ Easily create multi-platform frameworks
- ✅ Integrate Carthage frameworks without any workGiven an example project spec:
name: MyProject
include:
- base_spec.yml
options:
bundleIdPrefix: com.myapp
packages:
Yams:
url: https://github.com/jpsim/Yams
from: 2.0.0
targets:
MyApp:
type: application
platform: iOS
deploymentTarget: "10.0"
sources: [MyApp]
settings:
configs:
debug:
CUSTOM_BUILD_SETTING: my_debug_value
release:
CUSTOM_BUILD_SETTING: my_release_value
dependencies:
- target: MyFramework
- carthage: Alamofire
- framework: Vendor/MyFramework.framework
- sdk: Contacts.framework
- sdk: libc++.tbd
- package: Yams
MyFramework:
type: framework
platform: iOS
sources: [MyFramework]
A project would be created with 2 connected targets, with all the required configurations and build settings. See the Project Spec documentation for all the options you can specify, and Usage for more general documentation.Installing
Make sure the latest stable (non-beta) version of Xcode is installed first.
Mint
mint install yonaskolb/xcodegen
Make
git clone https://github.com/yonaskolb/XcodeGen.git
cd XcodeGen
make install
Homebrew
brew install xcodegen
Swift Package Manager
Use as CLI
git clone https://github.com/yonaskolb/XcodeGen.git
cd XcodeGen
swift run xcodegen
Use as dependencyAdd the following to your Package.swift file's dependencies:
.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "2.46.0"),
And then import wherever needed:import XcodeGenKitUsage
Simply run:
xcodegen generate
This will look for a project spec in the current directory calledproject.ymland generate an Xcode project with the name defined in the spec..ymlOptions:
- --spec: An optional path to a
or.jsonproject spec. Defaults toproject.yml. (It is also possible to link to multiple spec files by comma separating them. Note that all other flags will be the same.)xcodegen
- --project: An optional path to a directory where the project will be generated. By default this is the directory the spec lives in.
- --quiet: Suppress informational and success messages.
- --use-cache: Used to prevent unnecessarily generating the project. If this is set, then a cache file will be written to when a project is generated. Ifis later run but the spec and all the files it contains are the same, the project won't be generated.~/.xcodegen/cache/{PROJECT_SPEC_PATH_HASH}
- --cache-path: A custom path to use for your cache file. This defaults toxcodegen dumpThere are other commands as well such as
which lets one output the resolved spec in many different formats, or write it to a file. Usexcodegen helpto see more detailed usage information.Editing
git clone https://github.com/yonaskolb/XcodeGen.git
cd XcodeGen
swift package generate-xcodeproj
`
This uses Swift Package Manager to create an xcodeproj` file that you can open, edit and run in Xcode, which makes editing any code easier.If you want to pass any required arguments when running in Xcode, you can edit the scheme to include launch arguments.
Documentation
- See Project Spec documentation for all the various properties and options that can be set
- See Usage for more specific usage and use case documentation
- See FAQ for a list of some frequently asked questions
- See Examples for some real world XcodeGen project specs out in the wild
Alternatives
If XcodeGen doesn't meet your needs try these great alternatives:
- Tuist
- Xcake
- struct
Attributions
This tool is powered by:
- XcodeProj
- JSONUtilities
- Spectre
- PathKit
- Yams
- SwiftCLI
Inspiration for this tool came from:
- struct
- Xcake
- CocoaPods Xcodeproj
Contributions
Pull requests and issues are always welcome. Please open any issues and PRs for bugs, features, or documentation.
[](https://sourcerer.io/fame/yonaskolb/yonaskolb/XcodeGen/links/0)[](https://sourcerer.io/fame/yonaskolb/yonaskolb/XcodeGen/links/1)[](https://sourcerer.io/fame/yonaskolb/yonaskolb/XcodeGen/links/2)[](https://sourcerer.io/fame/yonaskolb/yonaskolb/XcodeGen/links/3)[](https://sourcerer.io/fame/yonaskolb/yonaskolb/XcodeGen/links/4)[](https://sourcerer.io/fame/yonaskolb/yonaskolb/XcodeGen/links/5)[](https://sourcerer.io/fame/yonaskolb/yonaskolb/XcodeGen/links/6)[](https://sourcerer.io/fame/yonaskolb/yonaskolb/XcodeGen/links/7)
License
XcodeGen is licensed under the MIT license. See LICENSE for more info.
---