forked from MakeAWishFoundation/SwiftyMocky
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparation for version 3.3.0 - added CLI tool for Mint, fixed few bu…
…gs (MakeAWishFoundation#189) * Fixes redundant constraints in Verify and Perform for methods with stripped generics * Basic setup for future CLI. * Updated dependencies, renamed and extracted main elements * Renamed project and workspace * Building CLI - mocks setup and Mockfile serialisation * Added setup command * Added auto import extraction and generation commands * Migration setup * Added migration and targets support * Updated messaging and provided template for doctor * Added tools inspection, updated UI * Doctor command for sources and imports * Fixed resources handling * Removed Obj-C dependency * Setup for SPM tests done * Updated SiwftyMocky runtime library to check for XCTest availability instead, removed compilation flag check, assured compatibility with SPM * Updated tests, verified SwiftyMocky works with SPM targets tests * Fastlane actions updated * Updated travis config for support matrix * Different package on linux machines * Fix for MakeAWishFoundation#187 perform with @autoclosure attributes. * Fix for MakeAWishFoundation#175 Handling Self as generic parameter for return type * Added proper resolving Given willReturn parameter. * Fixed also the case when Self is inside one of the method parameters, also as a generic class type * Updated test for older swift versions and build system * New commands and mock init * Fixed inspection when multiple versions of Sourcery installed
- Loading branch information
Showing
68 changed files
with
5,172 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,3 +169,4 @@ Example/fastlane/test_output/report.junit | |
# Sourcery genreated file | ||
default.profraw | ||
.DS_Store | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,55 @@ | ||
language: objective-c | ||
env: | ||
global: | ||
- SWIFT_BRANCH=swift-5.0-release | ||
- SWIFT_VERSION=swift-5.0-RELEASE | ||
|
||
os: osx | ||
language: generic | ||
sudo: required | ||
dist: trusty | ||
osx_image: xcode10 | ||
matrix: | ||
include: | ||
- os: osx | ||
language: swift | ||
osx_image: xcode10 | ||
install: | ||
- rake pods | ||
- brew install mint | ||
script: | ||
- swift --version | ||
- swift build -c release | ||
- sleep 1 | ||
- ./.build/x86_64-apple-macosx10.10/release/swiftymocky doctor | ||
- ./.build/x86_64-apple-macosx10.10/release/swiftymocky generate | ||
- swift test | ||
- fastlane ios test | ||
- rake mock # legacy mock generation | ||
- fastlane tvos test | ||
|
||
- os: osx | ||
language: swift | ||
osx_image: xcode10.2 | ||
install: | ||
- rake pods | ||
- brew install mint | ||
script: | ||
- swift --version | ||
- swift build -c release | ||
- swift run -c release --skip-build --skip-update swiftymocky doctor | ||
- swift run -c release --skip-build --skip-update swiftymocky generate | ||
- swift test | ||
- fastlane ios test | ||
- rake mock # legacy mock generation | ||
- fastlane tvos test | ||
|
||
# For now, Sourcery does not work on linux, so commented it out | ||
# - os: linux | ||
# dist: trusty | ||
# sudo: required | ||
# language: generic | ||
# install: | ||
# - sudo apt-get install clang libicu-dev | ||
# - mkdir swift | ||
# - curl https://swift.org/builds/$SWIFT_BRANCH/ubuntu1404/$SWIFT_VERSION/$SWIFT_VERSION-ubuntu14.04.tar.gz -s | tar xz -C swift &> /dev/null | ||
# - export PATH="$(pwd)/swift/$SWIFT_VERSION-ubuntu14.04/usr/bin:$PATH" | ||
# - git clone https://github.com/yonaskolb/Mint.git | ||
# - cd Mint && swift run mint install yonaskolb/mint | ||
|
||
notifications: | ||
#slack: // TODO: | ||
email: false | ||
|
||
install: | ||
- if [ `uname` == "Linux" ] ; then | ||
curl -sL https://gist.github.com/kylef/5c0475ff02b7c7671d2a/raw/621ef9b29bbb852fdfd2e10ed147b321d792c1e4/swiftenv-install.sh | bash ; | ||
fi | ||
|
||
script: | ||
# - 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then bash certs.sh; fi' # certs for macos app | ||
- rake pods | ||
- rake mock | ||
# - 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then fastlane mac test; fi' # unable to run macos tests on CI now - turning off on CI | ||
- fastlane ios test | ||
- fastlane tvos test | ||
|
||
after_success: | ||
- sleep 5 # workaround https://github.com/travis-ci/travis-ci/issues/4725 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
sourceryCommand: null | ||
mocky.iOS: | ||
sources: | ||
include: | ||
- ./SwiftyMocky-Example/Shared | ||
- ./SwiftyMocky-Example/iOS | ||
- ./SwiftyMocky-Tests/iOS | ||
exclude: | ||
- ./SwiftyMocky-Example/Shared/Other/Excluded.generated.swift | ||
output: ./SwiftyMocky-Tests/iOS/Mocks/Mock.generated.swift | ||
targets: | ||
- Mocky_Tests_iOS | ||
testable: | ||
- Mocky_Example_iOS | ||
import: | ||
- CoreGraphics | ||
- Foundation | ||
- UIKit | ||
mocky.macOS: | ||
sources: | ||
include: | ||
- ./SwiftyMocky-Example/Shared | ||
- ./SwiftyMocky-Example/macOS | ||
- ./SwiftyMocky-Tests/macOS | ||
exclude: | ||
- ./SwiftyMocky-Example/Shared/Other/Excluded.generated.swift | ||
output: ./SwiftyMocky-Tests/macOS/Mocks/Mock.generated.swift | ||
targets: | ||
- Mocky_Tests_macOS | ||
testable: | ||
- Mocky_Example_macOS | ||
import: | ||
- Foundation | ||
mocky.tvOS: | ||
sources: | ||
include: | ||
- ./SwiftyMocky-Example/Shared | ||
- ./SwiftyMocky-Example/tvOS | ||
- ./SwiftyMocky-Tests/tvOS | ||
exclude: | ||
- ./SwiftyMocky-Example/Shared/Other/Excluded.generated.swift | ||
output: ./SwiftyMocky-Tests/tvOS/Mocks/Mock.generated.swift | ||
targets: | ||
- Mocky_Tests_tvOS | ||
testable: | ||
- Mocky_Example_tvOS | ||
import: | ||
- Foundation | ||
cli.core.tests: | ||
sources: | ||
include: | ||
- ./Sources/SwiftyMockyCLICore | ||
output: ./Tests/SwiftyMockyCLICoreTests/Mock.generated.swift | ||
targets: | ||
- Package.swift/SwiftyMockyCLICore | ||
testable: | ||
- SwiftyMockyCLICore | ||
import: | ||
- Foundation | ||
- PathKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "AEXML", | ||
"repositoryURL": "https://github.com/tadija/AEXML", | ||
"state": { | ||
"branch": null, | ||
"revision": "54bb8ea6fb693dd3f92a89e5fcc19e199fdeedd0", | ||
"version": "4.3.3" | ||
} | ||
}, | ||
{ | ||
"package": "Commander", | ||
"repositoryURL": "https://github.com/kylef/Commander", | ||
"state": { | ||
"branch": null, | ||
"revision": "e5b50ad7b2e91eeb828393e89b03577b16be7db9", | ||
"version": "0.8.0" | ||
} | ||
}, | ||
{ | ||
"package": "Crayon", | ||
"repositoryURL": "https://github.com/jianstm/Crayon", | ||
"state": { | ||
"branch": null, | ||
"revision": "05930604feec1ac77b4633a17a722d428d5be2cc", | ||
"version": "0.0.3" | ||
} | ||
}, | ||
{ | ||
"package": "PathKit", | ||
"repositoryURL": "https://github.com/kylef/PathKit", | ||
"state": { | ||
"branch": null, | ||
"revision": "e2f5be30e4c8f531c9c1e8765aa7b71c0a45d7a0", | ||
"version": "0.9.2" | ||
} | ||
}, | ||
{ | ||
"package": "Rainbow", | ||
"repositoryURL": "https://github.com/jianstm/Rainbow", | ||
"state": { | ||
"branch": null, | ||
"revision": "177c6ebae4389c0363ea1bf62a7257151d53acbc", | ||
"version": "0.0.4" | ||
} | ||
}, | ||
{ | ||
"package": "ShellOut", | ||
"repositoryURL": "https://github.com/JohnSundell/ShellOut.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "d3d54ce662dfee7fef619330b71d251b8d4869f9", | ||
"version": "2.2.0" | ||
} | ||
}, | ||
{ | ||
"package": "Spectre", | ||
"repositoryURL": "https://github.com/kylef/Spectre.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "f14ff47f45642aa5703900980b014c2e9394b6e5", | ||
"version": "0.9.0" | ||
} | ||
}, | ||
{ | ||
"package": "SwiftShell", | ||
"repositoryURL": "https://github.com/kareman/SwiftShell", | ||
"state": { | ||
"branch": null, | ||
"revision": "beebe43c986d89ea5359ac3adcb42dac94e5e08a", | ||
"version": "4.1.2" | ||
} | ||
}, | ||
{ | ||
"package": "xcodeproj", | ||
"repositoryURL": "https://github.com/tuist/xcodeproj.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "065f348754b6155b8037dc43876a8f2ee354b95d", | ||
"version": "6.7.0" | ||
} | ||
}, | ||
{ | ||
"package": "Yams", | ||
"repositoryURL": "https://github.com/jpsim/Yams.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "c947a306d2e80ecb2c0859047b35c73b8e1ca27f", | ||
"version": "2.0.0" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// swift-tools-version:4.0 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
#if os(macOS) | ||
/// MacOS swiftymocky mackage | ||
let package = Package( | ||
name: "swiftymocky", | ||
products: [ | ||
.executable(name: "swiftymocky", targets: ["SwiftyMockyCLI"]), | ||
.library(name: "SwiftyMocky", targets: ["SwiftyMocky"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/JohnSundell/ShellOut.git", from: "2.0.0"), | ||
.package(url: "https://github.com/tuist/xcodeproj.git", from: "6.5.0"), | ||
.package(url: "https://github.com/jianstm/Crayon", from: "0.0.3"), | ||
.package(url: "https://github.com/kylef/Commander", from: "0.8.0"), | ||
.package(url: "https://github.com/kylef/PathKit", from: "0.9.0"), | ||
.package(url: "https://github.com/jpsim/Yams.git", from: "2.0.0"), | ||
], | ||
targets: [ | ||
.target( | ||
name: "SwiftyMocky", | ||
path: "./Sources/Classes" | ||
), | ||
.target( | ||
name: "SwiftyMockyCLI", | ||
dependencies: [ | ||
"Commander", | ||
"SwiftyMockyCLICore" | ||
]), | ||
.target( | ||
name: "SwiftyMockyCLICore", | ||
dependencies: [ | ||
"ShellOut", | ||
"Crayon", | ||
"xcodeproj", | ||
"PathKit", | ||
"Yams", | ||
]), | ||
.testTarget( | ||
name: "SwiftyMockyCLICoreTests", | ||
dependencies: [ | ||
"SwiftyMockyCLICore", | ||
"SwiftyMocky" | ||
]), | ||
] | ||
) | ||
#else | ||
/// Linux package. For now not really usable, until sourcery would be available too | ||
let package = Package( | ||
name: "swiftymocky", | ||
products: [ | ||
.executable(name: "swiftymocky", targets: ["SwiftyMockyCLI"]), | ||
.library(name: "SwiftyMocky", targets: ["SwiftyMocky"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/JohnSundell/ShellOut.git", from: "2.0.0"), | ||
.package(url: "https://github.com/jianstm/Crayon", from: "0.0.1"), | ||
.package(url: "https://github.com/kylef/Commander", from: "0.8.0"), | ||
.package(url: "https://github.com/kylef/PathKit", from: "0.0.1"), | ||
.package(url: "https://github.com/jpsim/Yams.git", from: "2.0.0"), | ||
], | ||
targets: [ | ||
.target( | ||
name: "SwiftyMocky", | ||
path: "./Sources/Classes"), | ||
.target( | ||
name: "SwiftyMockyCLI", | ||
dependencies: [ | ||
"Commander", | ||
"SwiftyMockyCLICore" | ||
]), | ||
.target( | ||
name: "SwiftyMockyCLICore", | ||
dependencies: [ | ||
"ShellOut", | ||
"Crayon", | ||
"PathKit", | ||
"Yams", | ||
], | ||
exclude: [ | ||
"Commands/MacOS", | ||
"Utils/MacOS", | ||
]), | ||
.testTarget( | ||
name: "SwiftyMockyCLICoreTests", | ||
dependencies: [ | ||
"SwiftyMockyCLICore", | ||
"SwiftyMocky" | ||
]), | ||
] | ||
) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.