Skip to content

Commit

Permalink
[Feat] Scheme+Template으로 Scheme 분리 DO-SOPT-iOS-Part#18
Browse files Browse the repository at this point in the history
  • Loading branch information
HELLOHIDI committed Jul 1, 2024
1 parent 23962ae commit 642b55f
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 55 deletions.
69 changes: 14 additions & 55 deletions Tuist/ProjectDescriptionHelpers/Project+Templates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@ import ProjectDescription
import ConfigPlugin
import EnvPlugin


public extension Project {
/// Sumarry: 모듈을 만드는 함수
///
/// Discussion/Overview
///
/// - Parameters:
/// - [param]: [description]
/// - Returns: [description]
/// - Warning: [description]
/// - Author: [name]
/// - Version: [version number]
/// - Note: [note message]
/// - Tip: [tip message]
/// - Todo: [todo message]
static func makeModule(
name: String,
targets: Set<FeatureTarget> = Set([.staticFramework, .unitTest, .demo]),
Expand Down Expand Up @@ -160,61 +174,6 @@ public extension Project {
}
}

extension Scheme {
/// Scheme 생성하는 method

static func makeScheme(configs: ConfigurationName, name: String) -> Scheme { // 일반앱
return Scheme(
name: name,
shared: true,
buildAction: .buildAction(targets: ["\(name)"]),
testAction: .targets(
["\(name)Tests"],
configuration: configs,
options: .options(coverage: true, codeCoverageTargets: ["\(name)"])
),
runAction: .runAction(configuration: configs),
archiveAction: .archiveAction(configuration: configs),
profileAction: .profileAction(configuration: configs),
analyzeAction: .analyzeAction(configuration: configs)
)
}

static func makeDemoScheme(configs: ConfigurationName, name: String) -> Scheme { // 데모앱
return Scheme(
name: "\(name)Demo",
shared: true,
buildAction: .buildAction(targets: ["\(name)Demo"]),
testAction: .targets(
["\(name)Tests"],
configuration: configs,
options: .options(coverage: true, codeCoverageTargets: ["\(name)Demo"])
),
runAction: .runAction(configuration: configs),
archiveAction: .archiveAction(configuration: configs),
profileAction: .profileAction(configuration: configs),
analyzeAction: .analyzeAction(configuration: configs)
)
}

static func makeDemoAppTestScheme() -> Scheme { // 데모테스트앱
let targetName = "\(Environment.workspaceName)-Demo"
return Scheme(
name: "\(targetName)-Test",
shared: true,
buildAction: .buildAction(targets: ["\(targetName)"]),
testAction: .targets(
["\(targetName)Tests"],
configuration: "Test",
options: .options(coverage: true, codeCoverageTargets: ["\(targetName)"])
),
runAction: .runAction(configuration: "Test"),
archiveAction: .archiveAction(configuration: "Test"),
profileAction: .profileAction(configuration: "Test"),
analyzeAction: .analyzeAction(configuration: "Test")
)
}
}

extension Project {
static let appSchemes: [Scheme] = [
Expand Down
67 changes: 67 additions & 0 deletions Tuist/ProjectDescriptionHelpers/Scheme+Template.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// Scheme+Template.swift
// ProjectDescriptionHelpers
//
// Created by 류희재 on 7/1/24.
//

import ProjectDescription
import EnvPlugin

extension Scheme {
/// Scheme 생성하는 method

static func makeScheme(configs: ConfigurationName, name: String) -> Scheme { // 일반앱
return Scheme(
name: name,
shared: true,
buildAction: .buildAction(targets: ["\(name)"]),
testAction: .targets(
["\(name)Tests"],
configuration: configs,
options: .options(coverage: true, codeCoverageTargets: ["\(name)"])
),
runAction: .runAction(configuration: configs),
archiveAction: .archiveAction(configuration: configs),
profileAction: .profileAction(configuration: configs),
analyzeAction: .analyzeAction(configuration: configs)
)
}

static func makeDemoScheme(configs: ConfigurationName, name: String) -> Scheme { // 데모앱
return Scheme(
name: "\(name)Demo",
shared: true,
buildAction: .buildAction(targets: ["\(name)Demo"]),
testAction: .targets(
["\(name)Tests"],
configuration: configs,
options: .options(coverage: true, codeCoverageTargets: ["\(name)Demo"])
),
runAction: .runAction(configuration: configs),
archiveAction: .archiveAction(configuration: configs),
profileAction: .profileAction(configuration: configs),
analyzeAction: .analyzeAction(configuration: configs)
)
}

static func makeDemoAppTestScheme() -> Scheme { // 데모테스트앱
let targetName = "\(Environment.workspaceName)-Demo"
return Scheme(
name: "\(targetName)-Test",
shared: true,
buildAction: .buildAction(targets: ["\(targetName)"]),
testAction: .targets(
["\(targetName)Tests"],
configuration: "Test",
options: .options(coverage: true, codeCoverageTargets: ["\(targetName)"])
),
runAction: .runAction(configuration: "Test"),
archiveAction: .archiveAction(configuration: "Test"),
profileAction: .profileAction(configuration: "Test"),
analyzeAction: .analyzeAction(configuration: "Test")
)
}
}


0 comments on commit 642b55f

Please sign in to comment.