Feature/completions (#1604)

* Update dependencies.

* Add missing completions.

* Add autocompletions documentation.

* Update changelog.

* Fix flag warnings.

* Remove support for Xcode 11.3.1 & Xcode 11.4

* Mark change as breaking

* Fix workflow

* Empty commit

Co-authored-by: Pedro Piñera <pepibumur@gmail.com>
This commit is contained in:
Marek Fořt 2020-08-14 09:53:16 +02:00 committed by GitHub
parent 811602dd0e
commit 86995636a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 115 additions and 61 deletions

View File

@ -26,7 +26,7 @@ jobs:
runs-on: macOS-latest
strategy:
matrix:
xcode: ["11.3.1", "11.5", "12_beta"]
xcode: ['11.5', '12_beta']
steps:
- uses: actions/checkout@v1
- name: Select Xcode
@ -41,7 +41,7 @@ jobs:
runs-on: macOS-latest
strategy:
matrix:
xcode: ["11.3.1", "11.4"]
xcode: ['11.5']
steps:
- uses: actions/checkout@v1
- name: Select Xcode
@ -55,21 +55,21 @@ jobs:
runs-on: macOS-latest
strategy:
matrix:
xcode: ["11.5"]
xcode: ['11.5']
feature:
[
"generate-1",
"generate-2",
"generate-3",
"generate-4",
"generate-5",
"generate-6",
"init",
"lint",
"scaffold",
"up",
"build",
"cache",
'generate-1',
'generate-2',
'generate-3',
'generate-4',
'generate-5',
'generate-6',
'init',
'lint',
'scaffold',
'up',
'build',
'cache',
]
steps:
- uses: actions/checkout@v1
@ -77,7 +77,7 @@ jobs:
run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app
- uses: actions/setup-ruby@v1
with:
ruby-version: "2.x"
ruby-version: '2.x'
- name: Install Bundler 2.0.2
run: gem install bundler --version 2.0.2
- name: Install Bundler dependencies
@ -94,7 +94,7 @@ jobs:
run: sudo xcode-select -switch /Applications/Xcode_11.5.app
- uses: actions/setup-ruby@v1
with:
ruby-version: "2.x"
ruby-version: '2.x'
- name: Install Bundler 2.0.2
run: gem install bundler --version 2.0.2
- name: Install Bundler dependencies

View File

@ -4,6 +4,10 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/
## Next
### Removed
- **Breaking** Support for Xcode 11.3.x and Xcode 11.4.x [#1604](https://github.com/tuist/tuist/pull/1604) by [@fortmarek](https://github.com/fortmarek)
## 1.15.0 - Riga
### Changed
@ -21,6 +25,7 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/
### Added
- Autocompletions support [#1604](https://github.com/tuist/tuist/issues/1592) by [@fortmarek](https://github.com/fortmarek)
- Add an acceptance test suite to cover a `test cache warm` command on a micro-feature architecture kind of application that is fully statically linked [#1594](https://github.com/tuist/tuist/pull/1594) by [@RomainBoulay](https://github.com/RomainBoulay)
- Add support for setting launch arguments at the target level. [#1596](https://github.com/tuist/tuist/pull/1596) by [@jeroenleenarts](https://github.com/jeroenleenarts)
- Add Homebrew cask up [#1601](https://github.com/tuist/tuist/pull/1601) by [@leszko11](https://github.com/leszko11)

View File

@ -24,7 +24,7 @@
"repositoryURL": "https://github.com/rnine/Checksum.git",
"state": {
"branch": null,
"revision": "9dde3d1d898a5074608a1420791ef0a80c2399f2",
"revision": "cd1ae53384dd578a84a0afef492a4f5d6202b068",
"version": "1.0.2"
}
},
@ -42,8 +42,8 @@
"repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift",
"state": {
"branch": null,
"revision": "a44caef0550c346e0ab9172f7c9a3852c1833599",
"version": "1.3.0"
"revision": "39f08ac5269361a50c08ce1e2f41989bfc4b1ec8",
"version": "1.3.1"
}
},
{
@ -69,8 +69,8 @@
"repositoryURL": "https://github.com/kishikawakatsumi/KeychainAccess.git",
"state": {
"branch": null,
"revision": "b920ad7df3c73189dcdd4aa05c540849b2010dbf",
"version": "4.1.0"
"revision": "3d0ea2c0806791abcc5d7f0d9f62f1cfd4a7264d",
"version": "4.2.0"
}
},
{
@ -87,8 +87,8 @@
"repositoryURL": "https://github.com/ReactiveX/RxSwift.git",
"state": {
"branch": null,
"revision": "b3e888b4972d9bc76495dd74d30a8c7fad4b9395",
"version": "5.0.1"
"revision": "002d325b0bdee94e7882e1114af5ff4fe1e96afa",
"version": "5.1.1"
}
},
{
@ -105,7 +105,7 @@
"repositoryURL": "https://github.com/stencilproject/Stencil",
"state": {
"branch": "master",
"revision": "9c3468e300ba75ede0d7eb4c495897e0ac3591c3",
"revision": "124df01d3c5defdce07872fe1828c764bb969b38",
"version": null
}
},
@ -123,8 +123,8 @@
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "3d79b2b5a2e5af52c14e462044702ea7728f5770",
"version": "0.1.0"
"revision": "7255fd547f70468e19abbac5f7964f1ef309ad92",
"version": "0.2.1"
}
},
{
@ -132,8 +132,8 @@
"repositoryURL": "https://github.com/apple/swift-log.git",
"state": {
"branch": null,
"revision": "74d7b91ceebc85daf387ebb206003f78813f71aa",
"version": "1.2.0"
"revision": "173f567a2dfec11d74588eea82cecea555bdc0bc",
"version": "1.4.0"
}
},
{
@ -141,8 +141,8 @@
"repositoryURL": "https://github.com/apple/swift-tools-support-core",
"state": {
"branch": null,
"revision": "ae8ccef3274e38eb5ae3189c357883510da74a01",
"version": "0.1.1"
"revision": "f39fc6c12266697b1585589090f0004903974685",
"version": "0.1.10"
}
},
{
@ -168,8 +168,8 @@
"repositoryURL": "https://github.com/tuist/XcodeProj",
"state": {
"branch": null,
"revision": "b8798bc3544c083dc5dc290f0f30f50971d5d8d9",
"version": "7.11.0"
"revision": "81bb2bb333eafa68f8ecd8187a4bb56d51e78e97",
"version": "7.14.0"
}
},
{

View File

@ -13,7 +13,7 @@ This document describes the process of releasing new versions of tuist.
4. Update the version in the `Constants.swift` file.
5. Update the `CHANGELOG.md` to include the version section.
6. Commit the changes and tag the commit with the version `git tag x.y.z`.
7. Select the Xcode version 11.3.1 before building the binaries: `sudo xcode-select -s /Applications/Xcode_11.3.1.app`.
7. Select the Xcode version 11.5 before building the binaries: `sudo xcode-select -s /Applications/Xcode_11.5.app`.
8. Package and upload the release to GCS by running `bundle exec rake release`.
9. Upload the installation scripts to GCS by running `bundle exec rake release_scripts`.
10. Create a release on GitHub with the version as a title, the body from the CHANGELOG file, and attach the artifacts in the `build/` directory.

View File

@ -18,21 +18,24 @@ struct BuildCommand: ParsableCommand {
@Flag(
help: "Force the generation of the project before building."
)
var generate: Bool
var generate: Bool = false
@Flag(
help: "When passed, it cleans the project before building it"
)
var clean: Bool
var clean: Bool = false
@Option(
name: .shortAndLong,
help: "The path to the directory that contains the project to be built."
help: "The path to the directory that contains the project to be built.",
completion: .directory
)
var path: String?
@Option(name: [.long, .customShort("C")],
help: "The configuration to be used when building the scheme.")
@Option(
name: [.long, .customShort("C")],
help: "The configuration to be used when building the scheme."
)
var configuration: String?
func run() throws {

View File

@ -11,7 +11,8 @@ struct CachePrintHashesCommand: ParsableCommand {
@Option(
name: .shortAndLong,
help: "The path where the project will be generated."
help: "The path where the project will be generated.",
completion: .directory
)
var path: String?

View File

@ -12,7 +12,8 @@ struct CacheWarmCommand: ParsableCommand {
@Option(
name: .shortAndLong,
help: "The path to the directory that contains the project whose frameworks will be cached"
help: "The path to the directory that contains the project whose frameworks will be cached",
completion: .directory
)
var path: String?

View File

@ -14,7 +14,8 @@ struct DumpCommand: ParsableCommand {
@Option(
name: .shortAndLong,
help: "The path to the folder where the project manifest is"
help: "The path to the folder where the project manifest is",
completion: .directory
)
var path: String?

View File

@ -13,7 +13,8 @@ struct EditCommand: ParsableCommand {
@Option(
name: .shortAndLong,
help: "The path to the directory whose project will be edited"
help: "The path to the directory whose project will be edited",
completion: .directory
)
var path: String?
@ -21,7 +22,7 @@ struct EditCommand: ParsableCommand {
name: [.long, .customShort("P")],
help: "It creates the project in the current directory or the one indicated by -p and doesn't block the process"
)
var permanent: Bool
var permanent: Bool = false
func run() throws {
try EditService().run(path: path,

View File

@ -17,11 +17,12 @@ struct FocusCommand: ParsableCommand {
}
@Flag(help: "Generate a project replacing dependencies with pre-compiled assets.")
var cache: Bool
var cache: Bool = false
@Option(
name: .shortAndLong,
help: "The path to the directory containing the project you plan to focus on."
help: "The path to the directory containing the project you plan to focus on.",
completion: .directory
)
var path: String?

View File

@ -10,17 +10,18 @@ struct GenerateCommand: ParsableCommand {
@Option(
name: .shortAndLong,
help: "The path where the project will be generated."
help: "The path where the project will be generated.",
completion: .directory
)
var path: String?
@Flag(
help: "Only generate the local project (without generating its dependencies)."
)
var projectOnly: Bool
var projectOnly: Bool = false
@Flag(help: "Generate a project replacing dependencies with pre-compiled assets.")
var cache: Bool
var cache: Bool = false
func run() throws {
try GenerateService().run(path: path,

View File

@ -15,12 +15,12 @@ struct GraphCommand: ParsableCommand {
@Flag(
help: "Skip Test targets during graph rendering."
)
var skipTestTargets: Bool
var skipTestTargets: Bool = false
@Flag(
help: "Skip external dependencies."
)
var skipExternalDependencies: Bool
var skipExternalDependencies: Bool = false
@Option(
default: .dot,

View File

@ -17,13 +17,15 @@ struct InitCommand: ParsableCommand {
}
@Option(
help: "The platform (ios, tvos or macos) the product will be for (Default: ios)"
help: "The platform (ios, tvos or macos) the product will be for (Default: ios)",
completion: .list(["ios", "tvos", "macos"])
)
var platform: String?
@Option(
name: .shortAndLong,
help: "The path to the folder where the project will be generated (Default: Current directory)"
help: "The path to the folder where the project will be generated (Default: Current directory)",
completion: .directory
)
var path: String?

View File

@ -11,7 +11,8 @@ struct LintCommand: ParsableCommand {
@Option(
name: .shortAndLong,
help: "The path to the directory that contains the workspace or project to be linted"
help: "The path to the directory that contains the workspace or project to be linted",
completion: .directory
)
var path: String?

View File

@ -11,11 +11,12 @@ struct ListCommand: ParsableCommand {
@Flag(
help: "The output in JSON format"
)
var json: Bool
var json: Bool = false
@Option(
name: .shortAndLong,
help: "The path where you want to list templates from"
help: "The path where you want to list templates from",
completion: .directory
)
var path: String?

View File

@ -32,11 +32,12 @@ struct ScaffoldCommand: ParsableCommand {
@Flag(
help: "The output in JSON format"
)
var json: Bool
var json: Bool = false
@Option(
name: .shortAndLong,
help: "The path to the folder where the template will be generated (Default: Current directory)"
help: "The path to the folder where the template will be generated (Default: Current directory)",
completion: .directory
)
var path: String?

View File

@ -13,7 +13,8 @@ struct DecryptCommand: ParsableCommand {
@Option(
name: .shortAndLong,
help: "The path to the folder containing the encrypted certificates"
help: "The path to the folder containing the encrypted certificates",
completion: .directory
)
var path: String?

View File

@ -10,7 +10,8 @@ struct EncryptCommand: ParsableCommand {
@Option(
name: .shortAndLong,
help: "The path to the folder containing the certificates you would like to encrypt"
help: "The path to the folder containing the certificates you would like to encrypt",
completion: .directory
)
var path: String?

View File

@ -13,7 +13,8 @@ struct UpCommand: ParsableCommand {
@Option(
name: .shortAndLong,
help: "The path to the directory that contains the project."
help: "The path to the directory that contains the project.",
completion: .directory
)
var path: String?

View File

@ -0,0 +1,32 @@
---
name: Autocompletions
excerpt: "To ease usage of tuist, learn how you can generate autocompletions for your shell"
---
Tuist supports autocompletion, so just by hitting a tab your shell can give you hints what you can type next.
This does not come out the box as it is dependent on your shell, so follow the appropriate set of instructions below.
### Installing Zsh Completions
If you have [`oh-my-zsh`](https://ohmyz.sh) installed, you already have a directory of automatically loading completion scripts — `.oh-my-zsh/completions`. Copy your new completion script to a new file in that directory called `_tuist`.
Without `oh-my-zsh`, you'll need to add a path for completion scripts to your function path, and turn on completion script autoloading. First, add these lines to `~/.zshrc`:
```
fpath=(~/.zsh/completion $fpath)
autoload -U compinit
compinit
```
Next, create a directory at `~/.zsh/completion` and copy the completion script to the new directory, again into a file called `_tuist`.
### Installing Bash Completions
If you have [`bash-completion`](https://github.com/scop/bash-completion) installed, you can just copy your new completion script to file `/usr/local/etc/bash_completion.d/_tuist`.
Without `bash-completion`, you'll need to source the completion script directly. Copy it to a directory such as `~/.bash_completions/`, and then add the following line to `~/.bash_profile` or `~/.bashrc`:
```
source ~/.bash_completions/example.bash
To learn more about how completions work, we refer you to [Swift Argument Parser documentation](https://github.com/apple/swift-argument-parser/blob/280700d361c1b3af6e2345f5e24f67fa9450bec6/Documentation/07%20Completion%20Scripts.md).