Mocktail and HTTPMessage features were not visible for users that drag OHTTPStubs as a dependency using Swift Package Manager because the default behaviour of Swift Package Manager is to compile all the sources that are found under: Sources/$(PACKAGE_NAME), hence, the only compiled sources were Sources/OHHTTPStubs. Sources/Mocktail and Sources/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 the Mocktail tests are not ran.
Whatever I do, the Mocktail tests are not seeing the resources, even though I'm declaring them in the Package.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 the include folder. Hence, the small change that I did include:
• moving the Mocktail and HTTPMessage folders in the Sources/OHHTTPStubs folder;
• moving the .h files in their include folders to Sources/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 and HTTPMessage 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.
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, theMocktail
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 theMocktail
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.