Skip to content

Commit fa54b0a

Browse files
Merge pull request #185 from kylewludwig/swiftpm-archiving-hotfix
SwiftPM archiving hotfix
2 parents 8879616 + c87d63f commit fa54b0a

File tree

97 files changed

+1003
-953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1003
-953
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name: Build
33
on:
44
push:
55
branches:
6-
- 'master'
6+
- "master"
77
tags:
8-
- '*'
8+
- "*"
99
pull_request:
1010
branches:
11-
- '*'
11+
- "*"
1212

1313
jobs:
1414
build:
@@ -30,7 +30,7 @@ jobs:
3030
- name: install tools
3131
run: pip3 install protoc-gen-mavsdk && brew install protobuf
3232
- name: generate from protos
33-
run: bash Sources/MAVSDK-Swift/tools/generate_from_protos.bash
33+
run: bash Sources/Mavsdk/tools/generate_from_protos.bash
3434
- name: check for diff
3535
run: git diff --exit-code
3636
generate-docs:
@@ -41,9 +41,9 @@ jobs:
4141
with:
4242
submodules: recursive
4343
- name: install tools
44-
run: gem install jazzy && pip install s3cmd
44+
run: gem install jazzy && pip install --user s3cmd
4545
- name: generate docs
46-
run: bash Sources/MAVSDK-Swift/tools/generate_docs.sh
46+
run: bash Sources/Mavsdk/tools/generate_docs.sh
4747
- name: deploy docs (if master)
4848
if: github.ref == 'refs/heads/master'
4949
run: s3cmd --acl-public --access_key=${{ secrets.AWS_ACCESS_KEY_ID }} --secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY }} --add-header="Cache-Control:public, max-age=0" put --recursive docs/swift_output/* s3://dronecode-sdk-swift/docs/master/;

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "Sources/MAVSDK-Swift/proto"]
2-
path = Sources/MAVSDK-Swift/proto
3-
url = https://github.com/mavlink/mavsdk-proto
1+
[submodule "Sources/Mavsdk/proto"]
2+
path = Sources/Mavsdk/proto
3+
url = https://github.com/mavlink/MAVSDK-Proto.git

Package.resolved

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
import PackageDescription
44

55
let package = Package(
6-
name: "MAVSDK_Swift",
6+
name: "Mavsdk",
7+
platforms: [
8+
.iOS(.v13),
9+
.macOS(.v10_15)
10+
],
711
products: [
8-
.library(name: "MAVSDK_Swift",
12+
.library(name: "Mavsdk",
913
targets: [
10-
"MAVSDK-Swift",
14+
"Mavsdk",
1115
]
1216
),
1317
.library(name: "MavsdkServer",
@@ -19,9 +23,10 @@ let package = Package(
1923
dependencies: [
2024
.package(url: "https://github.com/grpc/grpc-swift", from: "1.0.0"),
2125
.package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0"),
26+
.package(url: "https://github.com/mavlink/MAVSDK-XCFramework", .exact("0.37.0"))
2227
],
2328
targets: [
24-
.target(name: "MAVSDK-Swift",
29+
.target(name: "Mavsdk",
2530
dependencies: [
2631
.product(name: "GRPC", package: "grpc-swift"),
2732
.product(name: "RxSwift", package: "RxSwift")
@@ -34,17 +39,14 @@ let package = Package(
3439
),
3540
.target(name: "MavsdkServer",
3641
dependencies: [
37-
.product(name: "RxSwift", package: "RxSwift"),
38-
"mavsdk_server"
42+
.product(name: "mavsdk_server",
43+
package: "MAVSDK-XCFramework",
44+
condition: .when(platforms: [.iOS, .macOS]))
3945
]
4046
),
41-
.binaryTarget(name: "mavsdk_server",
42-
url: "https://github.com/mavlink/MAVSDK/releases/download/v0.37.0/mavsdk_server.xcframework.zip",
43-
checksum: "7c7c45c4f4ae59a93d6cb5d29d2ccede2424108dc549ce94f7ccd834466de51a"),
44-
.testTarget(name: "MAVSDK-SwiftTests",
47+
.testTarget(name: "MavsdkTests",
4548
dependencies: [
46-
"MAVSDK-Swift",
47-
"MavsdkServer",
49+
"Mavsdk",
4850
.product(name: "RxTest", package: "RxSwift"),
4951
.product(name: "RxBlocking", package: "RxSwift")
5052
]

README.md

Lines changed: 18 additions & 15 deletions
File renamed without changes.

Sources/MAVSDK-Swift/tools/generate_docs.sh renamed to Sources/Mavsdk/tools/generate_docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jazzy \
1717
--module-version master \
1818
--root-url https://mavsdk.mavlink.io/docs/swift \
1919
--output docs/swift_output \
20-
--module MAVSDK_Swift
20+
--module Mavsdk

Sources/MavsdkServer/MavsdkServer.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#if !os(Linux)
22
import Foundation
3-
import RxSwift
4-
import mavsdk_server
3+
@_implementationOnly import mavsdk_server
54

65
public class MavsdkServer {
76
private var mavsdkServerHandle: OpaquePointer? = Optional.none
@@ -12,7 +11,7 @@ public class MavsdkServer {
1211
Run `mavsdk_server`, connecting to the drone.
1312

1413
- Parameter systemAddress: The address on which `mavsdk_server` will listen for a MAVLink system. Note that this is about the MAVLink connection between `mavsdk_server` and the drone.
15-
- Parameter mavsdkServerPort: The port on which `mavsdk_server` will listen for a `Drone` object to connect. Note that this is about the connection between MAVSDK-Swift and `mavsdk_server`, and has nothing to do with MAVLink itself.
14+
- Parameter mavsdkServerPort: The port on which `mavsdk_server` will listen for a `Drone` object to connect. Note that this is about the connection between `Mavsdk` and `mavsdk_server`, and has nothing to do with MAVLink itself.
1615
*/
1716
public func run(systemAddress: String = "udp://:14540", mavsdkServerPort: Int = 0) -> Int {
1817
self.mavsdkServerHandle = mavsdk_server_run(systemAddress, Int32(mavsdkServerPort))

Tests/MAVSDK-SwiftTests/ActionTest.swift

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)