Refactor library targets (#799)

Renames:

- AppUI → UILibrary
- AppUIPlatform → AppUI (conditional umbrella) + AppUI[Main|TV]
- APILibrary/CommonLibrary/UtilsLibrary → Common[API|Library|Utils]

Dependencies:

- AppUI → UILibrary
- UILibrary → AppLibrary, CommonAPI
- AppLibrary → CommonLibrary, CommonUtils
This commit is contained in:
Davide 2024-11-02 10:11:59 +01:00 committed by GitHub
parent 72e784272a
commit 070b661c43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
160 changed files with 203 additions and 167 deletions

View File

@ -1,6 +1,6 @@
source "https://rubygems.org"
gem "fastlane", :github => "keeshux/fastlane", :ref => "2f464bc16fbebf4dbac52ed7362993434af3f022"
gem "fastlane", :github => "keeshux/fastlane", :ref => "91a3bc8cbf26dd761920939fd7579ee4362ce9b3"
gem "dotenv"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')

View File

@ -1,9 +1,9 @@
GIT
remote: https://github.com/keeshux/fastlane.git
revision: 2f464bc16fbebf4dbac52ed7362993434af3f022
ref: 2f464bc16fbebf4dbac52ed7362993434af3f022
revision: 91a3bc8cbf26dd761920939fd7579ee4362ce9b3
ref: 91a3bc8cbf26dd761920939fd7579ee4362ce9b3
specs:
fastlane (2.223.1)
fastlane (2.225.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
@ -19,6 +19,7 @@ GIT
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
fastlane-sirp (>= 1.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-apis-androidpublisher_v3 (~> 0.3)
google-apis-playcustomapp_v1 (~> 0.1)
@ -57,20 +58,20 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.981.0)
aws-sdk-core (3.209.1)
aws-partitions (1.1001.0)
aws-sdk-core (3.211.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.94.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-kms (1.95.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.166.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-s3 (1.169.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.0)
aws-sigv4 (1.10.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
@ -87,7 +88,7 @@ GEM
domain_name (0.6.20240107)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.111.0)
excon (0.112.0)
faraday (1.10.4)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
@ -121,6 +122,8 @@ GEM
loco_strings (~> 0.1.4.1)
ruby-openai (~> 3.7)
fastlane-plugin-versioning (0.6.0)
fastlane-sirp (1.0.0)
sysrandom (~> 1.0)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.54.0)
google-apis-core (>= 0.11.0, < 2.a)
@ -167,8 +170,8 @@ GEM
multi_xml (>= 0.5.2)
httpclient (2.8.3)
jmespath (1.6.2)
json (2.7.2)
jwt (2.9.1)
json (2.7.5)
jwt (2.9.3)
base64
loco_strings (0.1.4.1)
nokogiri (~> 1.13, >= 1.13.8)
@ -179,7 +182,7 @@ GEM
multi_xml (0.7.1)
bigdecimal (~> 3.1)
multipart-post (2.4.1)
nanaimo (0.3.0)
nanaimo (0.4.0)
naturally (2.2.1)
nkf (0.2.0)
nokogiri (1.16.7)
@ -198,7 +201,7 @@ GEM
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.3.8)
rexml (3.3.9)
rouge (2.0.7)
ruby-openai (3.7.0)
httparty (>= 0.18.1)
@ -213,6 +216,7 @@ GEM
simctl (1.6.10)
CFPropertyList
naturally
sysrandom (1.0.5)
terminal-notifier (2.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
@ -224,13 +228,13 @@ GEM
uber (0.1.0)
unicode-display_width (2.6.0)
word_wrap (1.0.0)
xcodeproj (1.25.0)
xcodeproj (1.27.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (>= 3.3.2, < 4.0)
nanaimo (~> 0.4.0)
rexml (>= 3.3.6, < 4.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)

View File

@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
0E182C6C2CD61CD800051DB2 /* AppUI in Frameworks */ = {isa = PBXBuildFile; productRef = 0E182C6B2CD61CD800051DB2 /* AppUI */; };
0E757F132CD0CFFC006E13E1 /* PassepartoutLoginItemApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E757F122CD0CFFC006E13E1 /* PassepartoutLoginItemApp.swift */; };
0E757F202CD0D22B006E13E1 /* PassepartoutLoginItem.app in Embed Login Item */ = {isa = PBXBuildFile; fileRef = 0E757F102CD0CFFC006E13E1 /* PassepartoutLoginItem.app */; platformFilters = (macos, ); settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
0E757F232CD0D2BD006E13E1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E757F212CD0D2B7006E13E1 /* AppDelegate.swift */; };
@ -19,7 +20,6 @@
0EC066D12C7DC47600D88A94 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0EC066D02C7DC47600D88A94 /* LaunchScreen.storyboard */; platformFilter = ios; };
0EC332CA2B8A1808000B9C2F /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EC332C92B8A1808000B9C2F /* NetworkExtension.framework */; };
0EC332D22B8A1808000B9C2F /* PassepartoutTunnel.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 0EC332C82B8A1808000B9C2F /* PassepartoutTunnel.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
0EC4A7132CD597EF00B7CAAD /* AppUIPlatform in Frameworks */ = {isa = PBXBuildFile; productRef = 0EC4A7122CD597EF00B7CAAD /* AppUIPlatform */; };
0EC797422B9378E000C093B7 /* Shared+App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EC797402B9378E000C093B7 /* Shared+App.swift */; };
0EC797432B9378E000C093B7 /* Shared.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EC797412B9378E000C093B7 /* Shared.swift */; };
0EC797442B93790600C093B7 /* Shared.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EC797412B9378E000C093B7 /* Shared.swift */; };
@ -144,7 +144,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0EC4A7132CD597EF00B7CAAD /* AppUIPlatform in Frameworks */,
0E182C6C2CD61CD800051DB2 /* AppUI in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -290,7 +290,7 @@
);
name = Passepartout;
packageProductDependencies = (
0EC4A7122CD597EF00B7CAAD /* AppUIPlatform */,
0E182C6B2CD61CD800051DB2 /* AppUI */,
);
productName = PassepartoutKit;
productReference = 0E06D18F2B87629100176E1D /* Passepartout.app */;
@ -983,6 +983,10 @@
/* End XCConfigurationList section */
/* Begin XCSwiftPackageProductDependency section */
0E182C6B2CD61CD800051DB2 /* AppUI */ = {
isa = XCSwiftPackageProductDependency;
productName = AppUI;
};
0E6C0A022BF4047100450362 /* AppLibrary */ = {
isa = XCSwiftPackageProductDependency;
productName = AppLibrary;
@ -995,10 +999,6 @@
isa = XCSwiftPackageProductDependency;
productName = TunnelLibrary;
};
0EC4A7122CD597EF00B7CAAD /* AppUIPlatform */ = {
isa = XCSwiftPackageProductDependency;
productName = AppUIPlatform;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 0E06D1872B87629100176E1D /* Project object */;

View File

@ -41,7 +41,7 @@
"kind" : "remoteSourceControl",
"location" : "git@github.com:passepartoutvpn/passepartoutkit-source",
"state" : {
"revision" : "e95c7b54dc11e744d9b40a722fccf752436ac0ef"
"revision" : "b32b63ab8e09883f965737bb6214dfb81e38283a"
}
},
{

View File

@ -23,18 +23,18 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import AppUI
import CommonLibrary
import PassepartoutKit
import SwiftUI
import UILibrary
@MainActor
final class AppDelegate: NSObject {
let context: AppContext = .shared
// let context: AppContext = .mock(withRegistry: .shared)
func configure(with appUIConfiguring: AppUIConfiguring) {
AppUI(appUIConfiguring)
func configure(with uiConfiguring: UILibraryConfiguring) {
UILibrary(uiConfiguring)
.configure(with: context)
}
}

View File

@ -25,10 +25,6 @@ let package = Package(
name: "AppUIMain",
targets: ["AppUIMain"]
),
.library(
name: "AppUIPlatform",
targets: ["AppUIPlatform"]
),
.library(
name: "AppUITV",
targets: ["AppUITV"]
@ -36,11 +32,15 @@ let package = Package(
.library(
name: "TunnelLibrary",
targets: ["CommonLibrary"]
),
.library(
name: "UILibrary",
targets: ["UILibrary"]
)
],
dependencies: [
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "0.9.0"),
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "e95c7b54dc11e744d9b40a722fccf752436ac0ef"),
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "b32b63ab8e09883f965737bb6214dfb81e38283a"),
// .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", revision: "031863a1cd683962a7dfe68e20b91fa820a1ecce"),
@ -53,13 +53,6 @@ let package = Package(
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "APILibrary",
dependencies: ["CommonLibrary"],
resources: [
.copy("API")
]
),
.target(
name: "AppData",
dependencies: []
@ -87,42 +80,38 @@ let package = Package(
.target(
name: "AppLibrary",
dependencies: [
"APILibrary",
"Kvitto",
"UtilsLibrary"
"CommonLibrary",
"CommonUtils",
"Kvitto"
]
),
.target(
name: "AppUI",
dependencies: [
"AppDataProfiles",
"AppDataProviders",
"AppLibrary"
],
resources: [
.process("Resources")
]
),
.target(
name: "AppUIMain",
dependencies: [
"AppUI",
"LegacyV2"
],
resources: [
.process("Resources")
]
),
.target(
name: "AppUIPlatform",
dependencies: [
.target(name: "AppUIMain", condition: .when(platforms: [.iOS, .macOS])),
.target(name: "AppUITV", condition: .when(platforms: [.tvOS]))
]
),
.target(
name: "AppUIMain",
dependencies: [
"LegacyV2",
"UILibrary"
],
resources: [
.process("Resources")
]
),
.target(
name: "AppUITV",
dependencies: ["AppUI"]
dependencies: ["UILibrary"]
),
.target(
name: "CommonAPI",
dependencies: ["CommonLibrary"],
resources: [
.copy("API")
]
),
.target(
name: "CommonLibrary",
@ -135,10 +124,13 @@ let package = Package(
.process("Resources")
]
),
.target(
name: "CommonUtils"
),
.target(
name: "LegacyV2",
dependencies: [
"UtilsLibrary",
"CommonUtils",
.product(name: "PassepartoutKit", package: "passepartoutkit-source")
],
resources: [
@ -146,7 +138,16 @@ let package = Package(
]
),
.target(
name: "UtilsLibrary"
name: "UILibrary",
dependencies: [
"AppDataProfiles",
"AppDataProviders",
"AppLibrary",
"CommonAPI"
],
resources: [
.process("Resources")
]
),
.testTarget(
name: "AppLibraryTests",
@ -157,8 +158,8 @@ let package = Package(
dependencies: ["AppUIMain"]
),
.testTarget(
name: "AppUITests",
dependencies: ["AppUI"]
name: "UILibraryTests",
dependencies: ["UILibrary"]
)
]
)

View File

@ -26,10 +26,10 @@
import AppData
import AppLibrary
import Combine
import CommonUtils
import CoreData
import Foundation
import PassepartoutKit
import UtilsLibrary
extension AppData {
public static func cdProfileRepositoryV3(

View File

@ -25,10 +25,10 @@
import AppData
import Combine
import CommonUtils
import CoreData
import Foundation
import PassepartoutKit
import UtilsLibrary
extension AppData {
public static func cdProviderRepositoryV3(

View File

@ -24,10 +24,10 @@
//
import AppData
import CommonUtils
import CoreData
import Foundation
import PassepartoutKit
import UtilsLibrary
final class CDVPNProviderServerRepositoryV3: VPNProviderServerRepository {
private let context: NSManagedObjectContext

View File

@ -24,9 +24,9 @@
//
import CommonLibrary
import CommonUtils
import Foundation
import PassepartoutKit
import UtilsLibrary
public struct AppProduct: RawRepresentable, Hashable, Sendable {
public let rawValue: String

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import Foundation
import UtilsLibrary
public protocol AppProductHelper: InAppHelper where ProductIdentifier == AppProduct {
}

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import Foundation
import UtilsLibrary
public protocol AppReceiptReader: InAppReceiptReader where UserLevel == AppUserLevel {
}

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import Foundation
import PassepartoutKit
import UtilsLibrary
// FIXME: #424, reload receipt + objectWillChange on purchase/transactions

View File

@ -23,10 +23,10 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import Foundation
import Kvitto
import PassepartoutKit
import UtilsLibrary
public final class KvittoReceiptReader: AppReceiptReader {
public init() {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import Foundation
import UtilsLibrary
public actor MockAppProductHelper: AppProductHelper {
public private(set) var products: [AppProduct: InAppProduct]

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import Foundation
import UtilsLibrary
public actor MockAppReceiptReader: AppReceiptReader {
private var receipt: InAppReceipt?

View File

@ -23,10 +23,10 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
@_exported import AppUI
import Foundation
@_exported import UILibrary
public final class AppUIMain: AppUIConfiguring {
public final class AppUIMain: UILibraryConfiguring {
public init() {
}

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import Foundation
import PassepartoutKit
import UtilsLibrary
@MainActor
final class ProfileImporter: ObservableObject {

View File

@ -25,9 +25,9 @@
import AppLibrary
import CommonLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct AboutView: View {
let profileManager: ProfileManager

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import SwiftUI
import UtilsLibrary
struct CreditsView: View {
var body: some View {

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct AppToolbar: ToolbarContent, SizeClassProviding {

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct InstalledProfileView: View, Routable {

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ProfileContainerView: View, Routable {
let layout: ProfilesLayout

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ProfileContextMenu: View, Routable {
let profileManager: ProfileManager

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ProfileDuplicateButton<Label>: View where Label: View {
let profileManager: ProfileManager

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ProfileGridView: View, Routable, TunnelInstallationProviding {

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ProfileImporterModifier: ViewModifier {
let profileManager: ProfileManager

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ProfileListView: View, Routable, TunnelInstallationProviding {

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ProfileRowView: View, Routable {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import SwiftUI
import UtilsLibrary
struct ProfilesLayoutPicker: View {

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct TunnelRestartButton<Label>: View where Label: View {

View File

@ -25,9 +25,9 @@
import AppLibrary
import CommonLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
extension DebugLogView {
static func withApp(parameters: Constants.Log) -> DebugLogView {
@ -93,7 +93,7 @@ private extension DebugLogView {
var copyButton: some View {
Button {
copyToPasteboard(content)
Utils.copyToPasteboard(content)
} label: {
ThemeImage(.copy)
}

View File

@ -26,10 +26,10 @@
#if os(iOS)
import CommonLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UIKit
import UtilsLibrary
extension ReportIssueButton: View {
var body: some View {

View File

@ -24,9 +24,9 @@
//
import Combine
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct DNSView: View, ModuleDraftEditing {

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct HTTPProxyView: View, ModuleDraftEditing {

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct IPView: View, ModuleDraftEditing {

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct OnDemandView: View, ModuleDraftEditing {

View File

@ -24,10 +24,10 @@
//
import AppLibrary
import CommonUtils
import CPassepartoutOpenVPNOpenSSL
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct OpenVPNView: View, ModuleDraftEditing {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import SwiftUI
import UtilsLibrary
enum ModuleRow: Hashable {
enum CopyOnTap: Int, Hashable, Comparable {

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ProfileCoordinator: View {
struct Flow {

View File

@ -26,9 +26,9 @@
#if os(iOS)
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ProfileEditView: View, Routable {

View File

@ -25,9 +25,9 @@
#if os(macOS)
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ModuleListView: View, Routable {
static let generalModuleId = UUID()

View File

@ -25,9 +25,9 @@
#if os(macOS)
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ProfileSplitView: View, Routable {
let profileEditor: ProfileEditor

View File

@ -24,6 +24,7 @@
//
import AppLibrary
import CommonAPI
import PassepartoutKit
import SwiftUI

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonAPI
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct VPNProviderContentModifier<Configuration, ProviderRows>: ViewModifier where Configuration: ProviderConfigurationIdentifiable & Codable, ProviderRows: View {

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct VPNProviderServerCoordinator<Configuration>: View where Configuration: ProviderConfigurationIdentifiable & Codable {

View File

@ -24,11 +24,11 @@
//
import AppLibrary
import Combine
import CommonAPI
import CommonLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct VPNProviderServerView<Configuration>: View where Configuration: ProviderConfigurationIdentifiable & Codable {
var apis: [APIMapper] = API.shared

View File

@ -26,6 +26,7 @@
#if os(iOS)
import AppLibrary
import CommonAPI
import CommonLibrary
import PassepartoutKit
import SwiftUI

View File

@ -25,6 +25,7 @@
#if os(macOS)
import CommonAPI
import CommonLibrary
import PassepartoutKit
import SwiftUI

View File

@ -25,9 +25,9 @@
import AppLibrary
import CommonLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct SettingsSectionGroup: View {

View File

@ -23,10 +23,10 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
@_exported import AppUI
import Foundation
@_exported import UILibrary
public final class AppUITV: AppUIConfiguring {
public final class AppUITV: UILibraryConfiguring {
public init() {
}

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ActiveProfileView: View {
let profile: Profile?

View File

@ -24,9 +24,9 @@
//
import AppLibrary
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
struct ProfileListView: View {

View File

@ -24,10 +24,10 @@
//
import AppLibrary
import AppUI
import CommonUtils
import PassepartoutKit
import SwiftUI
import UtilsLibrary
import UILibrary
// FIXME: #788, UI for TV

View File

@ -0,0 +1,41 @@
//
// Utils+Pasteboard.swift
// Passepartout
//
// Created by Davide De Rosa on 11/2/24.
// Copyright (c) 2024 Davide De Rosa. All rights reserved.
//
// https://github.com/passepartoutvpn
//
// This file is part of Passepartout.
//
// Passepartout is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Passepartout is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
extension Utils {
public static func copyToPasteboard(_ string: String) {
#if os(iOS)
let pb: UIPasteboard = .general
pb.string = string
#elseif os(macOS)
let pb: NSPasteboard = .general
pb.clearContents()
pb.setString(string, forType: .string)
#else
fatalError("Copy unavailable")
#endif
}
}

View File

@ -38,7 +38,7 @@ public struct LongContentView: View {
contentView
.toolbar {
Button {
copyToPasteboard(content)
Utils.copyToPasteboard(content)
} label: {
Image(systemName: copySystemImage ?? "doc.on.doc")
}

Some files were not shown because too many files have changed in this diff Show More