Skip to content

Commit

Permalink
[CAT-13] Tuist 개선 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
devMinseok authored Jul 18, 2024
1 parent 1155c29 commit 2f6ec99
Showing 17 changed files with 136 additions and 195 deletions.
2 changes: 1 addition & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[tools]
tuist = "4.18.0"
tuist = "4.21.1"
14 changes: 10 additions & 4 deletions DependencyGraph/graphMaker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
tuist graph PomoNyang -d -t -f dot
sed -i '' '/Example/d; /ThirdParty_/d' graph.dot
dot -Tpng graph.dot -o DependencyGraph/pomonyang_graph.png
TUIST_BUILD_CONFIG=prod tuist graph PomoNyang -d -t -f dot
sed -i '' '/ThirdParty_/d' graph.dot
dot -Tpng graph.dot -o DependencyGraph/pomonyang_prod_graph.png
rm graph.dot

open DependencyGraph/pomonyang_graph.png
TUIST_BUILD_CONFIG=dev tuist graph -d -f dot
sed -i '' '/ThirdParty_/d' graph.dot
dot -Tpng graph.dot -o DependencyGraph/pomonyang_dev_graph.png
rm graph.dot

open DependencyGraph/pomonyang_dev_graph.png
open DependencyGraph/pomonyang_prod_graph.png
Binary file added DependencyGraph/pomonyang_dev_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
### Tuist ###

.PHONY: manifests
manifests:
tuist edit

.PHONY: install
install:
carthage update --platform iOS --use-xcframeworks --use-netrc --cache-builds --verbose --project-directory "XCFramework/"
@@ -17,7 +21,7 @@ cache:
module:
tuist scaffold Framework --layer ${layer} --name ${name}

.PHONY: cleanj
.PHONY: clean
clean:
tuist clean
rm -rf XCFramework/Carthage
@@ -27,9 +31,14 @@ clean:

### SUGAR ###

.PHONY: pomonyang
pomonyang:
make generate config=${config} target="PomoNyang"
.PHONY: dev
dev:
make generate config=dev

.PHONY: prod
prod:
make generate config=prod


### Script ###

4 changes: 1 addition & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ import ProjectDescriptionHelpers

let packageSettings: PackageSettings = .init(
productTypes: [
"Moya": .framework,
"KakaoSDKCommon": .framework,
"KakaoSDKAuth": .framework,
// "KakaoSDKUser": .framework,
@@ -25,7 +24,6 @@ let package: Package = .init(
platforms: [.iOS(.v17)],
dependencies: [
.package(url: "https://github.com/pointfreeco/swift-composable-architecture.git", exact: "1.11.2"),
.package(url: "https://github.com/kakao/kakao-ios-sdk.git", exact: "2.22.0"),
.package(url: "https://github.com/Moya/Moya.git", exact: "15.0.3")
.package(url: "https://github.com/kakao/kakao-ios-sdk.git", exact: "2.22.0")
]
)
Original file line number Diff line number Diff line change
@@ -25,7 +25,4 @@ public extension DEP.SPMTarget {
static let KakaoSDKNavi: TargetDependency = .external(name: "KakaoSDKNavi")
static let KakaoSDKTemplate: TargetDependency = .external(name: "KakaoSDKTemplate")
static let KakaoAdSDK: TargetDependency = .external(name: "KakaoAdSDK")

// MARK: - Moya
static let Moya: TargetDependency = .external(name: "Moya")
}
Original file line number Diff line number Diff line change
@@ -16,14 +16,14 @@ extension TargetDependency {
/// ex) path: "Projects/Core/Logger", target: "LoggerInterface"
public static func dependency<T: Modulable>(module: T, target: TargetType = .sources) -> TargetDependency {
let moduleName = String(describing: module)
return .project(target: "\(moduleName)\(target.postfixName)", path: .relativeToRoot("Projects/\(module.path)"))
return .project(target: "\(moduleName)\(target.suffixName)", path: .relativeToRoot("Projects/\(module.path)"))
}

public enum TargetType: Hashable {
case sources
case interface

public var postfixName: String {
public var suffixName: String {
switch self {
case .sources:
return ""
2 changes: 1 addition & 1 deletion Projects/Core/APIClient/Project.swift
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ let project: Project = .project(
module: PomoNyang.Core.APIClient,
scripts: [],
targets: [
.sources(.staticLibrary),
.sources,
.interface,
.tests,
.testing
2 changes: 1 addition & 1 deletion Projects/Domain/AppService/Project.swift
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ let project: Project = .project(
module: PomoNyang.Domain.AppService,
scripts: [],
targets: [
.sources(.staticLibrary),
.sources,
.interface,
.tests,
.testing
2 changes: 1 addition & 1 deletion Projects/Domain/Model/Project.swift
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ let project: Project = .project(
module: PomoNyang.Domain.Model,
scripts: [],
targets: [
.sources(.staticLibrary),
.sources,
.interface,
.tests,
.testing
2 changes: 1 addition & 1 deletion Projects/Feature/AppFeature/Project.swift
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ let project: Project = .project(
module: PomoNyang.Feature.AppFeature,
scripts: [],
targets: [
.sources(.staticLibrary),
.sources,
.interface,
.tests,
.testing
3 changes: 2 additions & 1 deletion Projects/Shared/DesignSystem/Project.swift
Original file line number Diff line number Diff line change
@@ -6,9 +6,10 @@ import DependencyPlugin

let project: Project = .project(
module: PomoNyang.Shared.DesignSystem,
includeResource: true,
scripts: [],
targets: [
.sources(.staticFramework),
.sources,
.interface,
.tests,
.testing
2 changes: 1 addition & 1 deletion Projects/Shared/Utils/Project.swift
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ let project: Project = .project(
module: PomoNyang.Shared.Utils,
scripts: [],
targets: [
.sources(.staticLibrary),
.sources,
.interface,
.tests,
.testing
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -8,12 +8,14 @@
- ```mise install tuist``` (프로젝트 루트 경로에서)

### 프로젝트 생성
- 뽀모냥 앱 프로젝트 생성
- ```make pomonyang```
- conifg={configuration} 붙여서 빌드 환경 변경 (dev, prod)
- 예시: ```make pomonyang config=dev```
- 개발환경 생성
- ```make dev```
- 운영환경 생성
- ```make prod```

### Tuist
- Manifests 생성
- ```make manifests```
- 외부 라이브러리 구성
- ```make install```
- 프로젝트 변경 사항 반영 및 열기 (target: 타겟명)
@@ -31,5 +33,8 @@
- Xcode 파일 생성 템플릿 추가
- ```make template```

### 의존성 그래프 (테스트, 데모, 외부의존성 제외)
![PomoNyang](DependencyGraph/pomonyang_graph.png)
### 의존성 그래프 (외부의존성 제외)
- 운영 환경
![PomoNyang](DependencyGraph/pomonyang_prod_graph.png)
- 개발 환경
![PomoNyang](DependencyGraph/pomonyang_dev_graph.png)
41 changes: 0 additions & 41 deletions Tuist/ProjectDescriptionHelpers/Templates/Product+Extension.swift

This file was deleted.

Loading

0 comments on commit 2f6ec99

Please sign in to comment.