Mocktail, HTTPMessage Support for SPM #340
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
MocktailandHTTPMessagefeatures were not visible for users that dragOHTTPStubsas a dependency using Swift Package Manager because thedefaultbehaviour of Swift Package Manager is to compile all the sources that are found under:Sources/$(PACKAGE_NAME), hence, the only compiled sources wereSources/OHHTTPStubs.Sources/MocktailandSources/HTTPMessagewere ignored.Tests
While this is not that critical, the same principle applies for the
Testsas well but I could not get it to work. Currently theMocktailtests are not ran.Whatever I do, the
Mocktailtests are not seeing the resources, even though I'm declaring them in thePackage.swiftfile. Some help with this regard would be nice. It seems that the files are not found in the bundle.I tried to keep the changeset to a minimum, sadly, with a custom path for the target we would have had to modify all the
#includedirectives which are currently solved for free if you include all your headers in theincludefolder. Hence, the small change that I did include:• moving the
MocktailandHTTPMessagefolders in theSources/OHHTTPStubsfolder;• moving the
.hfiles in theirincludefolders toSources/OHHTTPStubs/include;• moving the core functionality (old OHHTTPStubs/
*.mfiles) in a new folder:Sources/OHHTTPStubs/OHHTTPStubsso we keep the old structure;• updating the Xcode project to reflect the new hierarchy so it compiles;
Motivation and Context
The problem is descried in #331 ~ SPM users were not able to see the
MocktailandHTTPMessagefunctionalities because they were not included in the framework build process.Final remarks
There is nothing to add to the README file since this was supposed to work out of the box. No credits needed, just moved some folders around.