Skip to content

Commit

Permalink
use tsdk 0.21.5
Browse files Browse the repository at this point in the history
  • Loading branch information
scareything committed Sep 8, 2023
1 parent f68c041 commit 4ab8223
Show file tree
Hide file tree
Showing 13 changed files with 159 additions and 93 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ jobs:

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.2.1'
xcode-version: '14.2.0'

- uses: lukka/run-vcpkg@v10
with:
vcpkgGitCommitId: '19af97cba8ca48474e4ad15a24ed50271a9ecdac'

- name: ${{ matrix.spec.name }}
env:
TOOLCHAIN: ${{ matrix.spec.toolchain && format('../../toolchains/{0}.cmake', matrix.spec.toolchain) || '' }}
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DMBEDTLS_FATAL_WARNINGS:BOOL=OFF -DEXCLUDE_PROGRAMS=ON -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN}" -S ./deps/ziti-tunnel-sdk-c -B ./deps/ziti-tunnel-sdk-c/${{ matrix.spec.name }}
cmake -DCMAKE_BUILD_TYPE=Release -DTLSUV_TLSLIB=mbedtls -DMBEDTLS_FATAL_WARNINGS:BOOL=OFF -DEXCLUDE_PROGRAMS=ON -DZITI_TUNNEL_BUILD_TESTS=OFF -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN}" -S ./deps/ziti-tunnel-sdk-c -B ./deps/ziti-tunnel-sdk-c/${{ matrix.spec.name }}
cmake --build ./deps/ziti-tunnel-sdk-c/${{ matrix.spec.name }}
tar -cvzf ${{ matrix.spec.name }}.tgz -C ./deps/ziti-tunnel-sdk-c ${{ matrix.spec.name }}
Expand All @@ -56,7 +60,7 @@ jobs:

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.2.1'
xcode-version: '14.2.0'

- name: Download Artifacts
uses: actions/download-artifact@v3
Expand Down
58 changes: 38 additions & 20 deletions CZiti.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
5AE14C8C2471DDA000179365 /* libCZiti.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5AB6DF68244B7C3C00F4B4E0 /* libCZiti.a */; };
5AF0C4112489987500CD4DAE /* ZitiClaims.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AF0C4102489987500CD4DAE /* ZitiClaims.swift */; };
5AF0C4122489987500CD4DAE /* ZitiClaims.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AF0C4102489987500CD4DAE /* ZitiClaims.swift */; };
AA039EE02A963C53004D3F78 /* libllhttp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA039EDF2A963C53004D3F78 /* libllhttp.a */; };
AA039EE22A963C9C004D3F78 /* libllhttp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA039EE12A963C9C004D3F78 /* libllhttp.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -209,13 +211,10 @@
5AAAEDE32464D8AB00C56383 /* ziti-mac-enroller */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "ziti-mac-enroller"; sourceTree = BUILT_PRODUCTS_DIR; };
5AAAEDE52464D8AB00C56383 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
5AB6DF68244B7C3C00F4B4E0 /* libCZiti.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCZiti.a; sourceTree = BUILT_PRODUCTS_DIR; };
5AB6DF77244B8F2000F4B4E0 /* libuv_mbed.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuv_mbed.a; path = "deps/ziti-sdk-c/build-os-arch/deps/uv-mbed/libuv_mbed.a"; sourceTree = "<group>"; };
5AB6DF78244B8F2000F4B4E0 /* libmbedx509.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmbedx509.a; path = "deps/ziti-sdk-c/build-os-arch/deps/uv-mbed/deps/mbedtls/library/libmbedx509.a"; sourceTree = "<group>"; };
5AB6DF79244B8F2000F4B4E0 /* libmbedcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmbedcrypto.a; path = "deps/ziti-sdk-c/build-os-arch/deps/uv-mbed/deps/mbedtls/crypto/library/libmbedcrypto.a"; sourceTree = "<group>"; };
5AB6DF7A244B8F2000F4B4E0 /* libuv_link.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuv_link.a; path = "deps/ziti-sdk-c/build-os-arch/deps/uv-mbed/deps/libuv_link.a"; sourceTree = "<group>"; };
5AB6DF7B244B8F2000F4B4E0 /* libmbedtls.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmbedtls.a; path = "deps/ziti-sdk-c/build-os-arch/deps/uv-mbed/deps/mbedtls/library/libmbedtls.a"; sourceTree = "<group>"; };
5AB6DF7C244B8F2000F4B4E0 /* libuv_a.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuv_a.a; path = "deps/ziti-sdk-c/build-os-arch/deps/uv-mbed/deps/libuv/libuv_a.a"; sourceTree = "<group>"; };
5AB6DF7D244B8F2000F4B4E0 /* libhttp-parser.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libhttp-parser.a"; path = "deps/ziti-sdk-c/build-os-arch/deps/uv-mbed/deps/libhttp-parser.a"; sourceTree = "<group>"; };
5AB6DFAF244B990A00F4B4E0 /* libCZiti.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCZiti.a; sourceTree = BUILT_PRODUCTS_DIR; };
5AB8308E247432C40089AF93 /* Ziti-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Ziti-Bridging-Header.h"; sourceTree = "<group>"; };
5AB8308F247432C40089AF93 /* ZitiError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZitiError.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -250,6 +249,8 @@
5AF0C4102489987500CD4DAE /* ZitiClaims.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZitiClaims.swift; sourceTree = "<group>"; };
5AFE864127E3C56000D47A47 /* libresolv.9.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.9.tbd; path = usr/lib/libresolv.9.tbd; sourceTree = SDKROOT; };
5AFE864327E3C62800D47A47 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; };
AA039EDF2A963C53004D3F78 /* libllhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libllhttp.a; path = "deps/ziti-tunnel-sdk-c/build-macosx-arm64/vcpkg_installed/arm64-osx/debug/lib/libllhttp.a"; sourceTree = "<group>"; };
AA039EE12A963C9C004D3F78 /* libllhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libllhttp.a; path = "deps/ziti-tunnel-sdk-c/build-iphoneos-arm64/vcpkg_installed/arm64-ios/debug/lib/libllhttp.a"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -281,6 +282,7 @@
5A0E4A8E24534DDE00C56DCF /* libsodium.a in Frameworks */,
5A0E4A8B24530E1E00C56DCF /* libziti.a in Frameworks */,
5A1D8AD629940BE500101BD7 /* libtlsuv.a in Frameworks */,
AA039EE02A963C53004D3F78 /* libllhttp.a in Frameworks */,
5AB6DF7F244B8F2000F4B4E0 /* libmbedx509.a in Frameworks */,
5AB6DF80244B8F2000F4B4E0 /* libmbedcrypto.a in Frameworks */,
5AB6DF82244B8F2000F4B4E0 /* libmbedtls.a in Frameworks */,
Expand All @@ -296,6 +298,7 @@
5AA2989825857789001F7502 /* libziti-tunnel-cbs-c.a in Frameworks */,
5AA2989925857789001F7502 /* liblwipcore.a in Frameworks */,
5A1D8AD729940C3A00101BD7 /* libtlsuv.a in Frameworks */,
AA039EE22A963C9C004D3F78 /* libllhttp.a in Frameworks */,
5AB6DFBC244BA64B00F4B4E0 /* libuv_a.a in Frameworks */,
5AB6DFB9244BA63F00F4B4E0 /* libmbedcrypto.a in Frameworks */,
5AB6DFBB244BA64700F4B4E0 /* libmbedx509.a in Frameworks */,
Expand Down Expand Up @@ -399,6 +402,8 @@
5AB6DF76244B8F2000F4B4E0 /* Frameworks */ = {
isa = PBXGroup;
children = (
AA039EDF2A963C53004D3F78 /* libllhttp.a */,
AA039EE12A963C9C004D3F78 /* libllhttp.a */,
5A1D8AD529940BE500101BD7 /* libtlsuv.a */,
5ADAE979280F7EFD007D1DF4 /* libresolv.9.tbd */,
5AFE864327E3C62800D47A47 /* libresolv.tbd */,
Expand All @@ -413,13 +418,10 @@
5AA2989325857788001F7502 /* libziti-tunnel-sdk-c.a */,
5A0E4A8D24534DDE00C56DCF /* libsodium.a */,
5A0E4A8A24530E1E00C56DCF /* libziti.a */,
5AB6DF7D244B8F2000F4B4E0 /* libhttp-parser.a */,
5AB6DF79244B8F2000F4B4E0 /* libmbedcrypto.a */,
5AB6DF7B244B8F2000F4B4E0 /* libmbedtls.a */,
5AB6DF78244B8F2000F4B4E0 /* libmbedx509.a */,
5AB6DF7C244B8F2000F4B4E0 /* libuv_a.a */,
5AB6DF7A244B8F2000F4B4E0 /* libuv_link.a */,
5AB6DF77244B8F2000F4B4E0 /* libuv_mbed.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -1030,10 +1032,9 @@
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/tlsuv-src/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/http_parser-src",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/tlsuv-src/deps/uv_link_t/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/libuv-src/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/ziti-sdk-c-src/includes",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/vcpkg_installed/$(VCPKG_ARCH)-$(VCPKG_OS)/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/lib/ziti-tunnel/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/lib/ziti-tunnel-cbs/include",
Expand All @@ -1043,17 +1044,26 @@
);
LIBRARY_SEARCH_PATHS = (
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/tlsuv-build",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/mbedtls-build/library",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/uv-mbed-build",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/libuv-build",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/libsodium-build/lib",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/ziti-sdk-c-build/library",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/lib/ziti-tunnel",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/lib/ziti-tunnel-cbs",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/vcpkg_installed/$(VCPKG_ARCH)-$(VCPKG_OS)/lib",
);
ONLY_ACTIVE_ARCH = YES;
OTHER_SWIFT_FLAGS = "";
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/lib/ProjectModule";
SWIFT_INCLUDE_PATHS = (
"$(SRCROOT)/lib/ProjectModule",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/tlsuv-src/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/tlsuv-src/deps/uv_link_t/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/ziti-sdk-c-src/includes",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/vcpkg_installed/$(VCPKG_ARCH)-$(VCPKG_OS)/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/lib/ziti-tunnel/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/lib/ziti-tunnel-cbs/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/lib/ziti-tunnel/lwip",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/lwip-src/src/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/lwip-contrib-src/ports/unix/port/include",
);
SWIFT_OBJC_BRIDGING_HEADER = "";
};
name = Debug;
Expand Down Expand Up @@ -1091,10 +1101,9 @@
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/tlsuv-src/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/http_parser-src",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/tlsuv-src/deps/uv_link_t/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/libuv-src/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/ziti-sdk-c-src/includes",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/vcpkg_installed/$(VCPKG_ARCH)-$(VCPKG_OS)/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/lib/ziti-tunnel/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/lib/ziti-tunnel-cbs/include",
Expand All @@ -1104,17 +1113,26 @@
);
LIBRARY_SEARCH_PATHS = (
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/tlsuv-build",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/mbedtls-build/library",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/uv-mbed-build",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/libuv-build",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/libsodium-build/lib",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/ziti-sdk-c-build/library",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/lib/ziti-tunnel",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/lib/ziti-tunnel-cbs",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/vcpkg_installed/$(VCPKG_ARCH)-$(VCPKG_OS)/lib",
);
OTHER_SWIFT_FLAGS = "";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/lib/ProjectModule";
SWIFT_INCLUDE_PATHS = (
"$(SRCROOT)/lib/ProjectModule",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/tlsuv-src/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/tlsuv-src/deps/uv_link_t/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/ziti-sdk-c-src/includes",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/vcpkg_installed/$(VCPKG_ARCH)-$(VCPKG_OS)/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/lib/ziti-tunnel/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/lib/ziti-tunnel-cbs/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/lib/ziti-tunnel/lwip",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/lwip-src/src/include",
"$(PROJECT_DIR)/deps/ziti-tunnel-sdk-c/build-$(PLATFORM_NAME)-$(CURRENT_ARCH)/_deps/lwip-contrib-src/ports/unix/port/include",
);
SWIFT_OBJC_BRIDGING_HEADER = "";
};
name = Release;
Expand Down
5 changes: 5 additions & 0 deletions Configs/workspace-settings.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@

DEVELOPMENT_TEAM = XXXXXXXXXX
ORGANIZATION_PREFIX = org.openziti
VCPKG_ARCH[arch=arm64] = arm64
VCPKG_ARCH[arch=x86_64] = x64
VCPKG_OS[sdk=iphoneos*] = ios
VCPKG_OS[sdk=iphonesimulator*] = iphonesimulator
VCPKG_OS[sdk=macosx*] = osx

#include? "workspace-settings-overrides.xcconfig"
57 changes: 55 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![Ziggy using the ziti-sdk-swift](https://raw.githubusercontent.com/openziti/branding/main/images/banners/Swift.jpg)

# Ziti SDK for Swift
![Build Status](https://github.com/openziti/ziti-sdk-swift/workflows/CI/badge.svg?branch=master)

Expand Down Expand Up @@ -153,6 +155,57 @@ Note that `CZiti` depends on `libresolv.9.tbd`, and requires access to outbound
## Via `Swift Package Manager`
See [ziti-sdk-swift-dist](https://github.com/openziti/ziti-sdk-swift-dist) for access to `CZiti.xcframework` built from this repository and made available as a `.binaryTarget`.

## Using a locally built CZiti

To exercise modifications to the CZiti framework in your application, first add the CZiti module as a dependency to your app as described above, then override the CZiti framework with a local package. See [Editing a package dependency as a local package](https://developer.apple.com/documentation/xcode/editing-a-package-dependency-as-a-local-package) for an overview of this process.

I used the following steps to override CZiti with a local build in the ziti-tunnel-apple project:

1. Build the CZiti framework. You may want to build for debugging:

$ CONFIGURATION=Debug ./build_all.sh

When complete, the build will be located in ./dist/CZiti.xcframework.

2. Create a Package.swift for the local CZiti framework:

```bash
cat > ./dist/Package.swift <<EOF
// swift-tools-version: 5.7
import PackageDescription
let package = Package(
name: "CZiti",
platforms: [ .macOS(.v10_14), .iOS(.v13) ],
products: [ .library( name: "CZiti", targets: ["CZiti"]) ],
targets: [
.binaryTarget(
name: "CZiti",
path: "./CZiti.xcframework")
]
)
EOF
```
3. Move or copy the ./dist directory into your application's top-level source directory, renaming it to
'ziti-sdk-swift-dist'. The final directory structure should look like this:
- YourApplication/
- ziti-sdk-swift-dist/
- Package.swift
- CZiti.xcframework/
The apple documentation doesn't mention this, but I was unable to get Xcode to recognize that the local
package overrides the released CZiti framework unless the parent directory of the local CZiti framework
was named 'ziti-sdk-swift-dist' (to match the github repo the CZiti releases come from), and local CZiti
framework was in the application's directory.
4. Add the local package to your application. This can be done by clicking "Add Local..." while adding a
package dependency to your application. Select the 'ziti-sdk-swift-dist` directory in the dialog.
You should see the CZiti entry disappear from your project's Package Dependencies in the project navigator
when the local CZiti package is referenced.
## Via `CocoaPods`
**DEPECATED AS OF v0.30.11, please convert to use of Swift Package Manager**
Expand Down Expand Up @@ -201,10 +254,10 @@ ORGANIZATION_PREFIX = ...
## Execute Build Script
The project depends on the __Ziti Tunnel C SDK__, which is built directly into the library. It is maintained as a submodule at `./deps/ziti-tunnel-sdk-c`. This project expects builds to be built in `./deps/ziti-tunnel-sdk-c/build-macosx-x86_64` and `./deps/ziti-tunnel-sdk-c/build-macosx-arm64` for macOS and `./deps/ziti-sdk-c/build-iphoneos-arm64` for iOS (or `build-iphonesimulator-x86_64`or `build-iphonesimulator-arm64` for the simulator).
The project depends on the __Ziti Tunnel C SDK__, which is built directly into the library. It is maintained as a submodule at `./deps/ziti-tunnel-sdk-c`. Be sure to follow the vcpkg setup steps in deps/ziti-tunnel-sdk-c/BUILD.md. This project expects builds to be built in `./deps/ziti-tunnel-sdk-c/build-macosx-x86_64` and `./deps/ziti-tunnel-sdk-c/build-macosx-arm64` for macOS and `./deps/ziti-sdk-c/build-iphoneos-arm64` for iOS (or `build-iphonesimulator-x86_64`or `build-iphonesimulator-arm64` for the simulator).
This project conains the [`buid_all.sh`](build_all.sh) script that will build the project from the command-line for `macosx`, `iphoneos`, and `iphonesimulator` platforms. Note that when building for macOS the instructions below assume you are running on an x86_64 machine when building for x86_64.
This project contains the [`buid_all.sh`](build_all.sh) script that will build the project from the command-line for `macosx`, `iphoneos`, and `iphonesimulator` platforms.
Once the static libraries are built, the `build_all.sh` script executes [`make_dist.sh`](make_dist.sh), creating an XCFramework called `CZiti.xcframework`, under the project's `./dist` directory.
Expand Down
6 changes: 6 additions & 0 deletions build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ function build_tsdk {
rm -rf ./deps/ziti-tunnel-sdk-c/${name}

cmake -DCMAKE_BUILD_TYPE=${CONFIGURATION} \
-DTLSUV_TLSLIB=mbedtls \
-DMBEDTLS_FATAL_WARNINGS:BOOL=OFF -DEXCLUDE_PROGRAMS=ON \
-DZITI_TUNNEL_BUILD_TESTS=OFF \
-DCMAKE_TOOLCHAIN_FILE="${toolchain}" \
-S ./deps/ziti-tunnel-sdk-c -B ./deps/ziti-tunnel-sdk-c/${name}

Expand All @@ -38,6 +40,10 @@ function build_tsdk {
fi
}

if ! command -v xcpretty > /dev/null; then
xcpretty() { echo "install xcpretty for more legible xcodebuild output"; cat; }
fi

function build_cziti {
scheme=$1
sdk=$2
Expand Down
Loading

0 comments on commit 4ab8223

Please sign in to comment.