Skip to content

Commit

Permalink
Merge pull request #29 from XYOracleNetwork/develop
Browse files Browse the repository at this point in the history
add full support for swift packages
  • Loading branch information
Phillip Lorenzo authored Feb 27, 2020
2 parents b51944a + 3228aa7 commit b4a1b0d
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/swiftPackageBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Swift Build

on: [push]

jobs:
build:

runs-on: macos-10.15

steps:
- uses: actions/checkout@v2
- name: Build
run: swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios13.0-simulator"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ DerivedData
# Carthage/Checkouts

Carthage/Build
.build

# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
Expand Down
88 changes: 88 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"object": {
"pins": [
{
"package": "Apollo",
"repositoryURL": "https://github.com/apollographql/apollo-ios.git",
"state": {
"branch": null,
"revision": "1b3758593f927212f43a2d567aff86ef34513dc2",
"version": "0.23.1"
}
},
{
"package": "Promises",
"repositoryURL": "https://github.com/google/promises",
"state": {
"branch": null,
"revision": "6b6f4fe3385ed37389fb231bc40be81de2f1230f",
"version": "1.2.8"
}
},
{
"package": "XyBaseSdk",
"repositoryURL": "https://github.com/XYOracleNetwork/sdk-base-swift.git",
"state": {
"branch": null,
"revision": "837e268d9b167d02fa8a047b15b0f7cca6eff75b",
"version": "1.0.4"
}
},
{
"package": "XyBleSdk",
"repositoryURL": "https://github.com/XYOracleNetwork/sdk-ble-swift.git",
"state": {
"branch": null,
"revision": "84332adab9e928c55df2cd05b894121df9d8fe53",
"version": "3.1.5"
}
},
{
"package": "sdk-core-swift",
"repositoryURL": "https://github.com/XYOracleNetwork/sdk-core-swift.git",
"state": {
"branch": null,
"revision": "98b42d01174c3c39bd0a7d88b55f3b1aafa3eb83",
"version": "3.1.1"
}
},
{
"package": "secp256k1",
"repositoryURL": "https://github.com/Boilertalk/secp256k1.swift.git",
"state": {
"branch": null,
"revision": "823281fe9def21b384099b72a9a53ca988317b20",
"version": "0.1.4"
}
},
{
"package": "SQLite.swift",
"repositoryURL": "https://github.com/stephencelis/SQLite.swift.git",
"state": {
"branch": null,
"revision": "0a9893ec030501a3956bee572d6b4fdd3ae158a1",
"version": "0.12.2"
}
},
{
"package": "Starscream",
"repositoryURL": "https://github.com/daltoniam/Starscream",
"state": {
"branch": null,
"revision": "e6b65c6d9077ea48b4a7bdda8994a1d3c6969c8d",
"version": "3.1.1"
}
},
{
"package": "swift-nio-zlib-support",
"repositoryURL": "https://github.com/apple/swift-nio-zlib-support.git",
"state": {
"branch": null,
"revision": "37760e9a52030bb9011972c5213c3350fa9d41fd",
"version": "1.0.0"
}
}
]
},
"version": 1
}
34 changes: 34 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "sdk-xyo-swift",
platforms: [
.iOS(.v13),
.macOS(.v10_15)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "sdk-xyo-swift",
targets: ["sdk-xyo-swift"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/XYOracleNetwork/sdk-ble-swift.git", from: "3.1.5"),
.package(url: "https://github.com/XYOracleNetwork/sdk-core-swift.git", from: "3.1.1"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "sdk-xyo-swift",
dependencies: ["sdk-core-swift", "XyBleSdk"]),
.testTarget(
name: "sdk-xyo-swiftTests",
dependencies: ["sdk-xyo-swift"]),
]
)
3 changes: 3 additions & 0 deletions Sources/sdk-xyo-swift/sdk_xyo_swift.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
struct sdk_xyo_swift {
var text = "Hello, World!"
}
7 changes: 7 additions & 0 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import XCTest

import sdk_xyo_swiftTests

var tests = [XCTestCaseEntry]()
tests += sdk_xyo_swiftTests.allTests()
XCTMain(tests)
9 changes: 9 additions & 0 deletions Tests/sdk-xyo-swiftTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import XCTest

#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(sdk_xyo_swiftTests.allTests),
]
}
#endif
15 changes: 15 additions & 0 deletions Tests/sdk-xyo-swiftTests/sdk_xyo_swiftTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import XCTest
@testable import sdk_xyo_swift

final class sdk_xyo_swiftTests: XCTestCase {
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(sdk_xyo_swift().text, "Hello, World!")
}

static var allTests = [
("testExample", testExample),
]
}

0 comments on commit b4a1b0d

Please sign in to comment.