Merge pull request #11 from bitmark-inc/fixes/unit-test-and-spm

Support the latest SPM
This commit is contained in:
Anh Nguyen 2022-01-07 15:35:08 +07:00 committed by GitHub
commit 0433254285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 21 deletions

View File

@ -1 +0,0 @@
4.0

View File

@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode9
osx_image: xcode13.2
branches:
only:
- master
@ -9,8 +9,5 @@ before_install:
script:
- swift build
- xcrun xcodebuild -project TweetNacl.xcodeproj -scheme TweetNacl-macOS test | xcpretty
- xcrun xcodebuild -project TweetNacl.xcodeproj -scheme TweetNacl-iOS test | xcpretty
- xcrun xcodebuild -project TweetNacl.xcodeproj -scheme TweetNacl-watchOS test | xcpretty
- xcrun xcodebuild -project TweetNacl.xcodeproj -scheme TweetNacl-tvOS test | xcpretty
- swift test
after_success: bash <(curl -s https://codecov.io/bash)

View File

@ -1,10 +1,30 @@
// swift-tools-version:4.0
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(name: "TweetNacl", products: [.library(name: "TweetNacl", targets: ["TweetNacl"])],
targets: [
.target(name: "CTweetNacl"),
.target(name: "TweetNacl", dependencies: ["CTweetNacl"]),
.testTarget(name: "TweetNaclTests", dependencies: ["TweetNacl"]),
],
swiftLanguageVersions: [4])
let package = Package(
name: "TweetNacl",
products: [
.library(
name: "TweetNacl",
targets: ["TweetNacl"]),
],
dependencies: [],
targets: [
.target(name: "CTweetNacl"),
.target(
name: "TweetNacl",
dependencies: ["CTweetNacl"]),
.testTarget(
name: "TweetNaclTests",
dependencies: ["TweetNacl"],
resources: [
.process("SecretboxTestData.json"),
.process("BoxTestData.json"),
.process("ScalarMultiTestData.json"),
.process("SignTestData.json")
]
),
]
)

View File

@ -48,8 +48,7 @@ class NaclBox_Test: XCTestCase {
let testSuite = XCTestSuite(name: NSStringFromClass(self))
let testBundle = Bundle(for: NaclBox_Test.self)
let fileURL = testBundle.url(forResource: "BoxTestData", withExtension: "json")
let fileURL = Bundle.module.url(forResource: "BoxTestData", withExtension: "json")
let fileData = try! Data(contentsOf: fileURL!)
let json = try! JSONSerialization.jsonObject(with: fileData, options: [])
let arrayOfData = json as! [Array<String>]

View File

@ -77,8 +77,7 @@ class NaclScalarMulti_Tests: XCTestCase {
let testSuite = XCTestSuite(name: NSStringFromClass(self))
let testBundle = Bundle(for: NaclSecretbox_Tests.self)
let fileURL = testBundle.url(forResource: "ScalarMultiTestData", withExtension: "json")
let fileURL = Bundle.module.url(forResource: "ScalarMultiTestData", withExtension: "json")
let fileData = try! Data(contentsOf: fileURL!)
let json = try! JSONSerialization.jsonObject(with: fileData, options: [])
let arrayOfData = json as! [Array<String>]

View File

@ -51,8 +51,7 @@ class NaclSecretbox_Tests: XCTestCase {
let testSuite = XCTestSuite(name: NSStringFromClass(self))
let testBundle = Bundle(for: NaclSecretbox_Tests.self)
let fileURL = testBundle.url(forResource: "SecretboxTestData", withExtension: "json")
let fileURL = Bundle.module.url(forResource: "SecretboxTestData", withExtension: "json")
let fileData = try! Data(contentsOf: fileURL!)
let jsonDecoder = JSONDecoder()
let arrayOfData = try! jsonDecoder.decode([[String]].self, from: fileData)

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "TweetNacl"
s.version = "1.0.2"
s.version = "1.1.1"
s.summary = "TweetNacl wrapper library written in Swift."
s.description = <<-DESC
A Swift wrapper for TweetNacl C library