From 23962ae793f5bed4515cae2d694b03d21b275096 Mon Sep 17 00:00:00 2001 From: HELLOHIDI Date: Mon, 1 Jul 2024 13:39:44 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20SourceFile+Template=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20=EC=88=98=EC=A0=95=20#18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Project+Templates.swift | 10 +++++----- .../SourceFiles+Template.swift | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 Tuist/ProjectDescriptionHelpers/SourceFiles+Template.swift diff --git a/Tuist/ProjectDescriptionHelpers/Project+Templates.swift b/Tuist/ProjectDescriptionHelpers/Project+Templates.swift index a928c18..9783782 100644 --- a/Tuist/ProjectDescriptionHelpers/Project+Templates.swift +++ b/Tuist/ProjectDescriptionHelpers/Project+Templates.swift @@ -38,7 +38,7 @@ public extension Project { deploymentTarget: deploymentTarget, //infoPlist에 .extendingDefault로 Info.plsit에 추가 내용을 넣어준 이유는 tuist에서 .default 만들어주는 Info.plist는 앱을 실행할 때 화면이 어딘가 나사가 빠진상태로 실행되기 때문입니다. infoPlist: .extendingDefault(with: infoPlist), - sources: ["Sources/**/*.swift"], + sources: .sources, // 터미널 명령어랑 비슷한듯? 일단 바쁘니까 나중에 정리해보도록 하자ㅏ https://www.daleseo.com/glob-patterns/#google_vignette resources: [.glob(pattern: "Resources/**", excluding: [])], //entitlement: 주로 iOS 애플리케이션에서 특정 기능이나 권한을 활성화하기 위해 사용하는 설정 파일 @@ -63,7 +63,7 @@ public extension Project { bundleId: "\(Environment.bundlePrefix).\(name)Interface", deploymentTarget: deploymentTarget, infoPlist: .default, - sources: ["Interface/Sources/**/*.swift"], + sources: .interface, dependencies: internalDependencies, settings: .settings(base: setting,configurations: XCConfig.framework) ) @@ -86,7 +86,7 @@ public extension Project { bundleId: "\(Environment.bundlePrefix).\(name)", deploymentTarget: deploymentTarget, infoPlist: .default, - sources: ["Sources/**/*.swift"], + sources: .sources, resources: hasResources ? [.glob(pattern: "Resources/**", excluding: [])] : [], dependencies: deps + internalDependencies + externalDependencies, settings: .settings(base: settings, configurations: XCConfig.framework) @@ -108,7 +108,7 @@ public extension Project { bundleId: "\(Environment.bundlePrefix).\(name)Demo", deploymentTarget: deploymentTarget, infoPlist: .extendingDefault(with: Project.demoInfoPlist), - sources: ["Demo/Sources/**/*.swift"], + sources: .demoSources, resources: [.glob(pattern: "Demo/Resources/**", excluding: ["Demo/Resources/dummy.txt"])], dependencies: deps, settings: .settings(base: setting, configurations: XCConfig.demo) @@ -128,7 +128,7 @@ public extension Project { bundleId: "\(Environment.bundlePrefix).\(name)Tests", deploymentTarget: deploymentTarget, infoPlist: .default, - sources: ["Tests/Sources/**/*.swift"], + sources: .unitTests, resources: [.glob(pattern: "Tests/Resources/**", excluding: [])], dependencies: deps, settings: .settings(base: SettingsDictionary().setCodeSignManual(), configurations: XCConfig.tests) diff --git a/Tuist/ProjectDescriptionHelpers/SourceFiles+Template.swift b/Tuist/ProjectDescriptionHelpers/SourceFiles+Template.swift new file mode 100644 index 0000000..3883cd8 --- /dev/null +++ b/Tuist/ProjectDescriptionHelpers/SourceFiles+Template.swift @@ -0,0 +1,17 @@ +// +// SourceFiles+Template.swift +// ProjectDescriptionHelpers +// +// Created by 류희재 on 7/1/24. +// + +import ProjectDescription + +public extension SourceFilesList { + static let demoSources: SourceFilesList = "Demo/Sources/**/*.swift" + static let interface: SourceFilesList = "Interface/Sources/**/*.swift" + static let sources: SourceFilesList = "Sources/**/*.swift" + static let testing: SourceFilesList = "Testing/**" + static let unitTests: SourceFilesList = "Tests/Sources/**/*.swift" + static let uiTests: SourceFilesList = "UITests/**" +}