Skip to content

Commit

Permalink
Update generator and run script usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatyasKriz authored and Matyáš Kříž committed Jan 24, 2019
1 parent 2bcce59 commit 515a91c
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ echo "Mocks Input Directory = $INPUT_DIR"
# After running once, locate `GeneratedMocks.swift` and drag it into your Xcode test target group.
```

Input files can be also specified directly in `Run script` in `Input Files` form. To force run script to rebuild generator even if it already exists, use `--clean` as first argument.
Input files can be also specified directly in `Run script` in `Input Files` form.

To download generator from GitHub instead of building it if it's not present, use the `--download [version]` option as the first argument (i.e. `run --download generate ...` or `run --download 0.12 generate ...` if you need a specific version). If you're having issues with rather long build time (especially in CI), this might be the way to fix it.

Notes: All paths in the Run script must be absolute. Variable `PROJECT_DIR` automatically points to your project directory.
Also include paths to inherited Classes and Protocols for mocking/stubbing parent and grandparents.
Keep in mind to include paths to inherited Classes and Protocols for mocking/stubbing parent and grandparents.

#### Carthage
To use Cuckoo with [Carthage](https://github.com/Carthage/Carthage) add in your Cartfile this line:
Expand Down Expand Up @@ -422,11 +424,11 @@ If a path to a Swift file is supplied, all mocks will be in a single file.

Default value is `GeneratedMocks.swift`.

##### `--testable` (string)
##### `--testable` (string)[,(string)...]

A comma separated list of frameworks that should be imported as @testable in the mock files.

##### `--exclude` (string)
##### `--exclude` (string)[,(string)...]

A comma separated list of classes and protocols that should be skipped during mock generation.

Expand All @@ -442,14 +444,26 @@ Do not generate timestamp.

Do not mock/stub parents and grandparents.

##### `--file-prefix`
##### `--file-prefix` (string)

Names of generated files in directory will start with this prefix. Only works when output path is directory.

##### `--no-class-mocking`

Do not generate mocks for classes.

##### `--regex` (string)

A regular expression pattern that is used to match Classes and Protocols. All that do not match are excluded. Can be used alongside `--exclude` in which case the `--exclude` has higher priority.

##### `-g` or `--glob`

Activate [glob](https://en.wikipedia.org/wiki/Glob_(programming)) parsing for specified input paths.

##### `-d` or `--debug`

Run generator in debug mode. There is more info output as well as included in the generated mocks (e.g. method parameter info).

#### `version` command

Prints the version of this generator.
Expand All @@ -465,10 +479,10 @@ After the `help` you can write name of another command for displaying a command-
Cuckoo is open for everyone and we'd like you to help us make the best Swift mocking library. For Cuckoo development, follow these steps:
1. Make sure you have Xcode 9.1 installed
2. Clone the **Cuckoo** repository
3. In Terminal, run: `make dev` from inside the **Cuckoo** directory.
3. In Terminal, run: `make dev` from inside the **Cuckoo** directory
4. Open `Cuckoo.xcodeproj` and peek around

The project is made of two parts - runtime and code generator. When you open the `Cuckoo.xcodeproj` in Xcode, you'll see these directories:
The project consists of two parts - runtime and code generator. When you open the `Cuckoo.xcodeproj` in Xcode, you'll see these directories:
* `Source` - runtime sources
* `Tests` - tests for the runtime part
* `CuckoGenerator.xcodeproj` - project generated by `swift package generate-xcodeproj` for the Generator sources
Expand Down

0 comments on commit 515a91c

Please sign in to comment.