diff --git a/.github/workflows/ondosee-ios-ci.yml b/.github/workflows/ondosee-ios-ci.yml new file mode 100644 index 0000000..503bd38 --- /dev/null +++ b/.github/workflows/ondosee-ios-ci.yml @@ -0,0 +1,89 @@ +name: ondosee-ios-ci + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "*" ] + +env: + CACHED_DEPENDENCY_PATHS: ${{ github.workspace }}/Tuist/Dependencies + ONDOSEE_IOS_DISCORD_WEBHOOK: ${{ secrets.ONDOSEE_IOS_DISCORD_WEBHOOK }} + +jobs: + prepare-dependency: + name: โš™๏ธ Prepare for CI + runs-on: macos-14 + + steps: + - uses: actions/checkout@v2 + - uses: jdx/mise-action@v2 + with: + xcode-version: 15.2 + + - name: Install tuist + run: mise install tuist + + - name: Compute dependency cache key + id: compute_hash + run: echo "hash=${{ hashFiles('Tuist/Package.swift') }}" >> $GITHUB_OUTPUT + + - name: Check dependency cache + uses: actions/cache@v3 + id: cache_dependencies + with: + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ steps.compute_hash.outputs.hash }} + + - name: Install dependencies + if: steps.cache_dependencies.outputs.cache-hit == '' + run: tuist install + outputs: + dependency_cache_key: ${{ steps.compute_hash.outputs.hash }} + + test: + name: ๐Ÿงช Test + runs-on: macos-14 + needs: prepare-dependency + + steps: + - uses: actions/checkout@v2 + with: + xcode-version: 15.2 + - uses: jdx/mise-action@v2 + + - name: Install tuist + run: mise install tuist + + - name: Check dependency cache + uses: actions/cache@v3 + id: cache_dependencies + with: + path: ${{ env.CACHED_DEPENDENCY_PATHS }} + key: ${{ needs.prepare-dependency.outputs.dependency_cache_key }} + + - name: Install dependencies + if: steps.cache_dependencies.outputs.cache-hit != 'true' + run: tuist install + + - name: Test with tuist + run: TUIST_ENV=CI tuist test --no-selective-testing + + - name: ondosee iOS Test Success Discord Notification + uses: sarisia/actions-status-discord@v1 + if: ${{ success() }} + with: + title: "โœ… ์˜จ๋„์”จ iOS Test ์„ฑ๊ณต !" + description: "Success to test ๐Ÿงฉ" + webhook: ${{ env.ONDOSEE_IOS_DISCORD_WEBHOOK }} + color: 0x43962A + + - name: ondosee iOS Test Failed Discord Notification + uses: sarisia/actions-status-discord@v1 + if: ${{ failure() }} + with: + title: "โŒ ์˜จ๋„์”จ iOS Test ์‹คํŒจ .." + description: "Failed to test ๐Ÿฅบ" + webhook: ${{ env.ONDOSEE_IOS_DISCORD_WEBHOOK }} + color: 0xBB3639 + diff --git a/.gitignore b/.gitignore index 24b244f..665ec07 100644 --- a/.gitignore +++ b/.gitignore @@ -67,4 +67,8 @@ graph.dot Derived/ ### Tuist managed dependencies ### -Tuist/.build \ No newline at end of file +Tuist/.build + +XCConfig/* +XCConfig.zip +!XCConfig/Shared.xcconfig \ No newline at end of file diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/PathExtension.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/PathExtension.swift index 57c114a..297d4fe 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/PathExtension.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/PathExtension.swift @@ -34,7 +34,7 @@ public extension TargetDependency { static func core(name: String) -> Self { return .project(target: name, path: .relativeToCore(name)) } - static func shated(name: String) -> Self { + static func shared(name: String) -> Self { return .project(target: name, path: .relativeToShared(name)) } static func userInterface(name: String) -> Self { diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/TargetDependency+ModularTarget.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/TargetDependency+ModularTarget.swift index 065f447..a003404 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/TargetDependency+ModularTarget.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/TargetDependency+ModularTarget.swift @@ -21,7 +21,7 @@ public extension TargetDependency { path: .relativeToDomain(target.rawValue) ) } - + static func core( target: ModulePaths.Core, type: ModularTargetType = .sources @@ -31,7 +31,7 @@ public extension TargetDependency { path: .relativeToCore(target.rawValue) ) } - + static func shared( target: ModulePaths.Shared, type: ModularTargetType = .sources @@ -41,7 +41,7 @@ public extension TargetDependency { path: .relativeToShared(target.rawValue) ) } - + static func userInterface( target: ModulePaths.UserInterface, type: ModularTargetType = .sources diff --git a/Plugin/EnvironmentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift b/Plugin/EnvironmentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift index 6252b1f..dfb0469 100644 --- a/Plugin/EnvironmentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift +++ b/Plugin/EnvironmentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift @@ -12,7 +12,7 @@ public struct ProjectEnvironment { public let env = ProjectEnvironment( name: "ondosee", organizationName: "com", - destinations: [.iPhone, .appleWatch], - deploymentTargets: .multiplatform(iOS: "16.0", watchOS: "9.0"), + destinations: .iOS, + deploymentTargets: .iOS("16.0"), baseSetting: [:] ) diff --git a/Projects/App/Project.swift b/Projects/App/Project.swift index 7fb8ffa..a4db5bc 100644 --- a/Projects/App/Project.swift +++ b/Projects/App/Project.swift @@ -7,40 +7,42 @@ import ProjectDescriptionHelpers let configurations: [Configuration] = .default -let settings: Settings = .settings( - base: env.baseSetting, - configurations: configurations, - defaultSettings: .recommended -) +let settings: Settings = + .settings( + base: env.baseSetting, + configurations: configurations, + defaultSettings: .recommended + ) let scripts: [TargetScript] = generateEnvironment.scripts let targets: [Target] = [ .target( name: env.name, - destinations: env.destinations, + destinations: [.iPhone, .iPad], product: .app, bundleId: "\(env.organizationName).\(env.name)", deploymentTargets: .iOS("16.0"), infoPlist: .file(path: "iOS/Support/Info.plist"), sources: ["iOS/Sources/**"], resources: ["iOS/Resources/**"], - entitlements: .file(path: "iOS/Support/ondosee.entitlements"), + entitlements: "iOS/Support/ondosee.entitlements", scripts: scripts, - dependencies: ModulePaths.Feature.allCases.map { TargetDependency.feature(target: $0) } + dependencies: + ModulePaths.Feature.allCases.map { TargetDependency.feature(target: $0) } + ModulePaths.Domain.allCases.map { TargetDependency.domain(target: $0) } - + [ + + + [ .core(target: .Networking), - .target(name: "\(env.name)Widget"), - .target(name: "\(env.name)WatchApp") - ], + .target(name: "\(env.name)Widget") + ], settings: .settings( base: env.baseSetting ) ), .target( name: "\(env.name)Widget", - destinations: [.iPhone], + destinations: [.iPhone, .iPad], product: .appExtension, bundleId: "\(env.organizationName).\(env.name).ondoseeWidget", deploymentTargets: .iOS("16.0"), @@ -52,27 +54,8 @@ let targets: [Target] = [ dependencies: [ .userInterface(target: .DesignSystem) ], - settings: .settings( - base: env.baseSetting - ) + settings: settings ), - .target( - name: "\(env.name)WatchApp", - destinations: [.appleWatch], - product: .app, - bundleId: "\(env.organizationName).\(env.name).watchkitapp", - deploymentTargets: .watchOS("9.0"), - infoPlist: .file(path: "watchOS/Support/Info.plist"), - sources: ["watchOS/Sources/**"], - resources: ["watchOS/Resources/**"], - scripts: scripts, - dependencies: [ - .userInterface(target: .DesignSystem) - ], - settings: .settings( - base: env.baseSetting - ) - ) ] let schemes: [Scheme] = [ diff --git a/Projects/App/iOS-Widget/Resources/LaunchScreen.storyboard b/Projects/App/iOS-Widget/Resources/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/Projects/App/iOS-Widget/Resources/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/App/iOS-Widget/Sources/Application/OndoseeIOSWidgetApp.swift b/Projects/App/iOS-Widget/Sources/Application/OndoseeIOSWidgetApp.swift new file mode 100644 index 0000000..e1de425 --- /dev/null +++ b/Projects/App/iOS-Widget/Sources/Application/OndoseeIOSWidgetApp.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct OndoseeIOSWidgetApp: App { + var body: some Scene { + WindowGroup { + EmptyView() + } + } +} diff --git a/Projects/App/iOS-Widget/Support/ondoseeWidget.entitlements b/Projects/App/iOS-Widget/Support/ondoseeWidget.entitlements index 59ab01e..e69de29 100644 --- a/Projects/App/iOS-Widget/Support/ondoseeWidget.entitlements +++ b/Projects/App/iOS-Widget/Support/ondoseeWidget.entitlements @@ -1,12 +0,0 @@ - - - - - - diff --git a/Projects/App/watchOS/Resources/Assets.xcassets/AccentColor.colorset/Contents.json b/Projects/App/watchOS/Resources/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb87897..0000000 --- a/Projects/App/watchOS/Resources/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Projects/App/watchOS/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/Projects/App/watchOS/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 9221b9b..0000000 --- a/Projects/App/watchOS/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Projects/App/watchOS/Resources/Assets.xcassets/Contents.json b/Projects/App/watchOS/Resources/Assets.xcassets/Contents.json deleted file mode 100644 index 73c0059..0000000 --- a/Projects/App/watchOS/Resources/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Projects/App/watchOS/Sources/Sources.swift b/Projects/App/watchOS/Sources/Sources.swift deleted file mode 100644 index 9f44cbf..0000000 --- a/Projects/App/watchOS/Sources/Sources.swift +++ /dev/null @@ -1 +0,0 @@ -// This is For Tuist diff --git a/Projects/App/watchOS/Support/Info.plist b/Projects/App/watchOS/Support/Info.plist deleted file mode 100644 index 2688b32..0000000 --- a/Projects/App/watchOS/Support/Info.plist +++ /dev/null @@ -1,62 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - - - - - UIApplicationSupportsIndirectInputEvents - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Projects/Core/Networking/Project.swift b/Projects/Core/Networking/Project.swift index 14d6ec3..4c50455 100644 --- a/Projects/Core/Networking/Project.swift +++ b/Projects/Core/Networking/Project.swift @@ -22,9 +22,12 @@ let project = Project.module( module: .core(.Networking), spec: .init( infoPlist: .extendingDefault( - with: [:] + with: [ + "BASE_URL": .string("$(BASE_URL)") + ] ), - dependencies: [], + dependencies: [ + ], settings: .settings( base: env.baseSetting .merging(.allLoadLDFlages), @@ -36,7 +39,8 @@ let project = Project.module( .implements( module: .core(.Networking), dependencies: [ - + .core(target: .Networking, type: .interface), + .shared(target: .GlobalThirdPartyLibrary) ] ), .testing(module: .core(.Networking), dependencies: [ diff --git a/Projects/App/iOS-Widget/Sources/Sources.swift b/Projects/Domain/BaseDomain/Testing/Testing.swift similarity index 100% rename from Projects/App/iOS-Widget/Sources/Sources.swift rename to Projects/Domain/BaseDomain/Testing/Testing.swift diff --git a/Projects/Feature/BaseFeature/Project.swift b/Projects/Feature/BaseFeature/Project.swift index 99f05ab..0e05135 100644 --- a/Projects/Feature/BaseFeature/Project.swift +++ b/Projects/Feature/BaseFeature/Project.swift @@ -6,10 +6,11 @@ let project = Project.module( name: ModulePaths.Feature.BaseFeature.rawValue, targets: [ .interface(module: .feature(.BaseFeature), dependencies: [ - ]), .implements(module: .feature(.BaseFeature), product: .framework, dependencies: [ - .feature(target: .BaseFeature, type: .interface) + .feature(target: .BaseFeature, type: .interface), + .userInterface(target: .DesignSystem), + .shared(target: .GlobalThirdPartyLibrary) ]), .tests(module: .feature(.BaseFeature), dependencies: [ .feature(target: .BaseFeature) diff --git a/Projects/Shared/GlobalThirdPartyLibrary/Project.swift b/Projects/Shared/GlobalThirdPartyLibrary/Project.swift index b77240d..ae393a4 100644 --- a/Projects/Shared/GlobalThirdPartyLibrary/Project.swift +++ b/Projects/Shared/GlobalThirdPartyLibrary/Project.swift @@ -5,6 +5,7 @@ import ProjectDescriptionHelpers let project = Project.module( name: ModulePaths.Shared.GlobalThirdPartyLibrary.rawValue, targets: [ - .implements(module: .shared(.GlobalThirdPartyLibrary), product: .framework, dependencies: []) + .implements(module: .shared(.GlobalThirdPartyLibrary), product: .framework, dependencies: [ + ]) ] ) diff --git a/Projects/UserInterface/DesignSystem/Example/Sources/AppDelegate.swift b/Projects/UserInterface/DesignSystem/Example/Sources/AppDelegate.swift index ad9cb02..853c84c 100644 --- a/Projects/UserInterface/DesignSystem/Example/Sources/AppDelegate.swift +++ b/Projects/UserInterface/DesignSystem/Example/Sources/AppDelegate.swift @@ -9,7 +9,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil ) -> Bool { window = UIWindow(frame: UIScreen.main.bounds) - let viewController = DesignSystemDemoViewController(nibName: nil, bundle: nil) + let viewController = DesignSystemExampleViewController(nibName: nil, bundle: nil) window?.rootViewController = viewController window?.makeKeyAndVisible() diff --git a/Projects/UserInterface/DesignSystem/Example/Sources/DesignSystemExampleViewController.swift b/Projects/UserInterface/DesignSystem/Example/Sources/DesignSystemExampleViewController.swift new file mode 100644 index 0000000..c994cef --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Example/Sources/DesignSystemExampleViewController.swift @@ -0,0 +1,11 @@ +import DesignSystem +import UIKit + +final class DesignSystemExampleViewController: UIViewController { + override func viewDidLoad() { + super.viewDidLoad() + } + + @objc func buttonTap(_ sender: UIButton) { + } +} diff --git a/Projects/UserInterface/DesignSystem/Project.swift b/Projects/UserInterface/DesignSystem/Project.swift index 1a44017..ceacd65 100644 --- a/Projects/UserInterface/DesignSystem/Project.swift +++ b/Projects/UserInterface/DesignSystem/Project.swift @@ -9,13 +9,16 @@ let project = Project.module( module: .userInterface(.DesignSystem), product: .framework, spec: .init( - resources: ["Resources/**"], - dependencies: [] + resources: ["Resources/**"], + dependencies: [ + .shared(target: .GlobalThirdPartyLibrary) + ] ) ), .example(module: .userInterface(.DesignSystem), dependencies: [ .userInterface(target: .DesignSystem) ]) ], - resourceSynthesizers: .default + resourceSynthesizers: .default + [ + ] ) diff --git a/Scripts/.swiftlint.yml b/Scripts/.swiftlint.yml index b437648..0d13280 100644 --- a/Scripts/.swiftlint.yml +++ b/Scripts/.swiftlint.yml @@ -1,7 +1,7 @@ excluded: - fastlane - Dependencies - - Carthage + - ondosee disabled_rules: - void_function_in_ternary diff --git a/Scripts/SwiftLintRunScript.sh b/Scripts/SwiftLintRunScript.sh old mode 100644 new mode 100755 diff --git a/Tuist/Config.swift b/Tuist/Config.swift index 0b5c58b..c0ac38f 100644 --- a/Tuist/Config.swift +++ b/Tuist/Config.swift @@ -4,8 +4,7 @@ let config = Config( plugins: [ .local(path: .relativeToRoot("Plugin/ConfigurationPlugin")), .local(path: .relativeToRoot("Plugin/DependencyPlugin")), - .local(path: .relativeToRoot("Plugin/EnvironmentPlugin")), - .local(path: .relativeToRoot("Plugin/TemplatePlugin")) + .local(path: .relativeToRoot("Plugin/EnvironmentPlugin")) ], generationOptions: .options() ) diff --git a/Tuist/ProjectDescriptionHelpers/Action/Action+Templete.swift b/Tuist/ProjectDescriptionHelpers/Action/Action+Templete.swift index 50385bf..10ac772 100644 --- a/Tuist/ProjectDescriptionHelpers/Action/Action+Templete.swift +++ b/Tuist/ProjectDescriptionHelpers/Action/Action+Templete.swift @@ -1,8 +1,10 @@ import ProjectDescription +import Foundation public extension TargetScript { static let swiftLint = TargetScript.pre( path: Path.relativeToRoot("Scripts/SwiftLintRunScript.sh"), - name: "SwiftLint" + name: "SwiftLint", + basedOnDependencyAnalysis: false ) } diff --git a/Tuist/ProjectDescriptionHelpers/Internal/Configurable.swift b/Tuist/ProjectDescriptionHelpers/Internal/Configurable.swift index 9721888..ff97c27 100644 --- a/Tuist/ProjectDescriptionHelpers/Internal/Configurable.swift +++ b/Tuist/ProjectDescriptionHelpers/Internal/Configurable.swift @@ -1,4 +1,4 @@ -import ProjectDescription +import Foundation protocol Configurable { func with(_ block: (inout Self) throws -> Void) rethrows -> Self diff --git a/Tuist/ProjectDescriptionHelpers/Project/Project+Module.swift b/Tuist/ProjectDescriptionHelpers/Project/Project+Module.swift index 47aa8ab..3c320aa 100644 --- a/Tuist/ProjectDescriptionHelpers/Project/Project+Module.swift +++ b/Tuist/ProjectDescriptionHelpers/Project/Project+Module.swift @@ -22,7 +22,7 @@ public extension Project { settings: settings, targets: targets, schemes: targets.contains { $0.product == .app } ? - [.makeScheme(target: .dev, name: name), .makeScheme(target: .dev, name: name)] : + [.makeScheme(target: .dev, name: name), .makeExampleScheme(target: .dev, name: name)] : [.makeScheme(target: .dev, name: name)], fileHeaderTemplate: fileHeaderTemplate, additionalFiles: additionalFiles, diff --git a/Tuist/ProjectDescriptionHelpers/Project/Project+makeModule.swift b/Tuist/ProjectDescriptionHelpers/Project/Project+makeModule.swift index ad64a4c..8d0532a 100644 --- a/Tuist/ProjectDescriptionHelpers/Project/Project+makeModule.swift +++ b/Tuist/ProjectDescriptionHelpers/Project/Project+makeModule.swift @@ -29,27 +29,25 @@ public extension Project { sources: SourceFilesList = .sources, resources: ResourceFileElements? = nil, settings: SettingsDictionary = [:], - additionalPlistRows: [String: ProjectDescription.Plist.Value] = [:], + additionalPlistRows: [String: Plist.Value] = [:], additionalFiles: [FileElement] = [], - configurations: [Configuration] = [] + configurations: [Configuration] = [], + resourceSynthesizers: [ResourceSynthesizer] = .default ) -> Project { let scripts: [TargetScript] = generateEnvironment.scripts let ldFlagsSettings: SettingsDictionary = product == .framework ? - ["OTHER_LDFLAGS": .string("$(inherited) --all_load")] : - ["OTHER_LDFLAGS": .string("$(inherited")] + ["OTHER_LDFLAGS": .string("$(inherited) -all_load")] : + ["OTHER_LDFLAGS": .string("$(inherited)")] var configurations = configurations if configurations.isEmpty { - configurations = [ - .debug(name: .dev, xcconfig: .shared), - .debug(name: .stage, xcconfig: .shared), - .release(name: .prod, xcconfig: .shared) - ] + configurations = .default } let settings: Settings = .settings( base: env.baseSetting - .merging(settings), + .merging(settings) + .merging(ldFlagsSettings), configurations: configurations, defaultSettings: .recommended ) @@ -60,7 +58,7 @@ public extension Project { if targets.contains(.interface) { dependencies.append(.target(name: "\(name)Interface")) allTargets.append( - Target.target( + .target( name: "\(name)Interface", destinations: destinations, product: .framework, @@ -69,7 +67,7 @@ public extension Project { infoPlist: .default, sources: .interface, scripts: scripts, - dependencies: internalDependencies, + dependencies: interfaceDependencies, additionalFiles: additionalFiles ) ) @@ -77,7 +75,7 @@ public extension Project { // MARK: Sources allTargets.append( - Target.target( + .target( name: name, destinations: destinations, product: product, @@ -94,8 +92,8 @@ public extension Project { // MARK: Testing if targets.contains(.testing) && targets.contains(.interface) { allTargets.append( - Target.target( - name: name, + .target( + name: "\(name)Testing", destinations: destinations, product: .framework, bundleId: "\(env.organizationName).\(name)Testing", @@ -119,10 +117,27 @@ public extension Project { testTargetDependencies.append(.target(name: "\(name)Testing")) } + // MARK: Unit Test + if targets.contains(.unitTest) { + allTargets.append( + .target( + name: "\(name)Tests", + destinations: destinations, + product: .unitTests, + bundleId: "\(env.organizationName).\(name)Tests", + deploymentTargets: env.deploymentTargets, + infoPlist: .default, + sources: .unitTests, + scripts: scripts, + dependencies: testTargetDependencies + unitTestDependencies + ) + ) + } + // MARK: UI Test if targets.contains(.uiTest) { allTargets.append( - Target.target( + .target( name: "\(name)UITests", destinations: destinations, product: .uiTests, @@ -143,8 +158,8 @@ public extension Project { exampleDependencies.append(.target(name: "\(name)Testing")) } allTargets.append( - Target.target( - name: "\(name)ExampleApp", + .target( + name: "\(name)Example", destinations: destinations, product: .app, bundleId: "\(env.organizationName).\(name)ExampleApp", @@ -154,7 +169,7 @@ public extension Project { "UILaunchStoryboardName": "LaunchScreen", "ENABLE_TESTS": .boolean(true), ]), - sources: .exampleSource, + sources: .exampleSources, resources: ["Example/Resources/**"], scripts: scripts, dependencies: exampleDependencies @@ -165,14 +180,15 @@ public extension Project { let schemes: [Scheme] = targets.contains(.example) ? [.makeScheme(target: .dev, name: name), .makeExampleScheme(target: .dev, name: name)] : [.makeScheme(target: .dev, name: name)] - + return Project( name: name, organizationName: env.organizationName, packages: packages, settings: settings, targets: allTargets, - schemes: schemes + schemes: schemes, + resourceSynthesizers: resourceSynthesizers ) } } diff --git a/Tuist/ProjectDescriptionHelpers/SettingsDictionary/LDFlagsSettings.swift b/Tuist/ProjectDescriptionHelpers/SettingsDictionary/LDFlagsSettings.swift index a3edbf1..8500d1f 100644 --- a/Tuist/ProjectDescriptionHelpers/SettingsDictionary/LDFlagsSettings.swift +++ b/Tuist/ProjectDescriptionHelpers/SettingsDictionary/LDFlagsSettings.swift @@ -2,7 +2,7 @@ import ProjectDescription public extension SettingsDictionary { static let ldFlages: SettingsDictionary = [ - "OTHER_LDFLAGS": .string("$(inherited") + "OTHER_LDFLAGS": .string("$(inherited)") ] static let allLoadLDFlages: SettingsDictionary = [ diff --git a/Tuist/ProjectDescriptionHelpers/SourceFiles/SourceFiles+Template.swift b/Tuist/ProjectDescriptionHelpers/SourceFiles/SourceFiles+Template.swift index 1450307..ea0e414 100644 --- a/Tuist/ProjectDescriptionHelpers/SourceFiles/SourceFiles+Template.swift +++ b/Tuist/ProjectDescriptionHelpers/SourceFiles/SourceFiles+Template.swift @@ -1,7 +1,7 @@ import ProjectDescription public extension SourceFilesList { - static let exampleSource: SourceFilesList = "Example/Sources/**" + static let exampleSources: SourceFilesList = "Example/Sources/**" static let interface: SourceFilesList = "Interface/**" static let sources: SourceFilesList = "Sources/**" static let testing: SourceFilesList = "Testing/**" diff --git a/Tuist/ProjectDescriptionHelpers/Target/Target+Modular.swift b/Tuist/ProjectDescriptionHelpers/Target/Target+Modular.swift index 7d93828..0e14f0c 100644 --- a/Tuist/ProjectDescriptionHelpers/Target/Target+Modular.swift +++ b/Tuist/ProjectDescriptionHelpers/Target/Target+Modular.swift @@ -11,26 +11,26 @@ public extension Target { } .toTarget(with: module.targetName(type: .interface), product: .framework) } - + static func interface(module: ModulePaths, dependencies: [TargetDependency] = []) -> Target { TargetSpec(sources: .interface, dependencies: dependencies) .toTarget(with: module.targetName(type: .interface), product: .framework) } - + static func interface(name: String, spec: TargetSpec) -> Target { spec.with { $0.sources = .interface } .toTarget(with: "\(name)Interface", product: .framework) } - + static func interface(name: String, dependencies: [TargetDependency] = []) -> Target { TargetSpec(sources: .interface, dependencies: dependencies) .toTarget(with: "\(name)Interface", product: .framework) } } -// MARK: - Implements +// MARK: Implements public extension Target { static func implements( module: ModulePaths, @@ -73,7 +73,7 @@ public extension Target { } } -// MARK: - Testing +// MARK: Testing public extension Target { static func testing(module: ModulePaths, spec: TargetSpec) -> Target { spec.with { @@ -127,13 +127,14 @@ public extension Target { } } -// MARK: - Example +// MARK: Example public extension Target { static func example(module: ModulePaths, spec: TargetSpec) -> Target { spec.with { - $0.sources = .exampleSource + $0.sources = .exampleSources $0.settings = .settings( - base: spec.settings?.base ?? [:], + base: (spec.settings?.base ?? [:]) + .merging(["OTHER_LDFLAGS": "$(inherited) -Xlinker -interposable"]), configurations: .default, defaultSettings: spec.settings?.defaultSettings ?? .recommended ) @@ -154,17 +155,22 @@ public extension Target { "UILaunchStoryboardName": "LaunchScreen", "ENABLE_TESTS": .boolean(true), ]), - sources: .exampleSource, - dependencies: dependencies + sources: .exampleSources, + dependencies: dependencies, + settings: .settings( + base: ["OTHER_LDFLAGS": "$(inherited) -Xlinker -interposable"], + configurations: .default + ) ) .toTarget(with: module.targetName(type: .example), product: .app) } static func example(name: String, spec: TargetSpec) -> Target { spec.with { - $0.sources = .exampleSource + $0.sources = .exampleSources $0.settings = .settings( - base: spec.settings?.base ?? [:], + base: (spec.settings?.base ?? [:]) + .merging(["OTHER_LDFLAGS": "$(inherited) -Xlinker -interposable"]), configurations: .default, defaultSettings: spec.settings?.defaultSettings ?? .recommended ) @@ -185,8 +191,12 @@ public extension Target { "UILaunchStoryboardName": "LaunchScreen", "ENABLE_TESTS": .boolean(true), ]), - sources: .exampleSource, - dependencies: dependencies + sources: .exampleSources, + dependencies: dependencies, + settings: .settings( + base: ["OTHER_LDFLAGS": "$(inherited) -Xlinker -interposable"], + configurations: .default + ) ) .toTarget(with: "\(name)Example", product: .app) } diff --git a/Tuist/ProjectDescriptionHelpers/Target/TargetSpec.swift b/Tuist/ProjectDescriptionHelpers/Target/TargetSpec.swift index f92e16e..f9f0531 100644 --- a/Tuist/ProjectDescriptionHelpers/Target/TargetSpec.swift +++ b/Tuist/ProjectDescriptionHelpers/Target/TargetSpec.swift @@ -19,12 +19,10 @@ public struct TargetSpec: Configurable { public var dependencies: [TargetDependency] public var settings: Settings? public var coreDataModels: [CoreDataModel] - public var environmentVariables: [String: EnvironmentVariable] + public var environment: [String: EnvironmentVariable] public var launchArguments: [LaunchArgument] public var additionalFiles: [FileElement] public var buildRules: [BuildRule] - public var mergedBinaryType: MergedBinaryType - public var mergeable: Bool public init( name: String = "", @@ -43,12 +41,10 @@ public struct TargetSpec: Configurable { dependencies: [TargetDependency] = [], settings: Settings? = nil, coreDataModels: [CoreDataModel] = [], - environmentVariables: [String: EnvironmentVariable] = [:], + environment: [String: EnvironmentVariable] = [:], launchArguments: [LaunchArgument] = [], additionalFiles: [FileElement] = [], - buildRules: [BuildRule] = [], - mergedBinaryType: MergedBinaryType = .disabled, - mergeable: Bool = false + buildRules: [BuildRule] = [] ) { self.name = name self.destinations = destinations @@ -66,12 +62,10 @@ public struct TargetSpec: Configurable { self.dependencies = dependencies self.settings = settings self.coreDataModels = coreDataModels - self.environmentVariables = environmentVariables + self.environment = environment self.launchArguments = launchArguments self.additionalFiles = additionalFiles self.buildRules = buildRules - self.mergedBinaryType = mergedBinaryType - self.mergeable = mergeable } func toTarget() -> Target { @@ -79,7 +73,7 @@ public struct TargetSpec: Configurable { } func toTarget(with name: String, product: Product? = nil) -> Target { - Target.target( + .target( name: name, destinations: destinations, product: product ?? self.product, @@ -101,12 +95,10 @@ public struct TargetSpec: Configurable { defaultSettings: .recommended ), coreDataModels: coreDataModels, - environmentVariables: environmentVariables, + environmentVariables: environment, launchArguments: launchArguments, additionalFiles: additionalFiles, - buildRules: buildRules, - mergedBinaryType: mergedBinaryType, - mergeable: mergeable + buildRules: buildRules ) } } diff --git a/XCConfig/App/DEV.xcconfig b/XCConfig/App/DEV.xcconfig deleted file mode 100644 index 9a6ff93..0000000 --- a/XCConfig/App/DEV.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "../Shared.xcconfig" \ No newline at end of file diff --git a/XCConfig/App/PROD.xcconfig b/XCConfig/App/PROD.xcconfig deleted file mode 100644 index 9a6ff93..0000000 --- a/XCConfig/App/PROD.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "../Shared.xcconfig" \ No newline at end of file diff --git a/XCConfig/App/STAGE.xcconfig b/XCConfig/App/STAGE.xcconfig deleted file mode 100644 index 9a6ff93..0000000 --- a/XCConfig/App/STAGE.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "../Shared.xcconfig" \ No newline at end of file diff --git a/XCConfig/Networking/DEV.xcconfig b/XCConfig/Networking/DEV.xcconfig deleted file mode 100644 index 9a6ff93..0000000 --- a/XCConfig/Networking/DEV.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "../Shared.xcconfig" \ No newline at end of file diff --git a/XCConfig/Networking/PROD.xcconfig b/XCConfig/Networking/PROD.xcconfig deleted file mode 100644 index 9a6ff93..0000000 --- a/XCConfig/Networking/PROD.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "../Shared.xcconfig" \ No newline at end of file diff --git a/XCConfig/Networking/STAGE.xcconfig b/XCConfig/Networking/STAGE.xcconfig deleted file mode 100644 index 9a6ff93..0000000 --- a/XCConfig/Networking/STAGE.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "../Shared.xcconfig" \ No newline at end of file