Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yonaskolb committed Aug 13, 2019
1 parent f0e0247 commit e3b66f8
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion Docs/ProjectSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- [Aggregate Target](#aggregate-target)
- [Target Template](#target-template)
- [Scheme](#scheme)
- [Swift Package](#swift-package)

## General

Expand All @@ -46,6 +47,7 @@ You can also use environment variables in your configuration file, by using `${S
- [ ] **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 hierachy anyway. For example a folder of xcconfig files that aren't already added by any target sources, or a Readme file.
- [ ] **schemes**: **[Scheme](#scheme)** - A list of schemes by name. This allows more control over what is found in [Target Scheme](#target-scheme)
- [ ] **targetTemplates**: **[String: [Target Template](#target-template)]** - a list of targets that can be used as templates for actual targets which reference them via a `template` property. They can be used to extract common target settings. Works great in combination with `include`.
- [ ] **packages**: **[String: [Swift Package](#swift-package)]** -

### Include

Expand Down Expand Up @@ -370,6 +372,7 @@ A dependency can be one of a 3 types:
- `framework: path` - links to a framework
- `carthage: name` - helper for linking to a Carthage framework
- `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 level`packages`

**Linking options**:

Expand All @@ -393,7 +396,7 @@ Carthage frameworks are expected to be in `CARTHAGE_BUILD_PATH/PLATFORM/FRAMEWOR
- `PLATFORM` = the target's platform
- `FRAMEWORK` = the specified name.

All the invididual frameworks of a Carthage dependency can be automatically found via `findFrameworks: true`. This overrides the value of [Options](#options).findCarthageFrameworks. Otherwise each one will have to be listed invididually.
All the individual frameworks of a Carthage dependency can be automatically found via `findFrameworks: true`. This overrides the value of [Options](#options).findCarthageFrameworks. Otherwise each one will have to be listed individually.
Xcodegen uses `.version` files 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.

If 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 `FRAMEWORK_SEARCH_PATHS` setting is also automatically added
Expand Down Expand Up @@ -429,6 +432,25 @@ targets:
type: framework
```

**Package dependency**
- [ ] **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

```yaml
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
```

### Config Files

Specifies `.xcconfig` files for each configuration.
Expand Down Expand Up @@ -747,3 +769,28 @@ schemes:
customArchiveName: MyTarget
revealArchiveInOrganizer: false
```

## Swift Package
Swift packages are defined at a project level, and then linked to individual targets via a [Dependency](#dependency).

> Note that Swift Packages don't work in projects with configurations other than Debug and Release

- [x] **url**: **URL** - the url to the package
- [x] **version**: **String** - the version of the package to use. It can take a few forms:
- `majorVersion: 1.2.0`
- `minorVersion: 1.2.1`
- `exactVersion: 1.2.1`
- `minVersion: 1.0.0, maxVersion: 1.2.9`
- `branch: master`
- `revision: xxxxxx`

```yml
packages:
Yams:
url: https://github.com/jpsim/Yams
majorVersion: 2.0.0
targets:
App:
dependencies:
- package: Yams
```

0 comments on commit e3b66f8

Please sign in to comment.