Skip to content

Commit

Permalink
Merge branch 'main' into add-skip-ui-tests-flag-to-test-command
Browse files Browse the repository at this point in the history
* main:
  Update the link to documented guidelines in pull request template (tuist#2833)
  `Dependencies.swift` documentation (tuist#2804)
  [Fix] Resources Targets should inherit their parents Deployment Version (tuist#2830)
  docs: add fila95 as a contributor (tuist#2831)
  🗑 Remove 'CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER' key
  📜 Update the beautiful changelog
  🛠 Fix the failing DefaultSettingsProviderTests
  Deal with SPM 🙈
  wip
  wip
  • Loading branch information
mollyIV committed Apr 29, 2021
2 parents 765cd6f + 700d2a2 commit 803b27a
Show file tree
Hide file tree
Showing 16 changed files with 137 additions and 18 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,15 @@
"contributions": [
"code"
]
},
{
"login": "fila95",
"name": "Giovanni Filaferro",
"avatar_url": "https://avatars.githubusercontent.com/u/7265334?v=4",
"profile": "http://nanotek.me",
"contributions": [
"bug"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Request for comments document (if applies):
### Checklist ✅

- [ ] The code architecture and patterns are consistent with the rest of the codebase.
- [ ] The changes have been tested following the [documented guidelines](https://tuist.io/docs/contribution/testing-strategy/).
- [ ] The changes have been tested following the [documented guidelines](https://docs.tuist.io/contributors/testing-strategy/).
- [ ] The `CHANGELOG.md` has been updated to reflect the changes. In case of a breaking change, it's been flagged as such.
- [ ] In case the PR introduces changes that affect users, the documentation has been updated.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Please, check out guidelines: https://keepachangelog.com/en/1.0.0/

## Next
## Next

### Added
- Add support for `runPostActionsOnFailure` for post build actions. [#2752](https://github.com/tuist/tuist/pull/2752) by [@FranzBusch](https://github.com/FranzBusch)
Expand All @@ -16,8 +16,10 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/
- Speed up frameworks metadata reading using Mach-o parsing instead of `file`, `lipo` and `dwarfdump` external processes. [#2814](https://github.com/tuist/tuist/pull/2814) by [@adellibovi](https://github.com/adellibovi)

### Fixed

- `tuist generate` your projects without having to re-open them! 🧑‍💻 [#2828] by [@ferologics](https://github.com/ferologics)
- Fix a bug for which when generating a `Resources` target from a `staticLibrary` or `staticFramework`, the parent's deployment target isn't passed to the new target. [#2830](https://github.com/tuist/tuist/pull/2830) by [@fila95](https://github.com/fila95)
- Fix `.messagesExtension` default settings to include the appropriate `LD_RUNPATH_SEARCH_PATHS` [#2824](https://github.com/tuist/tuist/pull/2824) by [@kwridan](https://github.com/kwridan)
- Fix the link to documented guidelines in pull request template [#2833](https://github.com/tuist/tuist/pull/2833) by [@mollyIV](https://github.com/mollyIV).

## 1.40.0

Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@
"repositoryURL": "https://github.com/tuist/XcodeProj.git",
"state": {
"branch": null,
"revision": "0c889906136b7cba277b9327e9a8217669bb4eb3",
"version": "7.21.0"
"revision": "94e55232d227f9d78b811c98cb2e5d0cbd08987b",
"version": "7.22.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "7.21.0")),
.package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "7.22.0")),
.package(name: "Signals", url: "https://github.com/tuist/BlueSignals.git", .upToNextMajor(from: "1.0.21")),
.package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "5.1.1")),
.package(url: "https://github.com/rnine/Checksum.git", .upToNextMajor(from: "1.0.2")),
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/tiarnann"><img src="https://avatars.githubusercontent.com/u/10522081?v=4" width="100px;" alt=""/><br /><sub><b>Tíarnán McGrath</b></sub></a></td>
<td align="center"><a href="https://github.com/softmaxsg"><img src="https://avatars.githubusercontent.com/u/3723817?v=4" width="100px;" alt=""/><br /><sub><b>Vitaly Chupryk</b></sub></a></td>
<td align="center"><a href="https://github.com/rmnblm"><img src="https://avatars.githubusercontent.com/u/5942764?v=4" width="100px;" alt=""/><br /><sub><b>Roman Blum</b></sub></a></td>
<td align="center"><a href="http://nanotek.me"><img src="https://avatars.githubusercontent.com/u/7265334?v=4" width="100px;" alt=""/><br /><sub><b>Giovanni Filaferro</b></sub></a></td>
</tr>
</table>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ public struct CarthageDependencies: Codable, Equatable {
public extension CarthageDependencies {
/// Specifies origin of Carthage dependency.
enum Dependency: Codable, Equatable {
/// GitHub repositories (both GitHub.com and GitHub Enterprise).
case github(path: String, requirement: Requirement)
/// Other Git repositories.
case git(path: String, requirement: Requirement)
/// Dependencies that are only available as compiled binary `.framework`s.
case binary(path: String, requirement: Requirement)
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/ProjectDescription/Dependencies/Dependencies.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import Foundation

/// A `Dependencies` manifest allows for defining external dependencies for Tuist.
public struct Dependencies: Codable, Equatable {
/// The description of dependency that can be installed using Carthage.
/// The description of a dependency that can be installed using Carthage.
public let carthage: CarthageDependencies?
/// The description of dependency that can be installed using Swift Package Manager.
/// The description of a dependency that can be installed using Swift Package Manager.
public let swiftPackageManager: SwiftPackageManagerDependencies?
/// List of platforms for which you want to install depedencies.
public let platforms: Set<Platform>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ final class ProjectDescriptorGenerator: ProjectDescriptorGenerating {
{
logger.notice("Generating project \(project.name)")

let workspaceData = XCWorkspaceData(children: [])
let selfRef = XCWorkspaceDataFileRef(location: .`self`(""))
let selfRefFile = XCWorkspaceDataElement.file(selfRef)
let workspaceData = XCWorkspaceData(children: [selfRefFile])
let workspace = XCWorkspace(data: workspaceData)
let projectConstants = try determineProjectConstants(graphTraverser: graphTraverser)
let pbxproj = PBXProj(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class ResourcesProjectMapper: ProjectMapping {
product: .bundle,
productName: nil,
bundleId: "\(target.bundleId).resources",
deploymentTarget: target.deploymentTarget,
infoPlist: .extendingDefault(with: [:]),
resources: target.resources,
copyFiles: target.copyFiles,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ final class ResourcesProjectMapperTests: TuistUnitTestCase {
XCTAssertEqual(resourcesTarget.product, .bundle)
XCTAssertEqual(resourcesTarget.platform, target.platform)
XCTAssertEqual(resourcesTarget.bundleId, "\(target.bundleId).resources")
XCTAssertEqual(resourcesTarget.deploymentTarget, target.deploymentTarget)
XCTAssertEqual(resourcesTarget.filesGroup, target.filesGroup)
XCTAssertEqual(resourcesTarget.resources, resources)
}
Expand Down Expand Up @@ -111,6 +112,7 @@ final class ResourcesProjectMapperTests: TuistUnitTestCase {
XCTAssertEqual(resourcesTarget.product, .bundle)
XCTAssertEqual(resourcesTarget.platform, target.platform)
XCTAssertEqual(resourcesTarget.bundleId, "\(target.bundleId).resources")
XCTAssertEqual(resourcesTarget.deploymentTarget, target.deploymentTarget)
XCTAssertEqual(resourcesTarget.filesGroup, target.filesGroup)
XCTAssertEqual(resourcesTarget.coreDataModels, coreDataModels)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ final class DefaultSettingsProvider_iOSTests: TuistUnitTestCase {
// Then

XCTAssertSettings(got, containsAll: projectEssentialDebugSettings)
XCTAssertEqual(got.count, 47)
XCTAssertEqual(got.count, 48)
}

func testProjectSettings_whenRecommendedRelease() throws {
Expand All @@ -296,7 +296,7 @@ final class DefaultSettingsProvider_iOSTests: TuistUnitTestCase {

// Then
XCTAssertSettings(got, containsAll: projectEssentialReleaseSettings)
XCTAssertEqual(got.count, 44)
XCTAssertEqual(got.count, 45)
}

func testProjectSettings_whenNoneDebug() throws {
Expand Down
2 changes: 2 additions & 0 deletions projects/docs/docs/commands/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: "Learn how to use Tuist's dependencies commands to manage third-par

Third-party dependencies are represented by another graph. Dependency managers like [CocoaPods](https://cocoapods.org) integrate it when running `pod install` leverating Xcode workspaces, and Swift Package Manager does it at build time leveraging Xcode's closed build system. Both approaches might lead to integration issues that can cause compilation issues down the road. We are aware that's not a great developer experience and thus we take a different approach to managing third party dependencies that allows leverating Tuist features such as linting and caching. The idea is simple, developers define their Carthage and Package dependencies in a `Dependencies.swift` file. They are fetched by running `tuist dependencies fetch` and integrated into the generated Xcode project at generation time. Because we merge your project and the third-party dependencies' graph into a single graph, we validate and fail early if the resulting graph is invalid.

Check out [this page](/guides/third-party-dependencies/) for the API reference of `Dependencies.swift`.

:::warning Work in progress
This feature is currently being worked on and is not ready to be used yet.
:::
Expand Down
31 changes: 25 additions & 6 deletions projects/docs/docs/guides/third-party-dependencies.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
---
name: Dependencies.swift
exceprt: Learn how to define the contract between the dependency managers and Tuist.
title: Third-party dependencies
slug: '/guides/third-party-dependencies'
description: Learn how to define the contract between the dependency managers and Tuist.
---

:::warning Work in progress
This feature is currently being worked on and is not ready to be used yet.
:::

# Dependencies.swift

Learn how to define the contract between the dependency managers (Cocoapods, Carthage and SPM) and Tuist.
Expand All @@ -18,9 +23,10 @@ Learn how to define the contract between the dependency managers (Cocoapods, Car
### Step 1: "Dependencies.swift"

1. Create `Dependencies.swift` in your project in `Tuist/` directory.
2. Run `tuist edit` to start editing your manifest files.
3. Add `import ProjectDescription` on the top of file.
4. Define your dependencies.
2. You can read more about `Dependencies.swift` [here](/manifests/dependencies/).
3. Run `tuist edit` to start editing your manifest files.
4. Add `import ProjectDescription` on the top of file.
5. Define your dependencies.

Example of project structure with added `Depedencies.swift` manifest file:

Expand Down Expand Up @@ -53,7 +59,7 @@ let dependencies = Dependencies(
### Step 2: "tuist dependencies" commands

1. Pull dependencies using `tuist dependencies fetch` command.
2. You can read more about commands [here](https://docs.tuist.io/commands/dependencies/).
2. You can read more about commands [here](/commands/dependencies/).
3. Tuist will save dependencies in `/Tuist/Dependencies` directory.

The folder structure below shows how Tuist organizes dependencies:
Expand All @@ -79,6 +85,19 @@ Tuist
|- RxSwift
```

If you don't want to check in build artifacts you can update your `.gitignore`:

```bash
# Add this line if you want to avoid checking in a build artifacts from Carthage dependencies.
Tuist/Dependencies/Carthage

# Add this line if you want to avoid checking in a build artifacts from Swift Package Manager dependencies.
Tuist/Dependencies/SwiftPackageManager

# Add this line if you want to avoid checking in a build artifacts from CocoaPods dependencies.
Tuist/Dependencies/Cocoapods
```

### Step 3: Link dependencies

Link pulled dependencies in your project manifest file.
Expand Down
72 changes: 72 additions & 0 deletions projects/docs/docs/manifests/dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: Dependencies.swift
slug: '/manifests/dependencies'
description: This page documents how the Dependencies.swift manifest file can be used define the contract between the dependency managers and Tuist.
---

:::warning Work in progress
This feature is currently being worked on and is not ready to be used yet.
:::

Learn how to get started with `Dependencies.swift` [here](/guides/third-party-dependencies/).

```swift
import ProjectDescription

let dependencies = Dependencies(
carthage: .carthage(
[
.github(path: "Alamofire/Alamofire", requirement: .exact("5.0.4"))
],
options: [.useXCFrameworks, .noUseBinaries]
),
swiftPackageManager: nil, // work in progress, pass `nil`
platforms: [.iOS]
)
```

### Dependencies

A `Dependencies` manifest allows for defining external dependencies for Tuist.

| Property | Description | Type | Required | Default |
| --------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -------- | ------------------------ |
| `carthage` | The description of a dependency that can be installed using Carthage. | [`CarthageDependencies`](#carthage-dependencies) | No | `nil` |
| `swiftPackageManager` | The description of a dependency that can be installed using Swift Package Manager. | [`SwiftPackageManagerDependencies`](#swift-package-manager-dependencies) | No | `nil` |
| `platforms` | List of platforms for which you want to install depedencies. | [`Set<Platform>`](/manifests/project#platform) | No | `Set(Platform.allCases)` |

### Carthage Dependencies

Contains the description of a dependency that can be installed using Carthage.

| Property | Description | Type | Required | Default |
| -------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------ | -------- | ------- |
| `dependencies` | List of depedencies that will be installed using Carthage. | [`[CarthageDependencies.Dependency]`](#carthage-dependencies-dependency) | Yes | |
| `options` | List of options for Carthage installation. | [`Set<CarthageDependencies.Options>`](#carthage-dependencies-options) | No | `[]` |

### Carthage Dependencies Dependency

Specifies origin of Carthage dependency.

| Case | Description |
| ------------------------------ | ---------------------------------------------------------------------- |
| `.github(String, Requirement)` | GitHub repositories (both GitHub.com and GitHub Enterprise). |
| `.git(String, Requirement)` | Other Git repositories. |
| `.binary(String, Requirement)` | Dependencies that are only available as compiled binary `.framework`s. |

### Carthage Dependencies Options

The options that you can set for Carthage installation.

| Case | Description |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `.useXCFrameworks` | When passed, Carthage will produce XCFrameworks instead of regular frameworks. Refers to `--use-xcframeworks` Carthage flag. **Note: It requires Carthage in version at least 0.37.0.** |
| `.noUseBinaries` | When passed, Carthage will rebuild dependencies from source instead of using downloaded binaries when possible. Refers to `--no-use-binaries` Carthage flag. |

### SwiftPackageManagerDependencies

Contains the description of a dependency that can be installed using Swift Package Manager.

| Property | Description | Type | Required | Default |
| ---------- | -------------------------------------------------------------------- | ----------------------------------------- | -------- | ------- |
| `packages` | List of packages that will be installed using Swift Package Manager. | [`[Package]`](/manifests/project#package) | Yes | |
8 changes: 7 additions & 1 deletion projects/docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
'guides/version-management',
'guides/shell-autocompletion',
'guides/stats',
'guides/third-party-dependencies',
],
},
{
Expand All @@ -44,7 +45,12 @@ module.exports = {
{
type: 'category',
label: 'Manifests reference',
items: ['manifests/project', 'manifests/workspace', 'manifests/config'],
items: [
'manifests/project',
'manifests/workspace',
'manifests/dependencies',
'manifests/config',
],
},
{
type: 'category',
Expand Down

0 comments on commit 803b27a

Please sign in to comment.