diff --git a/Project.swift b/Project.swift index c58b5cd2..b59b0b93 100644 --- a/Project.swift +++ b/Project.swift @@ -22,6 +22,7 @@ extension Project { schemes: [ .productionScheme(name: name), .stagingScheme(name: name), + .devScheme(name: name), .kifUITestsScheme(name: name) ] ) diff --git a/Tuist/ProjectDescriptionHelpers/BuildConfiguration.swift b/Tuist/ProjectDescriptionHelpers/BuildConfiguration.swift index 930edded..eb2686be 100644 --- a/Tuist/ProjectDescriptionHelpers/BuildConfiguration.swift +++ b/Tuist/ProjectDescriptionHelpers/BuildConfiguration.swift @@ -2,6 +2,8 @@ import ProjectDescription public enum BuildConfiguration: CaseIterable { + case debugDev + case releaseDev case debugStaging case releaseStaging case debugProduction @@ -9,33 +11,39 @@ public enum BuildConfiguration: CaseIterable { var name: ConfigurationName { switch self { - case .debugStaging: return .configuration("Debug Staging") - case .releaseStaging: return .configuration("Release Staging") - case .debugProduction: return .configuration("Debug Production") - case .releaseProduction: return .configuration("Release Production") + case .debugDev: .configuration("Debug Dev") + case .releaseDev: .configuration("Release Dev") + case .debugStaging: .configuration("Debug Staging") + case .releaseStaging: .configuration("Release Staging") + case .debugProduction: .configuration("Debug Production") + case .releaseProduction: .configuration("Release Production") } } private var path: String { let rootPath = "Configurations/XCConfigs/" switch self { - case .debugStaging: - return "\(rootPath)DebugStaging.xcconfig" - case .releaseStaging: - return "\(rootPath)ReleaseStaging.xcconfig" - case .debugProduction: - return "\(rootPath)DebugProduction.xcconfig" - case .releaseProduction: - return "\(rootPath)ReleaseProduction.xcconfig" + case .debugDev: + return "\(rootPath)DebugDev.xcconfig" + case .releaseDev: + return "\(rootPath)DebugDev.xcconfig" + case .debugStaging: + return "\(rootPath)DebugStaging.xcconfig" + case .releaseStaging: + return "\(rootPath)ReleaseStaging.xcconfig" + case .debugProduction: + return "\(rootPath)DebugProduction.xcconfig" + case .releaseProduction: + return "\(rootPath)ReleaseProduction.xcconfig" } } public func createConfiguration(projectName: String) -> Configuration { let xcconfig = Path("\(projectName)/\(path)") switch self { - case .debugStaging, .debugProduction: + case .debugDev, .debugStaging, .debugProduction: return .debug(name: name, xcconfig: xcconfig) - case .releaseStaging, .releaseProduction: + case .releaseDev, .releaseStaging, .releaseProduction: return .release(name: name, xcconfig: xcconfig) } } diff --git a/Tuist/ProjectDescriptionHelpers/Scheme+Initializing.swift b/Tuist/ProjectDescriptionHelpers/Scheme+Initializing.swift index cda644fd..1813f9c6 100644 --- a/Tuist/ProjectDescriptionHelpers/Scheme+Initializing.swift +++ b/Tuist/ProjectDescriptionHelpers/Scheme+Initializing.swift @@ -36,6 +36,23 @@ extension Scheme { ) } + public static func devScheme(name: String) -> Scheme { + let debugConfigName = BuildConfiguration.debugDev.name + let releaseConfigName = BuildConfiguration.releaseDev.name + let testModules = testSchemes(name) + + return Scheme( + name: "\(name) Dev", + shared: true, + buildAction: .buildAction(targets: ["\(name)"]), + testAction: .targets(testModules, configuration: debugConfigName), + runAction: .runAction(configuration: debugConfigName), + archiveAction: .archiveAction(configuration: releaseConfigName), + profileAction: .profileAction(configuration: debugConfigName), + analyzeAction: .analyzeAction(configuration: debugConfigName) + ) + } + public static func kifUITestsScheme(name: String) -> Scheme { return Scheme( name: "\(name)KIFUITests", diff --git a/{PROJECT_NAME}/Configurations/Plists/GoogleService/Dev/GoogleService-Info.plist b/{PROJECT_NAME}/Configurations/Plists/GoogleService/Dev/GoogleService-Info.plist new file mode 100644 index 00000000..a71fe808 --- /dev/null +++ b/{PROJECT_NAME}/Configurations/Plists/GoogleService/Dev/GoogleService-Info.plist @@ -0,0 +1,7 @@ + + + + + + + diff --git a/{PROJECT_NAME}/Configurations/XCConfigs/DebugDev.xcconfig b/{PROJECT_NAME}/Configurations/XCConfigs/DebugDev.xcconfig new file mode 100644 index 00000000..ee787bbd --- /dev/null +++ b/{PROJECT_NAME}/Configurations/XCConfigs/DebugDev.xcconfig @@ -0,0 +1,13 @@ +BUILD_ACTIVE_RESOURCES_ONLY = YES +DEBUG_INFORMATION_FORMAT = dwarf +ENABLE_NS_ASSERTIONS = YES +ENABLE_TESTABILITY = YES +GCC_OPTIMIZATION_LEVEL = 0 +ONLY_ACTIVE_ARCH = YES +SWIFT_OPTIMIZATION_LEVEL = -Onone + +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG=1 DEV=1 +APP_DISPLAY_NAME = $(TARGET_NAME) Dev +PRODUCT_BUNDLE_IDENTIFIER = {BUNDLE_ID_DEV} +SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG DEV +OTHER_SWIFT_FLAGS = $(inherited) -Xfrontend -warn-long-expression-type-checking=300 -Xfrontend -warn-long-function-bodies=300 diff --git a/{PROJECT_NAME}/Configurations/XCConfigs/ReleaseDev.xcconfig b/{PROJECT_NAME}/Configurations/XCConfigs/ReleaseDev.xcconfig new file mode 100644 index 00000000..5fbc62de --- /dev/null +++ b/{PROJECT_NAME}/Configurations/XCConfigs/ReleaseDev.xcconfig @@ -0,0 +1,12 @@ +DEBUG_INFORMATION_FORMAT = dwarf-with-dsym +ENABLE_NS_ASSERTIONS = NO +GCC_OPTIMIZATION_LEVEL = s +SWIFT_COMPILATION_MODE = wholemodule +SWIFT_OPTIMIZATION_LEVEL = -O +ENABLE_BITCODE = NO + +ENABLE_BITCODE = NO +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEV=1 +APP_DISPLAY_NAME = $(TARGET_NAME) DEV +PRODUCT_BUNDLE_IDENTIFIER = {BUNDLE_ID_DEV} +SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEV RELEASE