Skip to content

Commit 8bf2b26

Browse files
Merge pull request #410 from yaroslavyaroslav/develop
Fix building issue
2 parents 3c65404 + 2871bc8 commit 8bf2b26

File tree

7 files changed

+150
-126
lines changed

7 files changed

+150
-126
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ playground.xcworkspace
3535
# Swift Package Manager
3636
#
3737
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
38-
# Packages/
39-
# Package.pins
38+
Packages/
39+
Package.pins
4040
.build/
4141

4242
# CocoaPods

Package.swift

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
// swift-tools-version:5.0
1+
// swift-tools-version:5.4
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+
]
11+
#elseif os(iOS)
12+
let excludeFiles: String = []
13+
#endif
14+
615
let package = Package(
716
name: "Web3swift",
817
platforms: [
918
.macOS(.v10_12), .iOS(.v11),
1019
],
1120
products: [
12-
// Products define the executables and libraries produced by a package, and make them visible to other packages.
1321
.library(name: "web3swift", targets: ["web3swift"]),
1422
],
1523

@@ -20,14 +28,18 @@ let package = Package(
2028
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.4.2"),
2129
],
2230
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.
2531
.target(name: "secp256k1"),
32+
2633
.target(
2734
name: "web3swift",
2835
dependencies: ["BigInt", "secp256k1", "PromiseKit", "Starscream", "CryptoSwift"],
29-
exclude: [
30-
]),
36+
exclude: excludeFiles,
37+
resources: [
38+
.copy("./Browser/browser.js"),
39+
.copy("./Browser/browser.min.js"),
40+
.copy("./Browser/wk.bridge.min.js")
41+
]
42+
),
3143
.testTarget(
3244
name: "web3swiftTests",
3345
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 {

m≥.sh renamed to carthage.sh

File renamed without changes.

0 commit comments

Comments
 (0)