diff --git a/.github/workflows/swiftformat.yml b/.github/workflows/swiftformat.yml new file mode 100644 index 000000000..96d58e371 --- /dev/null +++ b/.github/workflows/swiftformat.yml @@ -0,0 +1,25 @@ +name: SwiftFormat + +on: + pull_request: + branches: [ master ] + +jobs: + build: + name: SwiftFormat + runs-on: [ self-hosted, iOS ] + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + - uses: jdx/mise-action@v2 + with: + cache: false + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: SwiftFormat + run: swiftformat --lint . --reporter github-actions-log diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml new file mode 100644 index 000000000..181799ac3 --- /dev/null +++ b/.github/workflows/swiftlint.yml @@ -0,0 +1,25 @@ +name: SwiftLint + +on: + pull_request: + branches: [ master ] + +jobs: + build: + name: SwiftLint + runs-on: [ self-hosted, iOS ] + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + - uses: jdx/mise-action@v2 + with: + cache: false + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: SwiftLint + run: swiftlint --config .swiftlint.yml --config .swiftlint-ci.yml --reporter github-actions-logging . diff --git a/.mise.toml b/.mise.toml index 07d8ac224..1b1ca60cd 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,6 @@ [tools] -tuist = '4.12.0' -periphery = '2.21.0' -swiftformat = '0.54.0' -swiftlint = '0.55.0' +tuist = '4.12.1' +periphery = '2.21.1' +swiftformat = '0.54.5' +swiftlint = '0.57.0' + diff --git a/.swiftformat b/.swiftformat index 415b736a9..1503d2db3 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,4 +1,3 @@ ---strongOutlets --acronyms ID,URL,UUID --allman false --assetliterals visual-width @@ -80,6 +79,7 @@ --wraptypealiases preserve --xcodeindentation disabled --yodaswap always ---disable andOperator,opaqueGenericParameters,preferKeyPath,redundantReturn,strongOutlets,trailingCommas,unusedArguments,wrapMultilineStatementBraces +--disable andOperator,opaqueGenericParameters,preferKeyPath,redundantReturn,strongOutlets,trailingCommas,unusedArguments,wrapMultilineStatementBraces,conditionalAssignment --enable blankLineAfterImports,blankLinesBetweenImports --exclude DerivedData,Derived,Tuist,Project.swift,Build,.build + diff --git a/.swiftlint-ci.yml b/.swiftlint-ci.yml new file mode 100644 index 000000000..8ebaefcac --- /dev/null +++ b/.swiftlint-ci.yml @@ -0,0 +1,3 @@ +disabled_rules: + - todo +strict: true diff --git a/.swiftlint.yml b/.swiftlint.yml index 70df0a068..d80e38023 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -8,7 +8,9 @@ disabled_rules: - force_cast - cyclomatic_complexity - closure_parameter_position - - non_optional_string_data_conversion + - inclusive_language + - for_where + - optional_data_string_conversion opt_in_rules: - strong_iboutlet - closure_end_indentation diff --git a/Project.swift b/Project.swift index 76020a8e9..84deb07a4 100644 --- a/Project.swift +++ b/Project.swift @@ -136,7 +136,9 @@ let project = Project(name: "kDrive", .external(name: "MQTTNIO"), .external(name: "InfomaniakCore"), .external(name: "InfomaniakCoreDB"), - .external(name: "InfomaniakCoreUI"), + .external(name: "InfomaniakCoreCommonUI"), + .external(name: "InfomaniakCoreSwiftUI"), + .external(name: "InfomaniakCoreUIKit"), .external(name: "InfomaniakLogin"), .external(name: "InfomaniakDI"), .external(name: "InfomaniakConcurrency"), diff --git a/Tuist/Package.resolved b/Tuist/Package.resolved index 313621894..66cc88ae7 100644 --- a/Tuist/Package.resolved +++ b/Tuist/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Alamofire/Alamofire", "state" : { - "revision" : "f455c2975872ccd2d9c81594c658af65716e9b9a", - "version" : "5.9.1" + "revision" : "e16d3481f5ed35f0472cb93350085853d754913f", + "version" : "5.10.1" } }, { @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ProxymanApp/atlantis", "state" : { - "revision" : "523dd773538e1e20036cb2d28f8b9947448c2d20", - "version" : "1.25.1" + "revision" : "b60fb9920e50f8f8a7e909394b09989c9d55d7ef", + "version" : "1.25.2" } }, { @@ -86,8 +86,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-core", "state" : { - "revision" : "6c175294c2ff03c43eb7c9bd32ebd3a8c6448b0d", - "version" : "11.0.0" + "revision" : "82fa2c1f0fc4b6d0f520697bb073a7acddd52833", + "version" : "12.5.0" } }, { @@ -95,8 +95,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-core-ui", "state" : { - "revision" : "f45301c68bd9421a8f29f676bab658933e8a6807", - "version" : "10.1.0" + "revision" : "e0afbab522df72496b92042ee65c20f8d593a3f7", + "version" : "13.4.0" } }, { @@ -113,8 +113,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-login", "state" : { - "revision" : "7214a97f73b9b19858d3b3139a2fe47be86e142e", - "version" : "6.0.2" + "revision" : "b12bf4fbbfe0edf10d2516503e97a9f212d1cd5b", + "version" : "7.0.1" } }, { @@ -122,8 +122,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-version-checker", "state" : { - "revision" : "c8fd02352bfc6bede63e41bdb21f2472f7bc1612", - "version" : "6.0.0" + "revision" : "5b68ced5b52f9c95b6cb6d671273c608ed38d2fc", + "version" : "7.0.2" } }, { @@ -212,8 +212,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/realm/realm-core.git", "state" : { - "revision" : "e474a8d2270a8b12ac63ac9504e4757e39814b99", - "version" : "14.13.0" + "revision" : "85eeca41654cc9070ad81a21a4b1d153ad467c33", + "version" : "14.13.1" } }, { @@ -221,8 +221,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/realm/realm-swift", "state" : { - "revision" : "863498d37a9f0e72caa65963da9641d8cdfc8228", - "version" : "10.54.0" + "revision" : "5553cfd1c789efdb3d6daf7f0cc0733cfe601846", + "version" : "10.54.1" } }, { @@ -230,8 +230,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/getsentry/sentry-cocoa", "state" : { - "revision" : "5575af93efb776414f243e93d6af9f6258dc539a", - "version" : "8.36.0" + "revision" : "c64d4a85fd8a48a49b89788684826820a68d0863", + "version" : "8.40.0" } }, { @@ -302,8 +302,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "665206000b8307cab5ac51203d29b0f232d7e31b", - "version" : "2.74.0" + "revision" : "914081701062b11e3bb9e21accc379822621995e", + "version" : "2.76.1" } }, { @@ -311,8 +311,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-transport-services.git", "state" : { - "revision" : "38ac8221dd20674682148d6451367f89c2652980", - "version" : "1.21.0" + "revision" : "bbd5e63cf949b7db0c9edaf7a21e141c52afe214", + "version" : "1.23.0" } }, { @@ -329,8 +329,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "d2ba781702a1d8285419c15ee62fd734a9437ff5", - "version" : "1.3.2" + "revision" : "c8a44d836fe7913603e246acab7c528c2e780168", + "version" : "1.4.0" + } + }, + { + "identity" : "swiftbackports", + "kind" : "remoteSourceControl", + "location" : "https://github.com/shaps80/SwiftBackports", + "state" : { + "revision" : "ddca6a237c1ba2291d5a3cc47ec8480ce6e9f805", + "version" : "1.0.3" } }, { @@ -341,6 +350,24 @@ "revision" : "d8c4846dfbbe04aa8196ae5a5a3cdc6cd7f9f6bc", "version" : "1.0.0" } + }, + { + "identity" : "swiftui-introspect", + "kind" : "remoteSourceControl", + "location" : "https://github.com/siteline/SwiftUI-Introspect", + "state" : { + "revision" : "807f73ce09a9b9723f12385e592b4e0aaebd3336", + "version" : "1.3.0" + } + }, + { + "identity" : "swiftuibackports", + "kind" : "remoteSourceControl", + "location" : "https://github.com/shaps80/SwiftUIBackports", + "state" : { + "revision" : "556d42f391b74059a354b81b8c8e19cc7cb576f4", + "version" : "1.15.1" + } } ], "version" : 2 diff --git a/Tuist/Package.swift b/Tuist/Package.swift index 4d42924c1..d3877874a 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -19,12 +19,12 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-algorithms", .upToNextMajor(from: "1.2.0")), .package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.2.2")), - .package(url: "https://github.com/Infomaniak/ios-core", .upToNextMajor(from: "11.0.0")), - .package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "10.0.0")), - .package(url: "https://github.com/Infomaniak/ios-login", .upToNextMajor(from: "6.0.1")), + .package(url: "https://github.com/Infomaniak/ios-core", .upToNextMajor(from: "12.2.0")), + .package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "13.1.0")), + .package(url: "https://github.com/Infomaniak/ios-login", .upToNextMajor(from: "7.0.1")), .package(url: "https://github.com/Infomaniak/ios-dependency-injection", .upToNextMajor(from: "2.0.0")), .package(url: "https://github.com/Infomaniak/swift-concurrency", .upToNextMajor(from: "0.0.4")), - .package(url: "https://github.com/Infomaniak/ios-version-checker", .upToNextMajor(from: "6.0.0")), + .package(url: "https://github.com/Infomaniak/ios-version-checker", .upToNextMajor(from: "7.0.0")), .package(url: "https://github.com/Infomaniak/LocalizeKit", .upToNextMajor(from: "1.0.2")), .package(url: "https://github.com/realm/realm-swift", .upToNextMajor(from: "10.52.0")), .package(url: "https://github.com/SCENEE/FloatingPanel", .upToNextMajor(from: "2.0.0")), diff --git a/Tuist/ProjectDescriptionHelpers/Constants.swift b/Tuist/ProjectDescriptionHelpers/Constants.swift index 35ef35bb7..5098b96c5 100644 --- a/Tuist/ProjectDescriptionHelpers/Constants.swift +++ b/Tuist/ProjectDescriptionHelpers/Constants.swift @@ -26,7 +26,7 @@ public enum Constants { public static let baseSettings = SettingsDictionary() .automaticCodeSigning(devTeam: "864VDCS2QY") .currentProjectVersion("1") - .marketingVersion("5.0.1") + .marketingVersion("5.0.2") public static let deploymentTarget = DeploymentTargets.iOS("13.4") public static let destinations = Set([.iPhone, .iPad]) diff --git a/kDrive/AppDelegate.swift b/kDrive/AppDelegate.swift index b61288e25..98cc22a97 100644 --- a/kDrive/AppDelegate.swift +++ b/kDrive/AppDelegate.swift @@ -21,7 +21,7 @@ import AVFoundation import BackgroundTasks import CocoaLumberjackSwift import InfomaniakCore -import InfomaniakCoreUI +import InfomaniakCoreUIKit import InfomaniakDI import InfomaniakLogin import kDriveCore diff --git a/kDrive/AppRouter.swift b/kDrive/AppRouter.swift index 3b2f05caf..0cbbae7ae 100644 --- a/kDrive/AppRouter.swift +++ b/kDrive/AppRouter.swift @@ -17,7 +17,7 @@ */ import InfomaniakCore -import InfomaniakCoreUI +import InfomaniakCoreUIKit import InfomaniakDI import kDriveCore import kDriveResources @@ -41,7 +41,7 @@ public struct AppRouter: AppNavigable { @MainActor private var window: UIWindow? { let scene = UIApplication.shared.connectedScenes.first { scene in guard let delegate = scene.delegate, - delegate as? SceneDelegate != nil else { + delegate is SceneDelegate else { return false } @@ -81,13 +81,13 @@ public struct AppRouter: AppNavigable { } switch route { - case .saveFile(let file): + case .saveFiles(let files): guard let driveFileManager = accountManager.currentDriveFileManager else { Log.sceneDelegate("NavigationManager: Unable to navigate to .saveFile without a DriveFileManager", level: .error) return } - showSaveFileVC(from: viewController, driveFileManager: driveFileManager, file: file) + showSaveFileVC(from: viewController, driveFileManager: driveFileManager, files: files) case .store(let driveId, let userId): guard let driveFileManager = accountManager.getDriveFileManager(for: driveId, userId: userId) else { @@ -280,11 +280,12 @@ public struct AppRouter: AppNavigable { private func restorePreviewViewController(driveFileManager: DriveFileManager, navigationController: UINavigationController, sceneUserInfo: [AnyHashable: Any]) async { - guard sceneUserInfo[SceneRestorationValues.driveId.rawValue] as? Int != nil, + guard sceneUserInfo[SceneRestorationValues.driveId.rawValue] is Int, let fileIds = sceneUserInfo[SceneRestorationValues.Carousel.filesIds.rawValue] as? [Int], let currentIndex = sceneUserInfo[SceneRestorationValues.Carousel.currentIndex.rawValue] as? Int, let normalFolderHierarchy = sceneUserInfo[SceneRestorationValues.Carousel.normalFolderHierarchy.rawValue] as? Bool, - let presentationOrigin = sceneUserInfo[SceneRestorationValues.Carousel.presentationOrigin.rawValue] as? PresentationOrigin else { + let rawPresentationOrigin = sceneUserInfo[SceneRestorationValues.Carousel.presentationOrigin.rawValue] as? String, + let presentationOrigin = PresentationOrigin(rawValue: rawPresentationOrigin) else { Log.sceneDelegate("metadata issue for PreviewController :\(sceneUserInfo)", level: .error) return } @@ -438,8 +439,8 @@ public struct AppRouter: AppNavigable { navController.pushViewController(photoSyncSettingsViewController, animated: true) } - public func showSaveFileVC(from viewController: UIViewController, driveFileManager: DriveFileManager, file: ImportedFile) { - let vc = SaveFileViewController.instantiateInNavigationController(driveFileManager: driveFileManager, file: file) + public func showSaveFileVC(from viewController: UIViewController, driveFileManager: DriveFileManager, files: [ImportedFile]) { + let vc = SaveFileViewController.instantiateInNavigationController(driveFileManager: driveFileManager, files: files) viewController.present(vc, animated: true) } diff --git a/kDrive/Resources/de.lproj/Localizable.strings b/kDrive/Resources/de.lproj/Localizable.strings index 48b533666..ab76ffb78 100644 --- a/kDrive/Resources/de.lproj/Localizable.strings +++ b/kDrive/Resources/de.lproj/Localizable.strings @@ -1,10 +1,10 @@ /* - * Loco ios export: iOS Localizable.strings + * Loco ios export: Xcode Strings (legacy) * Project: kDrive * Locale: de, German * Tagged: ios - * Exported by: Baptiste Griva - * Exported at: Thu, 26 Sep 2024 10:46:53 +0200 + * Exported by: Matthieu Déglon + * Exported at: Thu, 03 Oct 2024 08:22:20 +0200 */ /* loco:610a8791fa12ab20713c09e4 */ @@ -2071,6 +2071,12 @@ /* loco:62344c023cb45e6fcb219b43 */ "trashedFileRestoreFileToOriginalPlaceSuccess-plural" = "%d Elemente am ursprünglichen Ort wiederhergestellt"; +/* loco:66fe3560501931dbfb04f0c8 */ +"unknownArtist" = "Unbekannter Künstler"; + +/* loco:66fe3634a0cfdc15cf0c1a94 */ +"unknownTitle" = "Unbekannter Titel"; + /* loco:6049df4d5c2c3a04bc397a7d */ "updateAvailableDescription" = "Mit Blick auf ein optimales kDrive-Benutzererlebnis empfehlen wir Ihnen, Ihre Anwendung zu aktualisieren."; diff --git a/kDrive/Resources/en.lproj/Localizable.strings b/kDrive/Resources/en.lproj/Localizable.strings index 077472f3d..792b04078 100644 --- a/kDrive/Resources/en.lproj/Localizable.strings +++ b/kDrive/Resources/en.lproj/Localizable.strings @@ -335,7 +335,7 @@ "buttonLater" = "Later"; /* loco:605b09e6a6279864ac4ba6f2 */ -"buttonLeaveShare" = "Stop sharing"; +"buttonLeaveShare" = "Leave share"; /* loco:6059f35332f59035fd6e2b62 */ "buttonLike" = "Like"; @@ -2071,6 +2071,12 @@ /* loco:62344c023cb45e6fcb219b43 */ "trashedFileRestoreFileToOriginalPlaceSuccess-plural" = "%d items recovered to their original location"; +/* loco:66fe3560501931dbfb04f0c8 */ +"unknownArtist" = "Unknown Artist"; + +/* loco:66fe3634a0cfdc15cf0c1a94 */ +"unknownTitle" = "Unknown Title"; + /* loco:6049df4d5c2c3a04bc397a7d */ "updateAvailableDescription" = "To get the best out of kDrive, we recommend you update your application."; diff --git a/kDrive/Resources/es.lproj/Localizable.strings b/kDrive/Resources/es.lproj/Localizable.strings index 07b474c7b..62fd6e3dc 100644 --- a/kDrive/Resources/es.lproj/Localizable.strings +++ b/kDrive/Resources/es.lproj/Localizable.strings @@ -1,10 +1,10 @@ /* - * Loco ios export: iOS Localizable.strings + * Loco ios export: Xcode Strings (legacy) * Project: kDrive * Locale: es, Spanish * Tagged: ios - * Exported by: Baptiste Griva - * Exported at: Thu, 26 Sep 2024 10:46:53 +0200 + * Exported by: Matthieu Déglon + * Exported at: Thu, 03 Oct 2024 08:22:20 +0200 */ /* loco:610a8791fa12ab20713c09e4 */ @@ -2071,6 +2071,12 @@ /* loco:62344c023cb45e6fcb219b43 */ "trashedFileRestoreFileToOriginalPlaceSuccess-plural" = "%d elementos restaurados en el emplazamiento original"; +/* loco:66fe3560501931dbfb04f0c8 */ +"unknownArtist" = "Artista desconocido"; + +/* loco:66fe3634a0cfdc15cf0c1a94 */ +"unknownTitle" = "Título desconocido"; + /* loco:6049df4d5c2c3a04bc397a7d */ "updateAvailableDescription" = "Para disfrutar de una experiencia óptima de kDrive, te aconsejamos que actualices tu aplicación."; diff --git a/kDrive/Resources/fr.lproj/Localizable.strings b/kDrive/Resources/fr.lproj/Localizable.strings index a6af975fa..aa9d63a19 100644 --- a/kDrive/Resources/fr.lproj/Localizable.strings +++ b/kDrive/Resources/fr.lproj/Localizable.strings @@ -1,10 +1,10 @@ /* - * Loco ios export: iOS Localizable.strings + * Loco ios export: Xcode Strings (legacy) * Project: kDrive * Locale: fr, French * Tagged: ios - * Exported by: Baptiste Griva - * Exported at: Thu, 26 Sep 2024 10:46:53 +0200 + * Exported by: Matthieu Déglon + * Exported at: Thu, 03 Oct 2024 08:22:20 +0200 */ /* loco:610a8791fa12ab20713c09e4 */ @@ -2071,6 +2071,12 @@ /* loco:62344c023cb45e6fcb219b43 */ "trashedFileRestoreFileToOriginalPlaceSuccess-plural" = "%d éléments restaurés à leur emplacement d’origine"; +/* loco:66fe3560501931dbfb04f0c8 */ +"unknownArtist" = "Artiste inconnu"; + +/* loco:66fe3634a0cfdc15cf0c1a94 */ +"unknownTitle" = "Titre inconnu"; + /* loco:6049df4d5c2c3a04bc397a7d */ "updateAvailableDescription" = "Afin de profiter d’une expérience optimale de kDrive, nous vous conseillons de mettre à jour votre application."; diff --git a/kDrive/Resources/it.lproj/Localizable.strings b/kDrive/Resources/it.lproj/Localizable.strings index ee9655303..59cf14ba1 100644 --- a/kDrive/Resources/it.lproj/Localizable.strings +++ b/kDrive/Resources/it.lproj/Localizable.strings @@ -1,10 +1,10 @@ /* - * Loco ios export: iOS Localizable.strings + * Loco ios export: Xcode Strings (legacy) * Project: kDrive * Locale: it, Italian * Tagged: ios - * Exported by: Baptiste Griva - * Exported at: Thu, 26 Sep 2024 10:46:53 +0200 + * Exported by: Matthieu Déglon + * Exported at: Thu, 03 Oct 2024 08:22:20 +0200 */ /* loco:610a8791fa12ab20713c09e4 */ @@ -2071,6 +2071,12 @@ /* loco:62344c023cb45e6fcb219b43 */ "trashedFileRestoreFileToOriginalPlaceSuccess-plural" = "%d elementi ipristinati nell’ubicazione di origine"; +/* loco:66fe3560501931dbfb04f0c8 */ +"unknownArtist" = "Artista sconosciuto"; + +/* loco:66fe3634a0cfdc15cf0c1a94 */ +"unknownTitle" = "Titolo sconosciuto"; + /* loco:6049df4d5c2c3a04bc397a7d */ "updateAvailableDescription" = "Per vivere la migliore esperienza con kDrive, ti consigliamo di aggiornare la tua applicazione."; diff --git a/kDrive/SceneDelegate.swift b/kDrive/SceneDelegate.swift index 6f23a8f33..b084c851e 100644 --- a/kDrive/SceneDelegate.swift +++ b/kDrive/SceneDelegate.swift @@ -17,7 +17,7 @@ */ import InfomaniakCore -import InfomaniakCoreUI +import InfomaniakCoreCommonUI import InfomaniakDI import kDriveCore import kDriveResources @@ -218,7 +218,7 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate, AccountManagerDel Task { let success = await DeeplinkParser().parse(url: url) - Log.sceneDelegate("scene open url\(url) success:\(success)") + Log.sceneDelegate("scene open url: \(url) success: \(success)") } } diff --git a/kDrive/UI/Controller/Base.lproj/Main.storyboard b/kDrive/UI/Controller/Base.lproj/Main.storyboard index ecfcd3e51..3dabcd4a8 100644 --- a/kDrive/UI/Controller/Base.lproj/Main.storyboard +++ b/kDrive/UI/Controller/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -290,7 +290,7 @@ -