Skip to content

Commit 9e0c6cd

Browse files
committed
♻️ :: TargetDependency+Project.swift에 모듈 등록하는 자동화 과정 제거
1 parent 627eb0b commit 9e0c6cd

File tree

1 file changed

+9
-26
lines changed

1 file changed

+9
-26
lines changed

Scripts/GenerateModule.swift

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,12 @@ func registerModuleDependency() {
2626
registerModulePaths()
2727
makeProjectDirectory()
2828
registerXCConfig()
29-
registerMicroTarget(target: .sources)
3029
var targetString = "["
3130
if hasInterface {
32-
registerMicroTarget(target: .interface)
3331
makeScaffold(target: .interface)
3432
targetString += ".\(MicroTargetType.interface), "
3533
}
3634
if hasTesting {
37-
registerMicroTarget(target: .testing)
3835
makeScaffold(target: .testing)
3936
targetString += ".\(MicroTargetType.testing), "
4037
}
@@ -61,27 +58,12 @@ func registerModuleDependency() {
6158
func registerModulePaths() {
6259
updateFileContent(
6360
filePath: currentPath + "Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift",
64-
finding: "enum \(layer.rawValue): String {\n",
61+
finding: "enum \(layer.rawValue): String, MicroTargetPathConvertable {\n",
6562
inserting: " case \(moduleName)\n"
6663
)
6764
print("Register \(moduleName) to ModulePaths.swift")
6865
}
6966

70-
func registerMicroTarget(target: MicroTargetType) {
71-
let targetString = """
72-
static let \(moduleName)\(target.rawValue) = TargetDependency.project(
73-
target: ModulePaths.\(layer.rawValue).\(moduleName).targetName(type: .\(target)),
74-
path: .relativeTo\(layer.rawValue)(ModulePaths.\(layer.rawValue).\(moduleName).rawValue)
75-
)\n
76-
"""
77-
updateFileContent(
78-
filePath: currentPath + "Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+Target.swift",
79-
finding: "public extension TargetDependency.\(layer.rawValue) {\n",
80-
inserting: targetString
81-
)
82-
print("Register \(moduleName) \(target.rawValue) target to Dependency+Target.swift")
83-
}
84-
8567
func registerXCConfig() {
8668
makeDirectory(path: currentPath + "XCConfig/\(moduleName)")
8769
let xcconfigContent = "#include \"../Shared.xcconfig\""
@@ -220,18 +202,19 @@ print("This module has a 'Demo' Target? (y\\n, default = n)", terminator: " : ")
220202
let hasDemo = readLine()?.lowercased() == "y"
221203

222204
print("")
205+
print("""
206+
------------------------------------------------------------------------------------------------------------------------
207+
Layer: \(layer.rawValue)
208+
Module name: \(moduleName)
209+
interface: \(hasInterface), testing: \(hasTesting), unitTests: \(hasUnitTests), uiTests: \(hasUITests), demo: \(hasDemo)
210+
------------------------------------------------------------------------------------------------------------------------
211+
""")
212+
print("🔄 Module is creating ...")
223213

224214
registerModuleDependency()
225215

226-
print("")
227-
print("------------------------------------------------------------------------------------------------------------------------")
228-
print("Layer: \(layer.rawValue)")
229-
print("Module name: \(moduleName)")
230-
print("interface: \(hasInterface), testing: \(hasTesting), unitTests: \(hasUnitTests), uiTests: \(hasUITests), demo: \(hasDemo)")
231-
print("------------------------------------------------------------------------------------------------------------------------")
232216
print("✅ Module is created successfully!")
233217

234-
235218
// MARK: - Bash
236219
protocol CommandExecuting {
237220
func run(commandName: String, arguments: [String]) throws -> String

0 commit comments

Comments
 (0)