STRUCT
Config
Contents
- Properties
generationOptionsinstallOptionscompatibleXcodeVersionspluginscloudcacheswiftVersionpreFetchScriptspreGenerateScriptspostGenerateScriptscocoapodsUseBundler
- Methods
init(compatibleXcodeVersions:cloud:cache:swiftVersion:plugins:generationOptions:installOptions:preFetchScripts:preGenerateScripts:postGenerateScripts:cocoapodsUseBundler:)hash(into:)
public struct Config: Codable, EquatableThe configuration of your environment.
Geko can be configured through a shared Config.swift manifest. When Geko is executed, it traverses up the directories to find a Geko directory containing a Config.swift file. Defining a configuration manifest is not required, but recommended to ensure a consistent behaviour across all the projects that are part of the repository.
The example below shows a project that has a global Config.swift file that will be used when Geko is run from any of the subdirectories:
/Workspace.swift
/Geko/Config.swift # Configuration manifest
/Framework/Project.swift
/App/Project.swiftThat way, when executing Geko in any of the subdirectories, it will use the shared configuration.
The snippet below shows an example configuration manifest:
import ProjectDescription
let config = Config(
compatibleXcodeVersions: ["14.2"],
swiftVersion: "5.7.0"
)Properties
generationOptions
public var generationOptions: GenerationOptionsGeneration options.
installOptions
public let installOptions: InstallOptionsList of options to use when running geko fetch.
compatibleXcodeVersions
public var compatibleXcodeVersions: CompatibleXcodeVersionsSet the versions of Xcode that the project is compatible with.
plugins
public var plugins: [PluginLocation]List of Plugins used to extend Geko.
cloud
public var cloud: Cloud?Cloud configuration.
cache
public var cache: Cache?Cache configuration.
swiftVersion
public var swiftVersion: Version?The Swift tools versions that will be used by Geko to fetch external dependencies. If nil is passed then Geko will use the environment’s version.
- Note: This does not control the
SWIFT_VERSIONbuild setting in regular generated projects, for this please useProject.settingsorTarget.settingsas needed.
preFetchScripts
public var preFetchScripts: [Script]Scripts that are executed before fetch phase. Executed in the same order as declared.
preGenerateScripts
public var preGenerateScripts: [Script]Scripts that are executed before generation phase. Executed in the same order as declared.
postGenerateScripts
public var postGenerateScripts: [Script]Scripts that are executed after generation phase. Executed in the same order as declared.
cocoapodsUseBundler
public var cocoapodsUseBundler: BoolSet to true when cocoapods is used through bundler
Methods
init(compatibleXcodeVersions:cloud:cache:swiftVersion:plugins:generationOptions:installOptions:preFetchScripts:preGenerateScripts:postGenerateScripts:cocoapodsUseBundler:)
public init(
compatibleXcodeVersions: CompatibleXcodeVersions = .all,
cloud: Cloud? = nil,
cache: Cache? = nil,
swiftVersion: Version? = nil,
plugins: [PluginLocation] = [],
generationOptions: GenerationOptions = .options(),
installOptions: InstallOptions = .options(),
preFetchScripts: [Script] = [],
preGenerateScripts: [Script] = [],
postGenerateScripts: [Script] = [],
cocoapodsUseBundler: Bool = false
)Creates a geko configuration.
- Parameters:
- compatibleXcodeVersions: List of Xcode versions the project is compatible with.
- cloud: Cloud configuration.
- cache: Cache configuration.
- swiftVersion: The version of Swift that will be used by Geko.
- plugins: A list of plugins to extend Geko.
- generationOptions: List of options to use when generating the project.
- preFetchScripts: Scripts that are executed before fetch phase. Executed in the same order as declared.
- preGenerateScripts: Scripts that are executed before generation phase. Executed in the same order as declared.
- postGenerateScripts: Scripts that are executed after generation phase. Executed in the same order as declared.
- cocoapodsUseBundler: if passed then will use bundler to work with Cocoapods
Parameters
| Name | Description |
|---|---|
| compatibleXcodeVersions | List of Xcode versions the project is compatible with. |
| cloud | Cloud configuration. |
| cache | Cache configuration. |
| swiftVersion | The version of Swift that will be used by Geko. |
| plugins | A list of plugins to extend Geko. |
| generationOptions | List of options to use when generating the project. |
| preFetchScripts | Scripts that are executed before fetch phase. Executed in the same order as declared. |
| preGenerateScripts | Scripts that are executed before generation phase. Executed in the same order as declared. |
| postGenerateScripts | Scripts that are executed after generation phase. Executed in the same order as declared. |
| cocoapodsUseBundler | if passed then will use bundler to work with Cocoapods |
hash(into:)
public func hash(into hasher: inout Hasher)