diff --git a/Apps/BLEKitExample/Project.swift b/Apps/BLEKitExample/Project.swift index 4a8e7bb9c8..07b005436b 100644 --- a/Apps/BLEKitExample/Project.swift +++ b/Apps/BLEKitExample/Project.swift @@ -2,21 +2,15 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers -let project = Project.iOSApp( +let project = Project.app( name: "BLEKitExample", dependencies: [ .project(target: "DesignKit", path: Path("../../Modules/DesignKit")), .project(target: "BLEKit", path: Path("../../Modules/BLEKit")), - ], - infoPlist: [ - "NSBluetoothAlwaysUsageDescription": - "The LekaBLE app needs to use Bluetooth to connect to the Leka robot.", - "UIBackgroundModes": [ - "bluetooth-central", - ], ] ) diff --git a/Apps/LekaActivityUIExplorer/Project.swift b/Apps/LekaActivityUIExplorer/Project.swift index 3debff5d3b..bb0e990298 100644 --- a/Apps/LekaActivityUIExplorer/Project.swift +++ b/Apps/LekaActivityUIExplorer/Project.swift @@ -2,13 +2,14 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers -let project = Project.iOSApp( +let project = Project.app( name: "LekaActivityUIExplorer", - deploymentTarget: .iOS(targetVersion: "17.0", devices: .ipad), + deploymentTargets: .iOS("17.0"), dependencies: [ .project(target: "DesignKit", path: Path("../../Modules/DesignKit")), .project(target: "GameEngineKit", path: Path("../../Modules/GameEngineKit")), @@ -17,34 +18,5 @@ let project = Project.iOSApp( .external(name: "Yams"), .external(name: "Lottie"), .external(name: "SwiftUIJoystick"), - ], - infoPlist: [ - "CFBundleShortVersionString": "1.0.0", - "CFBundleDocumentTypes": [ - [ - "CFBundleTypeName": "Sequencing Card Item", - "LSHandlerRank": "Default", - "CFBundleTypeRole": "Viewer", - "LSItemContentTypes": [ - "io.leka.apf.app.uiexplorer.sequencing.card_item", - ], - ], - ], - "NSBluetoothAlwaysUsageDescription": - "The Leka App needs to use Bluetooth to connect to the Leka robot.", - "UIBackgroundModes": [ - "bluetooth-central", - "audio", - ], - "UIRequiresFullScreen": "true", - "UISupportedInterfaceOrientations": [ - "UIInterfaceOrientationLandscapeRight", - "UIInterfaceOrientationLandscapeLeft", - ], - "UISupportedInterfaceOrientations~ipad": [ - "UIInterfaceOrientationLandscapeRight", - "UIInterfaceOrientationLandscapeLeft", - ], - "NSAccentColorName": "AccentColor", ] ) diff --git a/Apps/LekaApp/Project.swift b/Apps/LekaApp/Project.swift index 53851ebc4a..6463aa2c0d 100644 --- a/Apps/LekaApp/Project.swift +++ b/Apps/LekaApp/Project.swift @@ -2,35 +2,16 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers -let project = Project.iOSApp( +let project = Project.app( name: "LekaApp", version: "1.0.0", - dependencies: [ - .project(target: "DesignKit", path: Path("../../Modules/DesignKit")), - .project(target: "RobotKit", path: Path("../../Modules/RobotKit")), - .external(name: "Yams"), - .external(name: "Lottie"), - ], infoPlist: [ - "NSBluetoothAlwaysUsageDescription": - "The Leka App needs to use Bluetooth to connect to the Leka robot.", - "UIBackgroundModes": [ - "bluetooth-central", - ], - "UIRequiresFullScreen": "true", - "UISupportedInterfaceOrientations": [ - "UIInterfaceOrientationLandscapeRight", - "UIInterfaceOrientationLandscapeLeft", - ], - "UISupportedInterfaceOrientations~ipad": [ - "UIInterfaceOrientationLandscapeRight", - "UIInterfaceOrientationLandscapeLeft", - ], - "NSAccentColorName": "AccentColor", + "LSApplicationCategoryType": "public.app-category.education", "CFBundleURLTypes": [ [ "CFBundleTypeRole": "Editor", @@ -39,5 +20,11 @@ let project = Project.iOSApp( ], ], "LSApplicationQueriesSchemes": ["LekaUpdater"], + ], + dependencies: [ + .project(target: "DesignKit", path: Path("../../Modules/DesignKit")), + .project(target: "RobotKit", path: Path("../../Modules/RobotKit")), + .external(name: "Yams"), + .external(name: "Lottie"), ] ) diff --git a/Apps/LekaUpdater/Project.swift b/Apps/LekaUpdater/Project.swift index 862fc2bc34..3c075ecfbc 100644 --- a/Apps/LekaUpdater/Project.swift +++ b/Apps/LekaUpdater/Project.swift @@ -2,50 +2,16 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -private var schemes: [Scheme] { - var schemeList: [Scheme] = [] - - if Environment.createLocalizationSchemes.getBoolean( - default: false) - { - schemeList.append(contentsOf: [ - SchemeList.l10nFR(name: "LekaUpdater"), - SchemeList.l10nEN(name: "LekaUpdater"), - ]) - } - - return schemeList -} - -// Creates our project using a helper function defined in ProjectDescriptionHelpers -let project = Project.iOSApp( +let project = Project.app( name: "LekaUpdater", version: "1.4.0", - dependencies: [ - .project(target: "DesignKit", path: Path("../../Modules/DesignKit")), - .project(target: "BLEKit", path: Path("../../Modules/BLEKit")), - .project(target: "RobotKit", path: Path("../../Modules/RobotKit")), - .project(target: "LocalizationKit", path: Path("../../Modules/LocalizationKit")), - .external(name: "Version"), - ], infoPlist: [ "LEKA_OS_VERSION": "1.4.0", - "NSBluetoothAlwaysUsageDescription": - "The Leka Updater app needs to use Bluetooth to connect to the Leka robot.", - "UIBackgroundModes": [ - "bluetooth-central", - ], - "UIRequiresFullScreen": "true", - "UISupportedInterfaceOrientations": ["UIInterfaceOrientationPortrait"], - "UISupportedInterfaceOrientations~ipad": [ - "UIInterfaceOrientationPortrait", - "UIInterfaceOrientationPortraitUpsideDown", - ], - "LSApplicationCategoryType": "public.app-category.utilities", - "NSAccentColorName": "AccentColor", "CFBundleURLTypes": [ [ "CFBundleTypeRole": "Editor", @@ -57,5 +23,11 @@ let project = Project.iOSApp( "LekaApp", "com.googleusercontent.apps.224911845933-mv4tp4rstgjtvdqvbv5dl7defii1a7ic", ], ], - schemes: schemes + dependencies: [ + .project(target: "DesignKit", path: Path("../../Modules/DesignKit")), + .project(target: "BLEKit", path: Path("../../Modules/BLEKit")), + .project(target: "RobotKit", path: Path("../../Modules/RobotKit")), + .project(target: "LocalizationKit", path: Path("../../Modules/LocalizationKit")), + .external(name: "Version"), + ] ) diff --git a/Examples/Module/Project.swift b/Examples/Module/Project.swift index 90322f5232..2891f9748e 100644 --- a/Examples/Module/Project.swift +++ b/Examples/Module/Project.swift @@ -2,16 +2,13 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers let project = Project.module( name: "Module", - platform: .iOS, - dependencies: [ - // no deps - ], examples: [ ModuleExample(name: "ModuleExampleAppOne"), ModuleExample( @@ -20,5 +17,8 @@ let project = Project.module( "APP_NAME": "ModuleExampleAppTwo from InfoPlist", ] ), + ], + dependencies: [ + // no deps ] ) diff --git a/Examples/iOSApp/Project.swift b/Examples/iOSApp/Project.swift index 53b64e3bf4..e39936b105 100644 --- a/Examples/iOSApp/Project.swift +++ b/Examples/iOSApp/Project.swift @@ -2,13 +2,13 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers -let project = Project.iOSApp( +let project = Project.app( name: "iOSApp", - version: "1.0.0", dependencies: [ .project(target: "Module", path: Path("../../Examples/Module")), ] diff --git a/Examples/macOSApp/Project.swift b/Examples/macOSApp/Project.swift index 814cf60be4..4ab8c4a9e4 100644 --- a/Examples/macOSApp/Project.swift +++ b/Examples/macOSApp/Project.swift @@ -2,13 +2,14 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers -let project = Project.macOSApp( +let project = Project.app( name: "macOSApp", - version: "1.0.0", + deploymentTargets: .macOS("13.0"), dependencies: [ .project(target: "Module", path: Path("../../Examples/Module")), ] diff --git a/Examples/macOSCli/Project.swift b/Examples/macOSCli/Project.swift index 7e30bfa194..d97a26f731 100644 --- a/Examples/macOSCli/Project.swift +++ b/Examples/macOSCli/Project.swift @@ -2,10 +2,11 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers let project = Project.cli( name: "macOSCli", version: "1.0.0", diff --git a/Modules/AccountKit/Project.swift b/Modules/AccountKit/Project.swift index 5346d60c05..991d58544a 100644 --- a/Modules/AccountKit/Project.swift +++ b/Modules/AccountKit/Project.swift @@ -2,23 +2,20 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers let project = Project.module( name: "AccountKit", - platform: .iOS, - dependencies: [ - .project(target: "DesignKit", path: Path("../../Modules/DesignKit")), - .project(target: "LogKit", path: Path("../../Modules/LogKit")), - ], examples: [ ModuleExample( - name: "AccountKitExample", - infoPlist: [ - "NSAccentColorName": "AccentColor", - ] + name: "AccountKitExample" ), + ], + dependencies: [ + .project(target: "DesignKit", path: Path("../../Modules/DesignKit")), + .project(target: "LogKit", path: Path("../../Modules/LogKit")), ] ) diff --git a/Modules/BLEKit/Project.swift b/Modules/BLEKit/Project.swift index 6b3d4da514..0246760d9b 100644 --- a/Modules/BLEKit/Project.swift +++ b/Modules/BLEKit/Project.swift @@ -2,26 +2,19 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers let project = Project.module( name: "BLEKit", - platform: .iOS, - dependencies: [ - .external(name: "CombineCoreBluetooth"), - ], examples: [ ModuleExample( - name: "BLEKitExample", - infoPlist: [ - "NSBluetoothAlwaysUsageDescription": - "The Leka Updater app needs to use Bluetooth to connect to the Leka robot.", - "UIBackgroundModes": [ - "bluetooth-central", - ], - ] + name: "BLEKitExample" ), + ], + dependencies: [ + .external(name: "CombineCoreBluetooth"), ] ) diff --git a/Modules/ContentKit/Project.swift b/Modules/ContentKit/Project.swift index 0c0fd028a8..b0916637f0 100644 --- a/Modules/ContentKit/Project.swift +++ b/Modules/ContentKit/Project.swift @@ -2,23 +2,20 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers let project = Project.module( name: "ContentKit", - platform: .iOS, - dependencies: [ - .project(target: "LogKit", path: Path("../../Modules/LogKit")), - .external(name: "Yams"), - ], examples: [ ModuleExample( - name: "ContentKitExample", - infoPlist: [ - "NSAccentColorName": "AccentColor", - ] + name: "ContentKitExample" ), + ], + dependencies: [ + .project(target: "LogKit", path: Path("../../Modules/LogKit")), + .external(name: "Yams"), ] ) diff --git a/Modules/DesignKit/Project.swift b/Modules/DesignKit/Project.swift index 64034c8b6c..6067e304b1 100644 --- a/Modules/DesignKit/Project.swift +++ b/Modules/DesignKit/Project.swift @@ -2,13 +2,13 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers let project = Project.module( name: "DesignKit", - platform: .iOS, dependencies: [ .external(name: "Lottie"), ] diff --git a/Modules/GameEngineKit/Project.swift b/Modules/GameEngineKit/Project.swift index dc1d865925..e6d5720a45 100644 --- a/Modules/GameEngineKit/Project.swift +++ b/Modules/GameEngineKit/Project.swift @@ -2,40 +2,23 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers let project = Project.module( name: "GameEngineKit", - platform: .iOS, + examples: [ + ModuleExample( + name: "GameEngineKitExample" + ), + ], dependencies: [ .project(target: "DesignKit", path: Path("../../Modules/DesignKit")), .project(target: "RobotKit", path: Path("../../Modules/RobotKit")), .project(target: "ContentKit", path: Path("../../Modules/ContentKit")), .external(name: "SwiftUIJoystick"), .external(name: "AudioKit"), - ], - examples: [ - ModuleExample( - name: "GameEngineKitExample", - infoPlist: [ - "NSBluetoothAlwaysUsageDescription": - "The Leka Updater app needs to use Bluetooth to connect to the Leka robot.", - "UIBackgroundModes": [ - "bluetooth-central", - ], - "UIRequiresFullScreen": "true", - "UISupportedInterfaceOrientations": [ - "UIInterfaceOrientationLandscapeRight", - "UIInterfaceOrientationLandscapeLeft", - ], - "UISupportedInterfaceOrientations~ipad": [ - "UIInterfaceOrientationLandscapeRight", - "UIInterfaceOrientationLandscapeLeft", - ], - "NSAccentColorName": "AccentColor", - ] - ), ] ) diff --git a/Modules/LocalizationKit/Project.swift b/Modules/LocalizationKit/Project.swift index baaaf6645d..46c07aa6fa 100644 --- a/Modules/LocalizationKit/Project.swift +++ b/Modules/LocalizationKit/Project.swift @@ -2,24 +2,19 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers let project = Project.module( name: "LocalizationKit", - platform: .iOS, - dependencies: [], examples: [ ModuleExample( - name: "LocalizationKitExample", - infoPlist: [ - "NSAccentColorName": "AccentColor", - ] + name: "LocalizationKitExample" ), ], - schemes: [ - SchemeList.l10nFR(name: "LocalizationKitExample"), - SchemeList.l10nEN(name: "LocalizationKitExample"), + dependencies: [ + // no deps ] ) diff --git a/Modules/LogKit/Project.swift b/Modules/LogKit/Project.swift index 6e18c0d9b3..e544a05e25 100644 --- a/Modules/LogKit/Project.swift +++ b/Modules/LogKit/Project.swift @@ -2,22 +2,19 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers let project = Project.module( name: "LogKit", - platform: .iOS, - dependencies: [ - .external(name: "Logging"), - ], examples: [ ModuleExample( - name: "LogKitExample", - infoPlist: [ - "NSAccentColorName": "AccentColor", - ] + name: "LogKitExample" ), + ], + dependencies: [ + .external(name: "Logging"), ] ) diff --git a/Modules/RobotKit/Project.swift b/Modules/RobotKit/Project.swift index 542184b10b..9b15923d1f 100644 --- a/Modules/RobotKit/Project.swift +++ b/Modules/RobotKit/Project.swift @@ -2,39 +2,22 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription import ProjectDescriptionHelpers -// Creates our project using a helper function defined in ProjectDescriptionHelpers let project = Project.module( name: "RobotKit", - platform: .iOS, + examples: [ + ModuleExample( + name: "RobotKitExample" + ), + ], dependencies: [ .project(target: "BLEKit", path: Path("../../Modules/BLEKit")), .project(target: "DesignKit", path: Path("../../Modules/DesignKit")), .project(target: "LogKit", path: Path("../../Modules/LogKit")), .external(name: "Version"), - ], - examples: [ - ModuleExample( - name: "RobotKitExample", - infoPlist: [ - "NSBluetoothAlwaysUsageDescription": - "The Leka Updater app needs to use Bluetooth to connect to the Leka robot.", - "UIBackgroundModes": [ - "bluetooth-central", - ], - "UIRequiresFullScreen": "true", - "UISupportedInterfaceOrientations": [ - "UIInterfaceOrientationLandscapeRight", - "UIInterfaceOrientationLandscapeLeft", - ], - "UISupportedInterfaceOrientations~ipad": [ - "UIInterfaceOrientationLandscapeRight", - "UIInterfaceOrientationLandscapeLeft", - ], - "NSAccentColorName": "AccentColor", - ] - ), ] ) diff --git a/Tuist/Config.swift b/Tuist/Config.swift index 5cdfafe284..faaa629ab3 100644 --- a/Tuist/Config.swift +++ b/Tuist/Config.swift @@ -2,6 +2,8 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription let config = Config( diff --git a/Tuist/Dependencies.swift b/Tuist/Dependencies.swift index b229042419..92eca18d4c 100644 --- a/Tuist/Dependencies.swift +++ b/Tuist/Dependencies.swift @@ -2,46 +2,11 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription let dependencies = Dependencies( - swiftPackageManager: SwiftPackageManagerDependencies([ - .remote( - url: "https://github.com/jpsim/Yams", - requirement: .exact("5.0.6") - ), - .remote( - url: "https://github.com/airbnb/lottie-ios", - requirement: .exact("4.3.4") - ), - .remote( - url: "https://github.com/gonzalezreal/swift-markdown-ui", - requirement: .exact("2.2.0") - ), - .remote( - url: "https://github.com/apple/swift-argument-parser", - requirement: .exact("1.3.0") - ), - .remote( - url: "https://github.com/StarryInternet/CombineCoreBluetooth", - requirement: .exact("0.7.1") - ), - .remote( - url: "https://github.com/michael94ellis/SwiftUIJoystick", - requirement: .exact("1.5.0") - ), - .remote( - url: "https://github.com/AudioKit/AudioKit", - requirement: .exact("5.6.2") - ), - .remote( - url: "https://github.com/apple/swift-log", - requirement: .exact("1.5.3") - ), - .remote( - url: "https://github.com/mxcl/Version", - requirement: .exact("2.0.1") - ), - ]), + swiftPackageManager: .init(), platforms: [.iOS, .macOS] ) diff --git a/Tuist/Package.resolved b/Tuist/Package.resolved new file mode 100644 index 0000000000..4e7e4602c9 --- /dev/null +++ b/Tuist/Package.resolved @@ -0,0 +1,95 @@ +{ + "pins" : [ + { + "identity" : "audiokit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/AudioKit/AudioKit", + "state" : { + "revision" : "82cab9d4c168b5b03b67e2ff099819f589b530f7", + "version" : "5.6.2" + } + }, + { + "identity" : "combinecorebluetooth", + "kind" : "remoteSourceControl", + "location" : "https://github.com/StarryInternet/CombineCoreBluetooth", + "state" : { + "revision" : "986826c4e1a41d585bae62fd828263edd72ccc3f", + "version" : "0.7.1" + } + }, + { + "identity" : "lottie-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/airbnb/lottie-ios", + "state" : { + "revision" : "3f1202f254ad5d71f6c5b518ed2d6b9e2abe6969", + "version" : "4.3.4" + } + }, + { + "identity" : "networkimage", + "kind" : "remoteSourceControl", + "location" : "https://github.com/gonzalezreal/NetworkImage", + "state" : { + "revision" : "7aff8d1b31148d32c5933d75557d42f6323ee3d1", + "version" : "6.0.0" + } + }, + { + "identity" : "swift-argument-parser", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-argument-parser", + "state" : { + "revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41", + "version" : "1.3.0" + } + }, + { + "identity" : "swift-log", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-log", + "state" : { + "revision" : "532d8b529501fb73a2455b179e0bbb6d49b652ed", + "version" : "1.5.3" + } + }, + { + "identity" : "swift-markdown-ui", + "kind" : "remoteSourceControl", + "location" : "https://github.com/gonzalezreal/swift-markdown-ui", + "state" : { + "revision" : "5df8a4adedd6ae4eb2455ef60ff75183984daeb8", + "version" : "2.2.0" + } + }, + { + "identity" : "swiftuijoystick", + "kind" : "remoteSourceControl", + "location" : "https://github.com/michael94ellis/SwiftUIJoystick", + "state" : { + "revision" : "5bd303cdafb369a70a45c902538b42dd3c5f4d65", + "version" : "1.5.0" + } + }, + { + "identity" : "version", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mxcl/Version", + "state" : { + "revision" : "1fe824b80d89201652e7eca7c9252269a1d85e25", + "version" : "2.0.1" + } + }, + { + "identity" : "yams", + "kind" : "remoteSourceControl", + "location" : "https://github.com/jpsim/Yams", + "state" : { + "revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3", + "version" : "5.0.6" + } + } + ], + "version" : 2 +} diff --git a/Tuist/Package.swift b/Tuist/Package.swift new file mode 100644 index 0000000000..739d5868e1 --- /dev/null +++ b/Tuist/Package.swift @@ -0,0 +1,50 @@ +// swift-tools-version: 5.9 +// Leka - iOS Monorepo +// Copyright APF France handicap +// SPDX-License-Identifier: Apache-2.0 + +// swiftformat:disable acronyms + +import PackageDescription + +let package = Package( + name: "GlobalProjectDependencies", + dependencies: [ + .package( + url: "https://github.com/jpsim/Yams", + exact: "5.0.6" + ), + .package( + url: "https://github.com/airbnb/lottie-ios", + exact: "4.3.4" + ), + .package( + url: "https://github.com/gonzalezreal/swift-markdown-ui", + exact: "2.2.0" + ), + .package( + url: "https://github.com/apple/swift-argument-parser", + exact: "1.3.0" + ), + .package( + url: "https://github.com/StarryInternet/CombineCoreBluetooth", + exact: "0.7.1" + ), + .package( + url: "https://github.com/michael94ellis/SwiftUIJoystick", + exact: "1.5.0" + ), + .package( + url: "https://github.com/AudioKit/AudioKit", + exact: "5.6.2" + ), + .package( + url: "https://github.com/apple/swift-log", + exact: "1.5.3" + ), + .package( + url: "https://github.com/mxcl/Version", + exact: "2.0.1" + ), + ] +) diff --git a/Tuist/ProjectDescriptionHelpers/InfoPlist+Base.swift b/Tuist/ProjectDescriptionHelpers/InfoPlist+Base.swift index 5b6796e26b..fff051f182 100644 --- a/Tuist/ProjectDescriptionHelpers/InfoPlist+Base.swift +++ b/Tuist/ProjectDescriptionHelpers/InfoPlist+Base.swift @@ -2,16 +2,42 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription public extension InfoPlist { - static func base(version: String) -> [String: InfoPlist.Value] { + static func base(version: String) -> [String: Plist.Value] { [ "CFBundleShortVersionString": "\(version)", "CFBundleVersion": "\(version)", "UIMainStoryboardFile": "", "UILaunchStoryboardName": "LaunchScreen", "ITSAppUsesNonExemptEncryption": "NO", + "CFBundleLocalizations": [ + "fr", + "en", + ], + "NSBluetoothAlwaysUsageDescription": + "The app needs to use Bluetooth to connect to the Leka robot", + "UIBackgroundModes": [ + "bluetooth-central", + "audio", + ], + "UIRequiresFullScreen": "true", + "UISupportedInterfaceOrientations": [ + "UIInterfaceOrientationLandscapeRight", + "UIInterfaceOrientationLandscapeLeft", + ], + "UISupportedInterfaceOrientations~ipad": [ + "UIInterfaceOrientationLandscapeRight", + "UIInterfaceOrientationLandscapeLeft", + ], + "LSApplicationCategoryType": "public.app-category.utilities", ] } + + static func extendingBase(version: String, with plist: [String: Plist.Value]) -> [String: Plist.Value] { + self.base(version: version).merging(plist) { _, new in new } + } } diff --git a/Tuist/ProjectDescriptionHelpers/Project+Templates+App_iOS.swift b/Tuist/ProjectDescriptionHelpers/Project+App.swift similarity index 54% rename from Tuist/ProjectDescriptionHelpers/Project+Templates+App_iOS.swift rename to Tuist/ProjectDescriptionHelpers/Project+App.swift index 37b566f6e9..1a40c83983 100644 --- a/Tuist/ProjectDescriptionHelpers/Project+Templates+App_iOS.swift +++ b/Tuist/ProjectDescriptionHelpers/Project+App.swift @@ -2,47 +2,42 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription public extension Project { - static func iOSApp( + static func app( name: String, version: String = "1.0.0", - deploymentTarget: DeploymentTarget = .iOS(targetVersion: "16.0", devices: .ipad), - dependencies: [TargetDependency], - infoPlist: [String: InfoPlist.Value] = [:], + deploymentTargets: DeploymentTargets = .iOS("16.0"), + destinations: Destinations = [.iPad, .macWithiPadDesign], + infoPlist: [String: Plist.Value] = [:], + settings: SettingsDictionary = [:], options: Options = .options(), + dependencies: [TargetDependency] = [], schemes: [Scheme] = [] ) -> Project { - let appInfoPlist = InfoPlist.base(version: version).merging(infoPlist) { _, new in new } - let mainTarget = Target( name: name, - platform: .iOS, + destinations: destinations, product: .app, bundleId: "io.leka.apf.app.\(name)", - deploymentTarget: deploymentTarget, - infoPlist: .extendingDefault(with: appInfoPlist), + deploymentTargets: deploymentTargets, + infoPlist: .extendingDefault(with: InfoPlist.extendingBase(version: version, with: infoPlist)), sources: ["Sources/**"], resources: ["Resources/**"], scripts: TargetScript.linters(), dependencies: dependencies, - settings: .settings(base: [ - "LOCALIZED_STRING_MACRO_NAMES": [ - "NSLocalizedString", - "CFCopyLocalizedString", - "LocalizedString", - "LocalizedStringInterpolation", - ], - ]) + settings: .settings(base: .extendingBase(with: settings)) ) let testTarget = Target( name: "\(name)Tests", - platform: .iOS, + destinations: destinations, product: .unitTests, bundleId: "io.leka.apf.app.\(name)Tests", - infoPlist: .default, + infoPlist: .extendingDefault(with: InfoPlist.extendingBase(version: version, with: infoPlist)), sources: ["Tests/**"], resources: [], scripts: TargetScript.linters(), @@ -51,14 +46,15 @@ public extension Project { ] ) - let targets = [mainTarget, testTarget] - return Project( name: name, organizationName: "leka.io", options: options, - targets: targets, - schemes: schemes + targets: [ + mainTarget, + testTarget, + ], + schemes: l10nSchemes(name: name) + schemes ) } } diff --git a/Tuist/ProjectDescriptionHelpers/Project+Templates+Cli.swift b/Tuist/ProjectDescriptionHelpers/Project+Cli.swift similarity index 86% rename from Tuist/ProjectDescriptionHelpers/Project+Templates+Cli.swift rename to Tuist/ProjectDescriptionHelpers/Project+Cli.swift index 11b97b1a63..e130433dfd 100644 --- a/Tuist/ProjectDescriptionHelpers/Project+Templates+Cli.swift +++ b/Tuist/ProjectDescriptionHelpers/Project+Cli.swift @@ -2,6 +2,8 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription public extension Project { @@ -12,10 +14,10 @@ public extension Project { ) -> Project { let mainTarget = Target( name: name, - platform: .macOS, + destinations: .macOS, product: .commandLineTool, bundleId: "io.leka.apf.cli.\(name)", - deploymentTarget: .macOS(targetVersion: "13.0"), + deploymentTargets: .macOS("13.0"), sources: ["Sources/**"], scripts: TargetScript.linters(), dependencies: dependencies diff --git a/Tuist/ProjectDescriptionHelpers/Project+Module.swift b/Tuist/ProjectDescriptionHelpers/Project+Module.swift new file mode 100644 index 0000000000..86b1ecedcd --- /dev/null +++ b/Tuist/ProjectDescriptionHelpers/Project+Module.swift @@ -0,0 +1,117 @@ +// Leka - iOS Monorepo +// Copyright APF France handicap +// SPDX-License-Identifier: Apache-2.0 + +// swiftformat:disable acronyms + +import ProjectDescription + +// MARK: - ModuleExample + +public struct ModuleExample { + // MARK: Lifecycle + + public init(name: String, infoPlist: [String: Plist.Value] = [:]) { + self.name = name + self.infoPlist = infoPlist + } + + // MARK: Public + + public let name: String + public let infoPlist: [String: Plist.Value] +} + +public extension Project { + static func module( + name: String, + deploymentTargets: DeploymentTargets = .iOS("16.0"), + destinations: Destinations = [.iPad, .macWithiPadDesign], + infoPlist: [String: Plist.Value] = [:], + settings: SettingsDictionary = [:], + options: Options = .options(), + examples: [ModuleExample] = [], + dependencies: [TargetDependency] = [], + schemes: [Scheme] = [] + ) -> Project { + let frameworkTargets = makeFrameworkTargets( + name: name, + deploymentTargets: deploymentTargets, + destinations: destinations, + infoPlist: infoPlist, + settings: settings, + dependencies: dependencies + ) + + let exampleTargets = examples.compactMap { example in + Target( + name: example.name, + destinations: destinations, + product: .app, + bundleId: "io.leka.apf.app.example.\(example.name)", + deploymentTargets: deploymentTargets, + infoPlist: .extendingDefault(with: InfoPlist.extendingBase(version: "1.0.0", with: infoPlist)), + sources: ["Examples/\(example.name)/Sources/**"], + resources: ["Examples/\(example.name)/Resources/**"], + scripts: TargetScript.linters(), + dependencies: [.target(name: name)], + settings: .settings(base: .extendingBase(with: settings)) + ) + } + + return Project( + name: name, + organizationName: "leka.io", + options: options, + targets: frameworkTargets + exampleTargets, + schemes: schemes + ) + } +} + +private func makeFrameworkTargets( + name: String, + deploymentTargets: DeploymentTargets = .iOS("16.0"), + destinations: Destinations = [.iPad, .macWithiPadDesign], + infoPlist: [String: Plist.Value] = [:], + settings: SettingsDictionary = [:], + dependencies: [TargetDependency] = [] +) + -> [Target] +{ + var product: Product = .staticLibrary + + if Environment.generateModulesAsFrameworksForDebug.getBoolean(default: false) { + product = .framework + } + + let module = Target( + name: name, + destinations: destinations, + product: product, + bundleId: "io.leka.apf.module.\(name)", + deploymentTargets: deploymentTargets, + infoPlist: .extendingDefault(with: InfoPlist.extendingBase(version: "1.0.0", with: infoPlist)), + sources: ["Sources/**"], + resources: ["Resources/**"], + scripts: TargetScript.linters(), + dependencies: dependencies, + settings: .settings(base: .extendingBase(with: settings)) + ) + + let tests = Target( + name: "\(name)Tests", + destinations: destinations, + product: .unitTests, + bundleId: "io.leka.apf.framework.\(name)Tests", + infoPlist: .extendingDefault(with: InfoPlist.extendingBase(version: "1.0.0", with: infoPlist)), + sources: ["Tests/**"], + resources: [], + scripts: TargetScript.linters(), + dependencies: [ + .target(name: name), + ] + ) + + return [module, tests] +} diff --git a/Tuist/ProjectDescriptionHelpers/Project+Templates+App_macOS.swift b/Tuist/ProjectDescriptionHelpers/Project+Templates+App_macOS.swift deleted file mode 100644 index ca2e11c2d8..0000000000 --- a/Tuist/ProjectDescriptionHelpers/Project+Templates+App_macOS.swift +++ /dev/null @@ -1,47 +0,0 @@ -// Leka - iOS Monorepo -// Copyright APF France handicap -// SPDX-License-Identifier: Apache-2.0 - -import ProjectDescription - -public extension Project { - static func macOSApp( - name: String, - version _: String = "1.0.0", - dependencies: [TargetDependency] - ) -> Project { - let mainTarget = Target( - name: name, - platform: .macOS, - product: .app, - bundleId: "io.leka.apf.app.\(name)", - deploymentTarget: .macOS(targetVersion: "13.0"), - sources: ["Sources/**"], - resources: ["Resources/**"], - scripts: TargetScript.linters(), - dependencies: dependencies - ) - - let testTarget = Target( - name: "\(name)Tests", - platform: .macOS, - product: .unitTests, - bundleId: "io.leka.apf.app.\(name)Tests", - infoPlist: .default, - sources: ["Tests/**"], - resources: [], - scripts: TargetScript.linters(), - dependencies: [ - .target(name: "\(name)"), - ] - ) - - let targets = [mainTarget, testTarget] - - return Project( - name: name, - organizationName: "leka.io", - targets: targets - ) - } -} diff --git a/Tuist/ProjectDescriptionHelpers/Project+Templates+Module.swift b/Tuist/ProjectDescriptionHelpers/Project+Templates+Module.swift deleted file mode 100644 index a01f381dc5..0000000000 --- a/Tuist/ProjectDescriptionHelpers/Project+Templates+Module.swift +++ /dev/null @@ -1,77 +0,0 @@ -// Leka - iOS Monorepo -// Copyright APF France handicap -// SPDX-License-Identifier: Apache-2.0 - -import ProjectDescription - -// MARK: - ModuleExample - -public struct ModuleExample { - // MARK: Lifecycle - - public init(name: String, infoPlist: [String: InfoPlist.Value] = [:]) { - self.name = name - self.infoPlist = infoPlist - } - - // MARK: Public - - public let name: String - public let infoPlist: [String: InfoPlist.Value] -} - -public extension Project { - static func module( - name: String, - platform: Platform, - product: Product = .staticLibrary, - dependencies: [TargetDependency], - settings: Settings? = nil, - examples: [ModuleExample] = [], - options: Options = .options(), - schemes: [Scheme] = [] - ) -> Project { - let frameworkTargets = makeFrameworkTargets( - name: name, - platform: platform, - product: product, - dependencies: dependencies, - settings: settings - ) - - let exampleTargets = examples.compactMap { example in - let appInfoPlist = InfoPlist.base(version: "1.0.0").merging(example.infoPlist) { _, new in new } - - let target = Target( - name: example.name, - platform: .iOS, - product: .app, - bundleId: "io.leka.apf.app.example.\(example.name)", - deploymentTarget: .iOS(targetVersion: "16.0", devices: .ipad), - infoPlist: .extendingDefault(with: appInfoPlist), - sources: ["Examples/\(example.name)/Sources/**"], - resources: ["Examples/\(example.name)/Resources/**"], - scripts: TargetScript.linters(), - dependencies: [.target(name: name)], - settings: .settings(base: [ - "LOCALIZED_STRING_MACRO_NAMES": [ - "NSLocalizedString", - "CFCopyLocalizedString", - "LocalizedString", - "LocalizedStringInterpolation", - ], - ]) - ) - - return target - } - - return Project( - name: name, - organizationName: "leka.io", - options: options, - targets: frameworkTargets + exampleTargets, - schemes: schemes - ) - } -} diff --git a/Tuist/ProjectDescriptionHelpers/Project+Templates.swift b/Tuist/ProjectDescriptionHelpers/Project+Templates.swift deleted file mode 100644 index c3febb54ef..0000000000 --- a/Tuist/ProjectDescriptionHelpers/Project+Templates.swift +++ /dev/null @@ -1,70 +0,0 @@ -// Leka - iOS Monorepo -// Copyright APF France handicap -// SPDX-License-Identifier: Apache-2.0 - -import ProjectDescription - -/// Project helpers are functions that simplify the way you define your project. -/// Share code to create targets, settings, dependencies, -/// Create your own conventions, e.g: a func that makes sure all shared targets are "static frameworks" -/// See https://docs.tuist.io/guides/helpers/ - -extension Project { - // MARK: - Internal - - static func makeFrameworkTargets( - name: String, platform: Platform, product: Product = .staticLibrary, dependencies: [TargetDependency], settings: Settings? = nil - ) - -> [Target] - { - // MARK: - Set product type - - var product = product - - let generateModulesAsFrameworksForDebug = Environment.generateModulesAsFrameworksForDebug.getBoolean( - default: false) - - if generateModulesAsFrameworksForDebug { - product = .framework - } - - // MARK: - Set platform type - - var platform = platform - - let generateMacOSApps = Environment.generateMacOSApps.getBoolean(default: false) - - if generateMacOSApps { - platform = .macOS - } - - let module = Target( - name: "\(name)", - platform: platform, - product: product, - bundleId: "io.leka.apf.module.\(name)", - deploymentTarget: platform == .iOS - ? .iOS(targetVersion: "16.0", devices: .ipad) : .macOS(targetVersion: "13.0"), - infoPlist: .default, - sources: ["Sources/**"], - resources: ["Resources/**"], - scripts: TargetScript.linters(), - dependencies: dependencies, - settings: settings - ) - - let tests = Target( - name: "\(name)Tests", - platform: platform, - product: .unitTests, - bundleId: "io.leka.apf.framework.\(name)Tests", - infoPlist: .default, - sources: ["Tests/**"], - resources: [], - scripts: TargetScript.linters(), - dependencies: [.target(name: name)] - ) - - return [module, tests] - } -} diff --git a/Tuist/ProjectDescriptionHelpers/Project+Schemes.swift b/Tuist/ProjectDescriptionHelpers/Scheme+l10n.swift similarity index 70% rename from Tuist/ProjectDescriptionHelpers/Project+Schemes.swift rename to Tuist/ProjectDescriptionHelpers/Scheme+l10n.swift index 6c0efd3359..58d50d1766 100644 --- a/Tuist/ProjectDescriptionHelpers/Project+Schemes.swift +++ b/Tuist/ProjectDescriptionHelpers/Scheme+l10n.swift @@ -2,10 +2,12 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription -public enum SchemeList { - public static func l10nFR(name: String) -> Scheme { +public extension Scheme { + static func l10nFR(name: String) -> Scheme { Scheme( name: "\(name) πŸ‡«πŸ‡·", shared: true, @@ -14,7 +16,7 @@ public enum SchemeList { ) } - public static func l10nEN(name: String) -> Scheme { + static func l10nEN(name: String) -> Scheme { Scheme( name: "\(name) πŸ‡ΊπŸ‡Έ", shared: true, @@ -23,3 +25,10 @@ public enum SchemeList { ) } } + +func l10nSchemes(name: String) -> [Scheme] { + [ + .l10nFR(name: name), + .l10nEN(name: name), + ] +} diff --git a/Tuist/ProjectDescriptionHelpers/SettingsDictionary+Base.swift b/Tuist/ProjectDescriptionHelpers/SettingsDictionary+Base.swift new file mode 100644 index 0000000000..f0919d552c --- /dev/null +++ b/Tuist/ProjectDescriptionHelpers/SettingsDictionary+Base.swift @@ -0,0 +1,23 @@ +// Leka - iOS Monorepo +// Copyright APF France handicap +// SPDX-License-Identifier: Apache-2.0 + +// swiftformat:disable acronyms + +import ProjectDescription + +extension SettingsDictionary { + static var base: SettingsDictionary = [ + "LOCALIZED_STRING_MACRO_NAMES": [ + "NSLocalizedString", + "CFCopyLocalizedString", + "LocalizedString", + "LocalizedStringInterpolation", + ], + "LOCALIZED_STRING_SWIFTUI_SUPPORT": "NO", + ] + + static func extendingBase(with settings: SettingsDictionary) -> SettingsDictionary { + self.base.merging(settings) { _, new in new } + } +} diff --git a/Tuist/ProjectDescriptionHelpers/TargetScripts.swift b/Tuist/ProjectDescriptionHelpers/TargetScripts.swift index f77409a37e..761ae2f641 100644 --- a/Tuist/ProjectDescriptionHelpers/TargetScripts.swift +++ b/Tuist/ProjectDescriptionHelpers/TargetScripts.swift @@ -2,6 +2,8 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription public extension TargetScript { diff --git a/Workspace.swift b/Workspace.swift index 6fa7f585ac..464fd965a3 100644 --- a/Workspace.swift +++ b/Workspace.swift @@ -2,6 +2,8 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 +// swiftformat:disable acronyms + import ProjectDescription var projects: [Path] {