Skip to content

Commit

Permalink
Adding Swift Package Manager Support
Browse files Browse the repository at this point in the history
Updating gitignore.
Adding Package.swift
Adding Swift tests, getting all builds working.
Downgrading swift package version to be compatible with Xcode 9.1.
Disabling xcode 9.1 tests and redirect tests in other xcode versions.
Changing iPhone types depending on Xcode version.
Passing conditional compilation flags to swift test to disable redirect tests in CI.
Bumping podspec version.
Cleaning up podspec.
Updating example projects.
Adding SPM Example.
Moving Example Stubs to shared folder.
Adding building example apps to CI.
Adding Carthage builds to CI.
Updating rake file for SPM tests.
Passing Swift Versions to carthage.
Updating SPM example to use URLSession instead of URLConnection.
Updating documentation.
  • Loading branch information
jeffctown committed Aug 12, 2019
1 parent a5f9693 commit fda9902
Show file tree
Hide file tree
Showing 214 changed files with 2,317 additions and 1,112 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Xcode
build/
.build/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -18,3 +19,9 @@ IDEWorkspaceChecks.plist
# Carthage
Carthage/
OHHTTPStubs.framework.zip

# Rubymine
.idea/

# SPM
.swiftpm/
52 changes: 46 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,69 @@ before_install:
matrix:
include:
- osx_image: xcode9.1
env: RAKETASK="ios[iOS StaticLib,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.0]"
env: RAKETASK="ios[iOS StaticLib,iPhone 7,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.0]"
- osx_image: xcode9.1
env: RAKETASK="ios[iOS Framework,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.0]"
env: RAKETASK="ios[iOS Framework,iPhone 7,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.0]"
- osx_image: xcode9.1
env: RAKETASK="osx[Mac Framework,x86_64,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.0]"
- osx_image: xcode9.1
env: RAKETASK="tvos[tvOS Framework,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.0]"
- osx_image: xcode9.1
env: RAKETASK="build_carthage_frameworks[iOS,3.2]"
- osx_image: xcode9.1
env: RAKETASK="build_carthage_frameworks[tvOS,3.2]"
- osx_image: xcode9.1
env: RAKETASK="build_carthage_frameworks[MacOS,4.0]"
- osx_image: xcode10.1
env: RAKETASK="ios[iOS StaticLib,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.2]"
env: RAKETASK="ios[iOS StaticLib,iPhone 7,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.2]"
- osx_image: xcode10.1
env: RAKETASK="ios[iOS Framework,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.2]"
env: RAKETASK="ios[iOS Framework,iPhone 7,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.2]"
- osx_image: xcode10.1
env: RAKETASK="tvos[tvOS Framework,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.2]"
- osx_image: xcode10.1
env: RAKETASK="osx[Mac Framework,x86_64,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 SWIFT_VERSION=4.2]"
- osx_image: xcode10.1
env: RAKETASK="spm_test"
- osx_image: xcode10.1
env: RAKETASK="build_carthage_frameworks[iOS,4.1]"
- osx_image: xcode10.1
env: RAKETASK="build_carthage_frameworks[tvOS,4.2]"
- osx_image: xcode10.1
env: RAKETASK="build_carthage_frameworks[MacOS,4.2]"
- osx_image: xcode10.2
env: RAKETASK="ios[iOS StaticLib,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1]"
env: RAKETASK="ios[iOS StaticLib,iPhone 7,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1]"
- osx_image: xcode10.2
env: RAKETASK="ios[iOS Framework,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1]"
env: RAKETASK="ios[iOS Framework,iPhone 7,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1]"
- osx_image: xcode10.2
env: RAKETASK="tvos[tvOS Framework,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1]"
- osx_image: xcode10.2
env: RAKETASK="osx[Mac Framework,x86_64,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1]"
- osx_image: xcode10.2
env: RAKETASK="spm_test"
- osx_image: xcode10.2
env: RAKETASK="build_carthage_frameworks[iOS,5.0]"
- osx_image: xcode10.2
env: RAKETASK="build_carthage_frameworks[tvOS,5.0]"
- osx_image: xcode10.2
env: RAKETASK="build_carthage_frameworks[MacOS,5.0]"
- osx_image: xcode11
env: RAKETASK="ios[iOS StaticLib,iPhone 8,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1]"
- osx_image: xcode11
env: RAKETASK="ios[iOS Framework,iPhone 8,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1]"
- osx_image: xcode11
env: RAKETASK="tvos[tvOS Framework,latest,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1]"
- osx_image: xcode11
env: RAKETASK="osx[Mac Framework,x86_64,build-for-testing test-without-building,OHHTTPSTUBS_SKIP_TIMING_TESTS=1 OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1]"
- osx_image: xcode11
env: RAKETASK="spm_test"
- osx_image: xcode11
env: RAKETASK="build_carthage_frameworks[iOS,5.1]"
- osx_image: xcode11
env: RAKETASK="build_carthage_frameworks[tvOS,5.1]"
- osx_image: xcode11
env: RAKETASK="build_carthage_frameworks[MacOS,5.1]"
- osx_image: xcode11
env: RAKETASK="build_example_apps"


script:
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# OHHTTPStubs — CHANGELOG

## [8.0.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/7.0.0)

## [8.1.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/8.1.0)

* Added support for Swift Package Manager and an example project.
[@jeffctown](https://github.com/jeffctown)


## [8.0.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/8.0.0)

* Update default Swift Version to 5.0
[@croig](https://github.com/CRoig)
Expand Down
31 changes: 16 additions & 15 deletions Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
098FBDE015D704E800623941 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 098FBDDF15D704E800623941 /* main.m */; };
098FBDED15D7056200623941 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 098FBDEB15D7056200623941 /* MainViewController.m */; };
098FBDEE15D7056200623941 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 098FBDEC15D7056200623941 /* MainViewController.xib */; };
098FBDF815D70E2600623941 /* stub.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 098FBDF615D70E2600623941 /* stub.jpg */; };
098FBDF915D70E2600623941 /* stub.txt in Resources */ = {isa = PBXBuildFile; fileRef = 098FBDF715D70E2600623941 /* stub.txt */; };
099C7343169016D800239880 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 099C7342169016D800239880 /* [email protected] */; };
1F9ADC8C230037EE00F87660 /* stub.txt in Resources */ = {isa = PBXBuildFile; fileRef = 1F9ADC8A230037EE00F87660 /* stub.txt */; };
1F9ADC8D230037EE00F87660 /* stub.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1F9ADC8B230037EE00F87660 /* stub.jpg */; };
E8C65A455EC5B63D1737AF29 /* libPods-OHHTTPStubsDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F2958101F89CBC90FC44F99 /* libPods-OHHTTPStubsDemo.a */; };
/* End PBXBuildFile section */

Expand All @@ -32,9 +32,9 @@
098FBDEA15D7056200623941 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
098FBDEB15D7056200623941 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
098FBDEC15D7056200623941 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = "<group>"; };
098FBDF615D70E2600623941 /* stub.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stub.jpg; sourceTree = "<group>"; };
098FBDF715D70E2600623941 /* stub.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stub.txt; sourceTree = "<group>"; };
099C7342169016D800239880 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
1F9ADC8A230037EE00F87660 /* stub.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stub.txt; sourceTree = "<group>"; };
1F9ADC8B230037EE00F87660 /* stub.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stub.jpg; sourceTree = "<group>"; };
48556A011AA6E9FD0074B154 /* libPods-OHHTTPStubs.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-OHHTTPStubs.a"; path = "Pods/../build/Debug-iphoneos/libPods-OHHTTPStubs.a"; sourceTree = "<group>"; };
6F2958101F89CBC90FC44F99 /* libPods-OHHTTPStubsDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OHHTTPStubsDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
801E977139BBDAC0CC11ECAC /* Pods-OHHTTPStubsDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OHHTTPStubsDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -94,7 +94,7 @@
098FBDEA15D7056200623941 /* MainViewController.h */,
098FBDEB15D7056200623941 /* MainViewController.m */,
098FBDEC15D7056200623941 /* MainViewController.xib */,
098FBDFA15D70E2F00623941 /* Stubs */,
1F9ADC89230037EE00F87660 /* Stubs */,
098FBDDA15D704E800623941 /* Supporting Files */,
);
name = OHHTTPStubsDemo;
Expand All @@ -111,22 +111,23 @@
path = "Supporting Files";
sourceTree = "<group>";
};
098FBDFA15D70E2F00623941 /* Stubs */ = {
1B8830D2F747CB6ADB7875D1 /* Pods */ = {
isa = PBXGroup;
children = (
098FBDF615D70E2600623941 /* stub.jpg */,
098FBDF715D70E2600623941 /* stub.txt */,
801E977139BBDAC0CC11ECAC /* Pods-OHHTTPStubsDemo.debug.xcconfig */,
B6814E1693353E0AADB9895C /* Pods-OHHTTPStubsDemo.release.xcconfig */,
);
path = Stubs;
name = Pods;
sourceTree = "<group>";
};
1B8830D2F747CB6ADB7875D1 /* Pods */ = {
1F9ADC89230037EE00F87660 /* Stubs */ = {
isa = PBXGroup;
children = (
801E977139BBDAC0CC11ECAC /* Pods-OHHTTPStubsDemo.debug.xcconfig */,
B6814E1693353E0AADB9895C /* Pods-OHHTTPStubsDemo.release.xcconfig */,
1F9ADC8A230037EE00F87660 /* stub.txt */,
1F9ADC8B230037EE00F87660 /* stub.jpg */,
);
name = Pods;
name = Stubs;
path = ../Stubs;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand Down Expand Up @@ -188,8 +189,8 @@
buildActionMask = 2147483647;
files = (
098FBDEE15D7056200623941 /* MainViewController.xib in Resources */,
098FBDF815D70E2600623941 /* stub.jpg in Resources */,
098FBDF915D70E2600623941 /* stub.txt in Resources */,
1F9ADC8D230037EE00F87660 /* stub.jpg in Resources */,
1F9ADC8C230037EE00F87660 /* stub.txt in Resources */,
099C7343169016D800239880 /* [email protected] in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,8 +36,8 @@
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -53,6 +51,7 @@
debugXPCServices = "NO"
stopOnEveryUBSanitizerIssue = "YES"
stopOnEveryMainThreadCheckerIssue = "YES"
migratedStopOnEveryIssue = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
Expand All @@ -65,8 +64,6 @@
ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
18 changes: 9 additions & 9 deletions Examples/ObjC/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
PODS:
- OHHTTPStubs (8.0.0):
- OHHTTPStubs/Default (= 8.0.0)
- OHHTTPStubs/Core (8.0.0)
- OHHTTPStubs/Default (8.0.0):
- OHHTTPStubs (8.1.0):
- OHHTTPStubs/Default (= 8.1.0)
- OHHTTPStubs/Core (8.1.0)
- OHHTTPStubs/Default (8.1.0):
- OHHTTPStubs/Core
- OHHTTPStubs/JSON
- OHHTTPStubs/NSURLSession
- OHHTTPStubs/OHPathHelpers
- OHHTTPStubs/JSON (8.0.0):
- OHHTTPStubs/JSON (8.1.0):
- OHHTTPStubs/Core
- OHHTTPStubs/NSURLSession (8.0.0):
- OHHTTPStubs/NSURLSession (8.1.0):
- OHHTTPStubs/Core
- OHHTTPStubs/OHPathHelpers (8.0.0)
- OHHTTPStubs/OHPathHelpers (8.1.0)

DEPENDENCIES:
- OHHTTPStubs (from `../..`)
Expand All @@ -21,8 +21,8 @@ EXTERNAL SOURCES:
:path: "../.."

SPEC CHECKSUMS:
OHHTTPStubs: 9cbce6364bec557cc3439aa6bb7514670d780881
OHHTTPStubs: c6cf47e62f5b0a26fa945823be964996756ad226

PODFILE CHECKSUM: 9a67077a86911aa4a252748903da3d5ea5d5d922

COCOAPODS: 1.6.1
COCOAPODS: 1.7.5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fda9902

Please sign in to comment.