Skip to content

Commit

Permalink
πŸ—:: #1 ν•„μš”μ—†λŠ” make 파일 μ‚­μ œ
Browse files Browse the repository at this point in the history
  • Loading branch information
jjunhaa0211 committed Nov 3, 2023
1 parent cbaa443 commit 0a3adaa
Showing 1 changed file with 41 additions and 54 deletions.
95 changes: 41 additions & 54 deletions Tuist/ProjectDescriptionHelpers/Project+Templates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public extension Project {
internalDependencies: [TargetDependency] = [], // λͺ¨λ“ˆκ°„ μ˜μ‘΄μ„±
externalDependencies: [TargetDependency] = [], // μ™ΈλΆ€ 라이브러리 μ˜μ‘΄μ„±
interfaceDependencies: [TargetDependency] = [], // Feature Interface μ˜μ‘΄μ„±
dependencies: [TargetDependency] = [],
hasResources: Bool = false
) -> Project {

Expand All @@ -22,10 +21,7 @@ public extension Project {
let baseSettings: SettingsDictionary = .baseSettings.setCodeSignManual()

var projectTargets: [Target] = []
var schemes: [Scheme] = []

// MARK: - App


if targets.contains(.app) {
let bundleSuffix = name.contains("Demo") ? "test" : "release"
let infoPlist = name.contains("Demo") ? Project.demoInfoPlist : Project.appInfoPlist
Expand All @@ -49,9 +45,7 @@ public extension Project {

projectTargets.append(target)
}

// MARK: - Feature Interface


if targets.contains(.interface) {
let settings = baseSettings

Expand All @@ -69,9 +63,7 @@ public extension Project {

projectTargets.append(target)
}

// MARK: - Framework


if targets.contains(where: { $0.hasFramework }) {
let deps: [TargetDependency] = targets.contains(.interface)
? [.target(name: "\(name)Interface")]
Expand All @@ -94,7 +86,6 @@ public extension Project {
projectTargets.append(target)
}

// MARK: - Feature Executable

if targets.contains(.demo) {
let deps: [TargetDependency] = [.target(name: name)]
Expand All @@ -117,7 +108,6 @@ public extension Project {
projectTargets.append(target)
}

// MARK: - Unit Tests

if targets.contains(.unitTest) {
let deps: [TargetDependency] = [.target(name: name)]
Expand All @@ -143,7 +133,6 @@ public extension Project {
projectTargets.append(target)
}

// MARK: - UI Tests

if targets.contains(.uiTest) {
let deps: [TargetDependency] = targets.contains(.demo)
Expand All @@ -168,9 +157,7 @@ public extension Project {

projectTargets.append(target)
}

// MARK: - Schemes


return Project(
name: name,
organizationName: Environment.workspaceName,
Expand All @@ -179,40 +166,40 @@ 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)
)
}
}
//
//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)
// )
// }
//}

0 comments on commit 0a3adaa

Please sign in to comment.