Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue that caused static framework target dependencies from having their default link value inferred as true #1110

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Docs/ProjectSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Note that target names can also be changed by adding a `name` property to a targ
- [ ] **fileTypes**: **[String: [FileType](#filetype)]** - A list of default file options for specific file extensions across the project. Values in [Sources](#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 like `pod install` only if the project is actually regenerated.
- [ ] **useBaseInternationalization**: **Bool** If this is `false` and your project does not include resources located in a **Base.lproj** directory then `Base` will not be included in the projects 'known regions'. The default value is `true`.
- [ ] **useBaseInternationalization**: **Bool** If this is `false` and your project does not include resources located in a **Base.lproj** directory then `Base` will not be included in the projects 'known regions'. The default value is `true`.
- [ ] **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 `"../"`.

```yaml
Expand All @@ -147,7 +147,7 @@ Describe an order of groups. Available parameters:

```yaml
options:
groupOrdering:
groupOrdering:
- order: [Sources, Resources, Tests, Support files, Configurations]
- pattern: '^.*Screen$'
order: [View, Presenter, Interactor, Entities, Assembly]
Expand Down Expand Up @@ -426,7 +426,7 @@ A dependency can be one of a 6 types:
**Linking 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 to `true` depending on the type of the dependency and the type of the target (e.g. static libraries will only link to executables by default).
- [ ] **link**: **Bool** - Whether to link the dependency. Defaults to `true` depending on the type of the dependency and the type of the target (e.g. static libraries and frameworks will only link to executables by default).
- [ ] **codeSign**: **Bool** - Whether the `codeSignOnCopy` setting is applied when embedding framework. Defaults to true
- [ ] **removeHeaders**: **Bool** - Whether the `removeHeadersOnCopy` setting is applied when embedding the framework. Defaults to true
- [ ] **weak**: **Bool** - Whether the `Weak` setting is applied when linking the framework. Defaults to false
Expand Down Expand Up @@ -525,7 +525,7 @@ packages:
targets:
App:
dependencies:
- package: Yams
- package: Yams
- package: SwiftPM
product: SPMUtility
```
Expand Down Expand Up @@ -730,7 +730,7 @@ Any attributes defined within a targets `templateAttributes` will be used to rep
```yaml
targets:
MyFramework:
templates:
templates:
- Framework
templateAttributes:
frameworkName: AwesomeFramework
Expand Down Expand Up @@ -845,7 +845,7 @@ A multiline script can be written using the various YAML multiline methods, for


### Simulate Location
- [x] **allow**: **Bool** - enable location simulation
- [x] **allow**: **Bool** - enable location simulation
- [ ] **defaultLocation**: **String** - set the default location, possible values:
- `London, England`
- `Johannesburg, South Africa`
Expand All @@ -859,9 +859,9 @@ A multiline script can be written using the various YAML multiline methods, for
- `Mexico City, Mexico`
- `New York, NY, USA`
- `Rio de Janeiro, Brazil`
- `<relative-path-to-gpx-file>` (e.g. ./location.gpx)
- `<relative-path-to-gpx-file>` (e.g. ./location.gpx)
Setting the **defaultLocation** to a custom gpx file, you also need to add that file to `fileGroups` for Xcode be able to use it:

```yaml
targets:
MyTarget:
Expand Down Expand Up @@ -897,8 +897,8 @@ schemes:
coverageTargets:
- MyTarget1
- ExternalTarget/OtherTarget1
targets:
- Tester1
targets:
- Tester1
- name: Tester2
parallelizable: true
randomExecutionOrder: true
Expand Down Expand Up @@ -966,7 +966,7 @@ Swift packages are defined at a project level, and then linked to individual tar
- `branch: master`
- `revision: xxxxxx`
- [ ] **github** : **String**- this is an optional helper you can use for github repos. Instead of specifying the full url in `url` you can just specify the github org and repo

### Local Package

- [x] **path**: **String** - the path to the package in local. The path must be directory with a `Package.swift`.
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGenKit/PBXProjGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ public class PBXProjGenerator {
func processTargetDependency(_ dependency: Dependency, dependencyTarget: Target, embedFileReference: PBXFileElement?, platform: String?) {
let dependencyLinkage = dependencyTarget.defaultLinkage
let link = dependency.link ??
((dependencyLinkage == .dynamic && target.type != .staticLibrary) ||
((dependencyLinkage == .dynamic && target.defaultLinkage != .static) ||
(dependencyLinkage == .static && target.type.isExecutable))

if link, let dependencyFile = embedFileReference {
Expand Down
Loading