|
| 1 | +// swift-tools-version:5.10 |
| 2 | +import PackageDescription |
| 3 | + |
| 4 | +let package = Package( |
| 5 | + name: "web3.swift", |
| 6 | + platforms: [ |
| 7 | + .iOS(SupportedPlatform.IOSVersion.v13), |
| 8 | + .macOS(SupportedPlatform.MacOSVersion.v11), |
| 9 | + .watchOS(.v7) |
| 10 | + ], |
| 11 | + products: [ |
| 12 | + .library(name: "web3.swift", targets: ["web3"]), |
| 13 | + .library(name: "web3-zksync.swift", targets: ["web3-zksync"]) |
| 14 | + ], |
| 15 | + dependencies: [ |
| 16 | + .package(url: "https://github.com/attaswift/BigInt", exact: "5.3.0"), |
| 17 | + .package(url: "https://github.com/iwill/generic-json-swift", from: "2.0.0"), |
| 18 | + .package(url: "https://github.com/GigaBitcoin/secp256k1.swift.git", from: "0.6.0"), |
| 19 | + .package(url: "https://github.com/vapor/websocket-kit.git", from: "2.0.0"), |
| 20 | + .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0") |
| 21 | + ], |
| 22 | + targets: [ |
| 23 | + .target( |
| 24 | + name: "web3", |
| 25 | + dependencies: |
| 26 | + [ |
| 27 | + .target(name: "keccaktiny"), |
| 28 | + .target(name: "aes"), |
| 29 | + .target(name: "Internal_CryptoSwift_PBDKF2"), |
| 30 | + .product(name: "BigInt", package: "BigInt"), |
| 31 | + .product(name: "GenericJSON", package: "generic-json-swift"), |
| 32 | + .product(name: "secp256k1", package: "secp256k1.swift"), |
| 33 | + .product(name: "WebSocketKit", package: "websocket-kit"), |
| 34 | + .product(name: "Logging", package: "swift-log") |
| 35 | + ], |
| 36 | + path: "Sources/Web3Swift", |
| 37 | + swiftSettings: [ |
| 38 | + // .concurrencyChecking |
| 39 | + ] |
| 40 | + ), |
| 41 | + .target( |
| 42 | + name: "web3-zksync", |
| 43 | + dependencies: |
| 44 | + [ |
| 45 | + .target(name: "web3") |
| 46 | + ], |
| 47 | + path: "Sources/Web3ZKSync", |
| 48 | + swiftSettings: [ |
| 49 | + // .concurrencyChecking |
| 50 | + ] |
| 51 | + ), |
| 52 | + .target( |
| 53 | + name: "keccaktiny", |
| 54 | + dependencies: [], |
| 55 | + path: "libs/keccak-tiny", |
| 56 | + exclude: ["module.map"] |
| 57 | + ), |
| 58 | + .target( |
| 59 | + name: "aes", |
| 60 | + dependencies: [], |
| 61 | + path: "libs/aes", |
| 62 | + exclude: ["module.map"] |
| 63 | + ), |
| 64 | + .target( |
| 65 | + name: "Internal_CryptoSwift_PBDKF2", |
| 66 | + dependencies: [], |
| 67 | + path: "libs/CryptoSwift" |
| 68 | + ), |
| 69 | + .testTarget( |
| 70 | + name: "web3swiftTests", |
| 71 | + dependencies: ["web3", "web3-zksync"], |
| 72 | + path: "Tests/Web3SwiftTests", |
| 73 | + resources: [ |
| 74 | + .copy("Resources/rlptests.json"), |
| 75 | + .copy("Account/cryptofights_712.json"), |
| 76 | + .copy("Account/ethermail_signTypedDataV4.json"), |
| 77 | + .copy("Account/real_word_opensea_signTypedDataV4.json"), |
| 78 | + ] |
| 79 | + ) |
| 80 | + ] |
| 81 | +) |
| 82 | + |
| 83 | +extension SwiftSetting { |
| 84 | + /// Enable complete concurrency checking for a target in a Swift package using Swift 5.9 or Swift 5.10 |
| 85 | + /// [Swift Concurrency Documentation](https://www.swift.org/documentation/concurrency/) |
| 86 | + static var concurrencyChecking: SwiftSetting { |
| 87 | + .enableExperimentalFeature("StrictConcurrency=complete") |
| 88 | + } |
| 89 | +} |
0 commit comments