-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swift Package Manager Support #122
Open
billbonney
wants to merge
15
commits into
kylef:master
Choose a base branch
from
billbonney:swift-package
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cfe92f8
Added SwiftPM support.
557b97c
Fixed swift build warnings
3ac912b
Remove asset catalog
b258f4b
Updated travis
f0be8d0
added .swiftpm for ci
f48f1c5
removed user files
ecc2dbc
Added content builder
5ada890
Added headers to content builder
a1d61f0
Fixed content builder headers not being sent
1105319
Fix MockingjayURLSessionConfiguration.swift
ppamorim 3468185
fix: ambiguous XCTest.tearDown swizzle
iamDecode 6d25378
feat: allow providing default error to failure
kylef 11f5a44
feat: add text builder
kylef 1ea0efa
feat: add support for redirect responses
kylef 98d39a2
feat: add redirect(to:) builder
kylef File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Xcode | ||
# | ||
build/ | ||
.build | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
|
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,8 +1,6 @@ | ||
matrix: | ||
include: | ||
- os: osx | ||
osx_image: xcode10.2 | ||
language: swift | ||
osx_image: xcode12u | ||
script: | ||
- cd URITemplate && swift package generate-xcodeproj && cd .. | ||
- xcodebuild -project Mockingjay.xcodeproj -scheme Mockingjay test | ||
- pod lib lint --quick | ||
- swift --version | ||
- swift package update | ||
- swift test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// swift-tools-version:5.3 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "Mockingjay", | ||
products: [ | ||
// Products define the executables and libraries a package produces, and make them visible to other packages. | ||
.library( | ||
name: "Mockingjay", | ||
targets: ["Mockingjay"]), | ||
], | ||
dependencies: [ | ||
// Dependencies declare other packages that this package depends on. | ||
.package(name: "URITemplate", url: "https://github.com/kylef/URITemplate.swift.git", .branch("master")), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
// Targets can depend on other targets in this package, and on products in packages this package depends on. | ||
.target( | ||
name: "Mockingjay", | ||
dependencies: [ | ||
.product(name: "URITemplate", package: "URITemplate"), | ||
], | ||
exclude: ["Info.plist"] | ||
), | ||
|
||
.testTarget( | ||
name: "MockingjayTests", | ||
dependencies: [ | ||
"Mockingjay", | ||
.product(name: "URITemplate", package: "URITemplate"), | ||
], | ||
exclude: ["Info.plist"], | ||
resources: [.process("TestAudio.m4a")] | ||
), | ||
] | ||
) |
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
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
Sources/Mockingjay/MockingjayURLSessionConfiguration.swift
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,16 @@ | ||
// | ||
// MockingjayURLSessionConfiguration.m | ||
// Mockingjay | ||
// | ||
// Created by Kyle Fuller on 10/05/2016. | ||
// Copyright © 2016 Cocode. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public class MockingjayURLSessionConfiguration: NSObject { | ||
|
||
public class func swizzleDefaultSessionConfiguration() { | ||
URLSessionConfiguration.mockingjaySwizzleDefaultSessionConfiguration() | ||
} | ||
} |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the problem, that swizzling happens too lately. Previously it was called right after the app instance has been loaded into memory in
[NSObject load];
method, and then app used swizzled version ofURLSessionConfiguration.default
in tests target. Have to moveMockingjayURLSessionConfiguration.m
file intoMyProjectTests
target and add@import Mockingjay;