Skip to content

Commit dd0b267

Browse files
Fix SPM building issue.
- upgrade SPM tool version to current. - Save 5.0 as version specific one. - exclude js files for macOS version.
1 parent fe50b3a commit dd0b267

File tree

3 files changed

+52
-6
lines changed

3 files changed

+52
-6
lines changed

Package.swift

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
// swift-tools-version:5.0
1+
// swift-tools-version:5.5
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

6+
7+
#if os(macOS)
8+
let excludeFiles = [
9+
"./Browser/BrowserViewController.swift", // Because of inheriting iOS only class failed to build on macOS.
10+
"./Browser/browser.js",
11+
"./Browser/browser.min.js",
12+
"./Browser/wk.bridge.min.js"
13+
]
14+
#elseif os(iOS)
15+
let excludeFiles: String = []
16+
#endif
17+
618
let package = Package(
719
name: "Web3swift",
820
platforms: [
921
.macOS(.v10_12), .iOS(.v11),
1022
],
1123
products: [
12-
// Products define the executables and libraries produced by a package, and make them visible to other packages.
1324
.library(name: "web3swift", targets: ["web3swift"]),
1425
],
1526

@@ -20,14 +31,13 @@ let package = Package(
2031
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.4.2"),
2132
],
2233
targets: [
23-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
24-
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
2534
.target(name: "secp256k1"),
35+
2636
.target(
2737
name: "web3swift",
2838
dependencies: ["BigInt", "secp256k1", "PromiseKit", "Starscream", "CryptoSwift"],
29-
exclude: [
30-
]),
39+
exclude: excludeFiles
40+
),
3141
.testTarget(
3242
name: "web3swiftTests",
3343
dependencies: ["web3swift"]),

[email protected]

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// swift-tools-version:5.0
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "Web3swift",
8+
platforms: [
9+
.macOS(.v10_12), .iOS(.v11),
10+
],
11+
products: [
12+
// Products define the executables and libraries produced by a package, and make them visible to other packages.
13+
.library(name: "web3swift", targets: ["web3swift"]),
14+
],
15+
16+
dependencies: [
17+
.package(url: "https://github.com/attaswift/BigInt.git", from: "5.3.0"),
18+
.package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.15.4"),
19+
.package(url: "https://github.com/daltoniam/Starscream.git", from: "4.0.4"),
20+
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.4.2"),
21+
],
22+
targets: [
23+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
24+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
25+
.target(name: "secp256k1"),
26+
.target(
27+
name: "web3swift",
28+
dependencies: ["BigInt", "secp256k1", "PromiseKit", "Starscream", "CryptoSwift"],
29+
exclude: [
30+
]),
31+
.testTarget(
32+
name: "web3swiftTests",
33+
dependencies: ["web3swift"]),
34+
]
35+
)

Sources/web3swift/Browser/BrowserViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import WebKit
1010

11+
// FIXME: Rewrite me, because i'm building only on iOS.
1112
open class BrowserViewController: UIViewController {
1213

1314
public enum Method: String {

0 commit comments

Comments
 (0)