Skip to content

Commit 9c7c8d0

Browse files
committed
[WIP] Update CwlPreconditionTesting to 2.0.0-beta.1
1 parent f3c7caf commit 9c7c8d0

File tree

19 files changed

+81
-175
lines changed

19 files changed

+81
-175
lines changed

Cartfile.private

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
github "mattgallagher/CwlPreconditionTesting" == 1.2.0
1+
github "mattgallagher/CwlCatchException" == 2.0.0-beta.1
2+
github "mattgallagher/CwlPreconditionTesting" == 2.0.0-beta.1

Cartfile.resolved

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
github "mattgallagher/CwlPreconditionTesting" "1.2.0"
1+
github "mattgallagher/CwlCatchException" "2.0.0-beta.1"
2+
github "mattgallagher/CwlPreconditionTesting" "2.0.0-beta.1"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// swift-tools-version:4.2
1+
// swift-tools-version:5.0
22
import PackageDescription
33

44
let package = Package(
55
name: "CwlCatchException",
66
products: [
7-
.library(name: "CwlCatchException", type: .dynamic, targets: ["CwlCatchException"]),
7+
.library(name: "CwlCatchException", targets: ["CwlCatchException"]),
88
],
99
targets: [
1010
.target(name: "CwlCatchException", dependencies: [.target(name: "CwlCatchExceptionSupport")]),
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# CwlCatchException
2+
A simple Swift wrapper around an Objective-C `@try`/`@catch` statement that selectively catches Objective-C exceptions by `NSException` subtype, rethrowing if any caught exception is not the expected subtype.
3+
4+
Look at [CwlCatchExceptionTests.swift](https://github.com/mattgallagher/CwlCatchException/blob/master/Tests/CwlCatchExceptionTests/CwlCatchExceptionTests.swift) for syntax.
5+
6+
## Requirements
7+
8+
From version 2.0.0-beta.1, building CwlCatchException requires Swift 5 or newer and the Swift Package Manager.
9+
10+
For use with older versions of Swift or other package managers, [use version 1.2.0 or older](https://github.com/mattgallagher/CwlCatchException/tree/1.2.0).
11+
12+
## Adding to your project
13+
14+
Add the following to the `dependencies` array in your "Package.swift" file:
15+
16+
.package(url: "https://github.com/mattgallagher/CwlCatchException.git", from: Version("2.0.0-beta.1"))
17+
18+
Or by adding `https://github.com/mattgallagher/CwlCatchException.git`, version 2.0.0-beta.1 or later, to the list of Swift packages for any project in Xcode.
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020

2121
#import "CwlCatchException.h"
2222

23-
#if !SWIFT_PACKAGE
24-
__attribute__((visibility("hidden")))
25-
#endif
2623
NSException* __nullable catchExceptionOfKind(Class __nonnull type, void (^ __nonnull inBlock)(void)) {
2724
@try {
2825
inBlock();
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,4 @@
2020

2121
#import <Foundation/Foundation.h>
2222

23-
//! Project version number for CwlCatchException.
24-
FOUNDATION_EXPORT double CwlCatchExceptionVersionNumber;
25-
26-
//! Project version string for CwlCatchException.
27-
FOUNDATION_EXPORT const unsigned char CwlCatchExceptionVersionString[];
28-
29-
#if !SWIFT_PACKAGE
30-
__attribute__((visibility("hidden")))
31-
#endif
3223
NSException* __nullable catchExceptionOfKind(Class __nonnull type, void (^ __nonnull inBlock)(void));

Carthage/Checkouts/CwlPreconditionTesting/Dependencies/CwlCatchException/README.md

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
// swift-tools-version:4.0
1+
// swift-tools-version:5.0
22
import PackageDescription
33

44
let package = Package(
55
name: "CwlPreconditionTesting",
66
products: [
7-
.library(name: "CwlPreconditionTesting", type: .dynamic, targets: ["CwlPreconditionTesting", "CwlMachBadInstructionHandler"])
7+
.library(name: "CwlPreconditionTesting", targets: ["CwlPreconditionTesting", "CwlMachBadInstructionHandler"]),
8+
.library(name: "CwlPosixPreconditionTesting", targets: ["CwlPosixPreconditionTesting"])
89
],
910
dependencies: [
10-
.package(url: "https://github.com/mattgallagher/CwlCatchException.git", from: "1.2.0")
11+
.package(url: "https://github.com/mattgallagher/CwlCatchException.git", from: Version(2, 0, 0, prereleaseIdentifiers: ["-beta.1"]))
1112
],
1213
targets: [
1314
.target(
1415
name: "CwlPreconditionTesting",
1516
dependencies: [
1617
.target(name: "CwlMachBadInstructionHandler"),
1718
.product(name: "CwlCatchException")
18-
],
19-
exclude: [
20-
"./Mach/CwlPreconditionTesting.h",
21-
"./Posix/CwlPreconditionTesting.h",
22-
"./CwlCatchBadInstructionPosix.swift"
2319
]
2420
),
21+
.target(
22+
name: "CwlPosixPreconditionTesting"
23+
),
2524
.target(name: "CwlMachBadInstructionHandler"),
26-
.testTarget(name: "CwlPreconditionTestingTests", dependencies: ["CwlPreconditionTesting"])
25+
.testTarget(name: "CwlPreconditionTestingTests", dependencies: ["CwlPreconditionTesting", "CwlPosixPreconditionTesting"])
2726
]
2827
)

0 commit comments

Comments
 (0)