Skip to content

Commit

Permalink
Merge pull request #49 from 3sidedcube/release/v2.3.0
Browse files Browse the repository at this point in the history
Release/v2.3.0
  • Loading branch information
simonmitchell authored Sep 17, 2020
2 parents e2bdf9a + 3c7705a commit 914232d
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
language: swift
xcode_project: ThunderRequest.xcodeproj # path to your xcodeproj folder
osx_image: xcode11
osx_image: xcode12
env:
global:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
matrix:
include:
- xcode_scheme: ThunderRequest-iOS
xcode_destination: platform=iOS Simulator,OS=13.0,name=iPhone 11 Pro Max
xcode_destination: platform=iOS Simulator,OS=14.0,name=iPhone 11 Pro Max
- xcode_scheme: ThunderRequest-macOS
xcode_destination: platform=macOS
- xcode_scheme: ThunderRequest-tvOS
xcode_destination: platform=tvOS Simulator,OS=13.0,name=Apple TV 4K
xcode_destination: platform=tvOS Simulator,OS=14.0,name=Apple TV 4K
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
# Thunder Request

[![Build Status](https://travis-ci.org/3sidedcube/ThunderRequest.svg)](https://travis-ci.org/3sidedcube/ThunderRequest) [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift 5.2](http://img.shields.io/badge/swift-5.2-brightgreen.svg)](https://swift.org/blog/swift-5-2-released/) [![Apache 2](https://img.shields.io/badge/license-Apache%202-brightgreen.svg)](LICENSE.md)
[![Build Status](https://travis-ci.org/3sidedcube/ThunderRequest.svg)](https://travis-ci.org/3sidedcube/ThunderRequest) [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift 5.3](http://img.shields.io/badge/swift-5.3-brightgreen.svg)](https://swift.org/blog/swift-5-3-released/) [![Apache 2](https://img.shields.io/badge/license-Apache%202-brightgreen.svg)](LICENSE.md)

Thunder Request is a Framework used to simplify making http and https web requests.

# Installation

Setting up your app to use Thunder Request is a simple and quick process.
Setting up your app to use ThunderBasics is a simple and quick process. You can choose between a manual installation, or use Carthage.

+ Drag the project file into your project
+ Add ThunderRequest.framework to your Embedded Binaries.
+ Wherever you want to use ThunderRequest use `import ThunderRequest`.
## Carthage

- Add `github "3sidedcube/ThunderRequest" == 2.3.0` to your Cartfile.
- Run `carthage update --platform ios` to fetch the framework.
- Drag `ThunderRequest` into your project's _Linked Frameworks and Libraries_ section from the `Carthage/Build` folder.
- Add the Build Phases script step as defined [here](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos).

## Manual

- Clone as a submodule, or download this repo
- Import ThunderRequest.xcproject into your project
- Add ThunderRequest.framework to your Embedded Binaries.
- Wherever you want to use ThunderBasics use `import ThunderRequest` if you're using swift.

# Authentication Support
Support for authentication protocols such as OAuth2 is available via the `Authenticator` protocol which when set on `RequestController` will have it's delegate methods called to refresh the user's token when it either expires or a 403 is sent by the server.
Expand Down Expand Up @@ -176,6 +186,12 @@ requestController.uploadFile(fileURL, to: "post", progress: { (progress, totalBy
}
```

# Building Binaries for Carthage

Since Xcode 12 there has been issues with building Carthage binaries caused by the inclusion of a secondary arm64 slice in the generated binary needed for Apple Silicon on macOS. This means that rather than simply using `carthage build --archive` you need to use the `./carthage-build build --archive` command which uses the script included with this repo. For more information, see the issue on Carthage's github [here](https://github.com/Carthage/Carthage/issues/3019)

We will be investigating moving over to use SPM as an agency soon, and will also look into migrating to use .xcframeworks as soon as Carthage have support for it.

# Code level documentation
Documentation is available for the entire library in AppleDoc format. This is available in the framework itself or in the [Hosted Version](http://3sidedcube.github.io/iOS-ThunderRequest/)

Expand Down
16 changes: 8 additions & 8 deletions ThunderRequest.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@
INFOPLIST_FILE = ThunderRequestTV/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.3.0;
PRODUCT_BUNDLE_IDENTIFIER = com.3sidedcube.ThunderRequestTV;
PRODUCT_NAME = ThunderRequest;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1137,7 +1137,7 @@
INFOPLIST_FILE = ThunderRequestTV/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.3.0;
PRODUCT_BUNDLE_IDENTIFIER = com.3sidedcube.ThunderRequestTV;
PRODUCT_NAME = ThunderRequest;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1173,7 +1173,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.threesidedcube.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = ThunderRequest;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1205,7 +1205,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.threesidedcube.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = ThunderRequest;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1289,7 +1289,7 @@
INFOPLIST_FILE = ThunderRequestWatch/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.3.0;
PRODUCT_BUNDLE_IDENTIFIER = com.3sidedcube.ThunderRequestWatch;
PRODUCT_NAME = ThunderRequest;
SDKROOT = watchos;
Expand Down Expand Up @@ -1327,7 +1327,7 @@
INFOPLIST_FILE = ThunderRequestWatch/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.3.0;
PRODUCT_BUNDLE_IDENTIFIER = com.3sidedcube.ThunderRequestWatch;
PRODUCT_NAME = ThunderRequest;
SDKROOT = watchos;
Expand Down Expand Up @@ -1517,7 +1517,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.3.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.threesidedcube.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = ThunderRequest;
Expand Down Expand Up @@ -1547,7 +1547,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.threesidedcube.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = ThunderRequest;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion ThunderRequest/String+MD5.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public extension String {
}
var digestData = Data(count: Int(CC_MD5_DIGEST_LENGTH))

_ = digestData.withUnsafeMutableBytes { (digestBody: UnsafeMutableRawBufferPointer) in
digestData.withUnsafeMutableBytes { (digestBody: UnsafeMutableRawBufferPointer) in

guard let baseAddress = digestBody.baseAddress, digestBody.count > 0 else {
return
Expand Down
29 changes: 29 additions & 0 deletions carthage-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# carthage-build.sh
# Usage example: ./carthage-build.sh --platform iOS

set -euo pipefail

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
# Xcode 12 Beta 3:
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A8169g = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
# Xcode 12 beta 4
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A8179i = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
# Xcode 12 beta 5
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A8189h = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
# Xcode 12 beta 6
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A8189n = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
# Xcode 12 GM
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A7208 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
# Xcode 12 GM 2
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A7209 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig
echo 'ONLY_ACTIVE_ARCH=NO' >> $xcconfig
echo 'VALID_ARCHS = $(inherited) x86_64' >> $xcconfig
export XCODE_XCCONFIG_FILE="$xcconfig"
echo $XCODE_XCCONFIG_FILE
carthage "$@"

0 comments on commit 914232d

Please sign in to comment.