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
Mocktail
andHTTPMessage
features were not visible for users that dragOHTTPStubs
as a dependency using Swift Package Manager because thedefault
behaviour 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/Mocktail
andSources/HTTPMessage
were ignored.Tests
While this is not that critical, the same principle applies for the
Tests
as well but I could not get it to work. Currently theMocktail
tests are not ran.Whatever I do, the
Mocktail
tests are not seeing the resources, even though I'm declaring them in thePackage.swift
file. 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
#include
directives which are currently solved for free if you include all your headers in theinclude
folder. Hence, the small change that I did include:• moving the
Mocktail
andHTTPMessage
folders in theSources/OHHTTPStubs
folder;• moving the
.h
files in theirinclude
folders toSources/OHHTTPStubs/include
;• moving the core functionality (old OHHTTPStubs/
*.m
files) in a new folder:Sources/OHHTTPStubs/OHHTTPStubs
so 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
Mocktail
andHTTPMessage
functionalities 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.