Bundle API in app rather than library (#782)

Add script to speed up API update.
This commit is contained in:
Davide 2024-10-30 11:46:24 +01:00 committed by GitHub
parent 705130514c
commit aadc46e98f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 83 additions and 5 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@ default.profraw
.build .build
.bundle .bundle
.env.secret* .env.secret*
tmp

View File

@ -41,7 +41,7 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "git@github.com:passepartoutvpn/passepartoutkit-source", "location" : "git@github.com:passepartoutvpn/passepartoutkit-source",
"state" : { "state" : {
"revision" : "61c0a13efecbd46993a8c8dfed17c599f66c7986" "revision" : "7426954e8ec84e6ddf6c8cd415bfa2c5c7064534"
} }
}, },
{ {

View File

@ -36,7 +36,7 @@ let package = Package(
], ],
dependencies: [ dependencies: [
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "0.9.0"), // .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "0.9.0"),
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "61c0a13efecbd46993a8c8dfed17c599f66c7986"), .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "7426954e8ec84e6ddf6c8cd415bfa2c5c7064534"),
// .package(path: "../../../passepartoutkit-source"), // .package(path: "../../../passepartoutkit-source"),
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", from: "0.9.1"), .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", from: "0.9.1"),
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", revision: "031863a1cd683962a7dfe68e20b91fa820a1ecce"), // .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", revision: "031863a1cd683962a7dfe68e20b91fa820a1ecce"),
@ -109,12 +109,12 @@ let package = Package(
.target( .target(
name: "CommonLibrary", name: "CommonLibrary",
dependencies: [ dependencies: [
.product(name: "PassepartoutAPIBundle", package: "passepartoutkit-source"),
.product(name: "PassepartoutKit", package: "passepartoutkit-source"), .product(name: "PassepartoutKit", package: "passepartoutkit-source"),
.product(name: "PassepartoutOpenVPNOpenSSL", package: "passepartoutkit-source-openvpn-openssl"), .product(name: "PassepartoutOpenVPNOpenSSL", package: "passepartoutkit-source-openvpn-openssl"),
.product(name: "PassepartoutWireGuardGo", package: "passepartoutkit-source-wireguard-go") .product(name: "PassepartoutWireGuardGo", package: "passepartoutkit-source-wireguard-go")
], ],
resources: [ resources: [
.copy("API"),
.process("Resources") .process("Resources")
] ]
), ),

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,51 @@
{
"metadata": [{
"name": "hideme",
"fullName": "Hide.me",
"vpn": ["ovpn"]
}, {
"name": "ivpn",
"fullName": "IVPN",
"vpn": ["ovpn"]
}, {
"name": "mullvad",
"fullName": "Mullvad",
"vpn": ["ovpn"]
}, {
"name": "nordvpn",
"fullName": "NordVPN",
"vpn": ["ovpn"]
}, {
"name": "oeck",
"fullName": "Oeck",
"vpn": ["ovpn"]
}, {
"name": "pia",
"fullName": "PIA",
"vpn": ["ovpn"]
}, {
"name": "protonvpn",
"fullName": "ProtonVPN",
"vpn": ["ovpn"]
}, {
"name": "surfshark",
"fullName": "SurfShark",
"vpn": ["ovpn"]
}, {
"name": "torguard",
"fullName": "TorGuard",
"vpn": ["ovpn"]
}, {
"name": "tunnelbear",
"fullName": "TunnelBear",
"vpn": ["ovpn"]
}, {
"name": "vyprvpn",
"fullName": "VyprVPN",
"vpn": ["ovpn"]
}, {
"name": "windscribe",
"fullName": "Windscribe",
"vpn": ["ovpn"]
}]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -24,7 +24,6 @@
// //
import Foundation import Foundation
import PassepartoutAPIBundle
import PassepartoutKit import PassepartoutKit
import PassepartoutWireGuardGo import PassepartoutWireGuardGo
@ -73,7 +72,7 @@ extension API {
] ]
public static let bundled: APIMapper = { public static let bundled: APIMapper = {
guard let url = API.bundledURL else { guard let url = Bundle.module.url(forResource: "API", withExtension: nil) else {
fatalError("Unable to find bundled API") fatalError("Unable to find bundled API")
} }
let ws = API.V5.DefaultWebServices( let ws = API.V5.DefaultWebServices(

15
ci/update-bundled-api.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
DESTINATION="Passepartout/Library/Sources/CommonLibrary/Resources/API"
API_VERSION="v5"
mkdir tmp
cd tmp
if [[ ! `git clone https://github.com/passepartoutvpn/api --depth 1` ]]; then
cd api
git pull
fi
cd ../..
rm -rf $DESTINATION
mkdir -p $DESTINATION
cp -rp tmp/api/$API_VERSION $DESTINATION