Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] #121 - Tuist로 모듈 분리하기 #125

Merged
merged 9 commits into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified DependencyGraphs/AllGraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified DependencyGraphs/AppGraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified DependencyGraphs/TestGraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions SOPT-Stamp-iOS/Plugins/DependencyPlugin/Plugin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ProjectDescription

let dependencyPlugin = Plugin(name: "DependencyPlugin")
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
//
// Dependency+Project.swift
// ProjectDescriptionHelpers
//
// Created by sejin on 2022/10/02.
//

import ProjectDescription

public extension Dep {
struct Features {
public struct Main {}
public struct Spalsh {}
public struct Onboarding {}
public struct Auth {}
public struct Setting {}
public struct Stamp {}
public struct Attendance {}
public struct Notice {}
}

struct Modules {}
}

// MARK: - Root

public extension Dep {
static let data = Dep.project(target: "Data", path: .data)

static let domain = Dep.project(target: "Domain", path: .domain)

static let core = Dep.project(target: "Core", path: .core)
}

// MARK: - Modules

public extension Dep.Modules {
static let dsKit = Dep.project(target: "DSKit", path: .relativeToModules("DSKit"))

static let network = Dep.project(target: "Network", path: .relativeToModules("Network"))

static let thirdPartyLibs = Dep.project(target: "ThirdPartyLibs", path: .relativeToModules("ThirdPartyLibs"))
}

// MARK: - Features

public extension Dep.Features {
static func project(name: String, group: String) -> Dep { .project(target: "\(group)\(name)", path: .relativeToFeature("\(group)\(name)")) }

static let BaseFeatureDependency = TargetDependency.project(target: "BaseFeatureDependency", path: .relativeToFeature("BaseFeatureDependency"))

static let RootFeature = TargetDependency.project(target: "RootFeature", path: .relativeToFeature("RootFeature"))
}

public extension Dep.Features.Main {
static let group = "Main"

static let Feature = Dep.Features.project(name: "Feature", group: group)
static let Interface = Dep.project(target: "\(group)FeatureInterface", path: .relativeToFeature("\(group)Feature"))
}

public extension Dep.Features.Spalsh {
static let group = "Splash"

static let Feature = Dep.Features.project(name: "Feature", group: group)
static let Interface = Dep.project(target: "\(group)FeatureInterface", path: .relativeToFeature("\(group)Feature"))
}

public extension Dep.Features.Onboarding {
static let group = "Onboarding"

static let Feature = Dep.Features.project(name: "Feature", group: group)
static let Interface = Dep.project(target: "\(group)FeatureInterface", path: .relativeToFeature("\(group)Feature"))
}

public extension Dep.Features.Auth {
static let group = "Auth"

static let Feature = Dep.Features.project(name: "Feature", group: group)
static let Interface = Dep.project(target: "\(group)FeatureInterface", path: .relativeToFeature("\(group)Feature"))
}

public extension Dep.Features.Stamp {
static let group = "Stamp"

static let Feature = Dep.Features.project(name: "Feature", group: group)
static let Interface = Dep.project(target: "\(group)FeatureInterface", path: .relativeToFeature("\(group)Feature"))
}

public extension Dep.Features.Setting {
static let group = "Setting"

static let Feature = Dep.Features.project(name: "Feature", group: group)
static let Interface = Dep.project(target: "\(group)FeatureInterface", path: .relativeToFeature("\(group)Feature"))
}

public extension Dep.Features.Attendance {
static let group = "Attendance"

static let Feature = Dep.Features.project(name: "Feature", group: group)
static let Interface = Dep.project(target: "\(group)FeatureInterface", path: .relativeToFeature("\(group)Feature"))
}

public extension Dep.Features.Notice {
static let group = "Notice"

static let Feature = Dep.Features.project(name: "Feature", group: group)
static let Interface = Dep.project(target: "\(group)FeatureInterface", path: .relativeToFeature("\(group)Feature"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public extension TargetDependency.SPM {
static let Kingfisher = TargetDependency.external(name: "Kingfisher")
static let Moya = TargetDependency.external(name: "Moya")
static let CombineMoya = TargetDependency.external(name: "CombineMoya")
static let FLEX = TargetDependency.external(name: "FLEX")
static let Nimble = TargetDependency.external(name: "Nimble")
static let Quick = TargetDependency.external(name: "Quick")
static let lottie = TargetDependency.external(name: "Lottie")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Foundation
import ProjectDescription

public typealias Dep = TargetDependency
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import ProjectDescription

public extension ProjectDescription.Path {
static func relativeToFeature(_ path: String) -> Self {
return .relativeToRoot("Projects/Features/\(path)")
}

static func relativeToModules(_ path: String) -> Self {
return .relativeToRoot("Projects/Modules/\(path)")
}

static var app: Self {
return .relativeToRoot("Projects/App")
}

static var data: Self {
return .relativeToRoot("Projects/Data")
}

static var domain: Self {
return .relativeToRoot("Projects/Domain")
}

static var core: Self {
return .relativeToRoot("Projects/Core")
}
}
3 changes: 3 additions & 0 deletions SOPT-Stamp-iOS/Plugins/EnvPlugin/Plugin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ProjectDescription

let EnvPlugin = Plugin(name: "EnvPlugin")
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import ProjectDescription

public enum Environment {
public static let workspaceName = "SOPT-iOS"
}

public extension Project {
enum Environment {
public static let workspaceName = "SOPT-iOS"
public static let deploymentTarget = DeploymentTarget.iOS(targetVersion: "16.0", devices: [.iphone])
public static let platform = Platform.iOS
public static let bundlePrefix = "com.sopt-stamp-iOS"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 sopt-stamp로 되어있는 부분 sopt-ios로 다같이 바꾸는 작업도 여기서 하면 좋을거같은데 어떻게 생각하시나요~?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lsj8706
com.sopt-iOS 로 번들 아이디 바꿔둬도 될까요 ? ?

}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ProjectDescription

public extension Project {
static let baseinfoPlist: [String: InfoPlist.Value] = [
static let appInfoPlist: [String: InfoPlist.Value] = [
"CFBundleShortVersionString": "1.0.0",
"CFBundleDevelopmentRegion": "ko",
"CFBundleVersion": "1",
Expand Down Expand Up @@ -37,4 +37,11 @@ public extension Project {
"UIUserInterfaceStyle": "Light",
"NSPhotoLibraryUsageDescription": "미션과 관련된 사진을 업로드하기 위해 갤러리 권한이 필요합니다."
]

static let demoInfoPlist: [String: InfoPlist.Value] = [
"UIMainStoryboardFile": "",
"UILaunchStoryboardName": "LaunchScreen",
"LSSupportsOpeningDocumentsInPlace": true,
"UIFileSharingEnabled": true,
]
}
3 changes: 0 additions & 3 deletions SOPT-Stamp-iOS/Plugins/UtilityPlugin/Plugin.swift

This file was deleted.

This file was deleted.

8 changes: 4 additions & 4 deletions SOPT-Stamp-iOS/Projects/Core/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import ProjectDescription
import ProjectDescriptionHelpers
import UtilityPlugin
import DependencyPlugin

let project = Project.makeModule(
name: "Core",
product: .staticFramework,
dependencies: [
.Project.ThirdPartyLib
targets: [.unitTest, .dynamicFramework, .demo],
internalDependencies: [
.Modules.thirdPartyLibs
]
)
15 changes: 15 additions & 0 deletions SOPT-Stamp-iOS/Projects/Core/Sources/Enum/AlertType.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// AlertType.swift
// Core
//
// Created by 김영인 on 2023/03/18.
// Copyright © 2023 SOPT-iOS. All rights reserved.
//

import Foundation

public enum AlertType {
case title
case titleDescription
case networkErr
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// ListDetailSceneType.swift
// Core
//
// Created by 김영인 on 2023/03/17.
// Copyright © 2023 SOPT-iOS. All rights reserved.
//

@frozen
public enum ListDetailSceneType {
case none // 작성 전
case completed // 작성 완료
case edit // 수정
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// MissionListSceneType.swift
// Core
//
// Created by 김영인 on 2023/03/17.
// Copyright © 2023 SOPT-iOS. All rights reserved.
//

@frozen
public enum MissionListSceneType {
case `default`
case ranking(userName: String, sentence: String, userId: Int)

var isRankingView: Bool {
switch self {
case .default: return false
case .ranking: return true
}
}
}
14 changes: 14 additions & 0 deletions SOPT-Stamp-iOS/Projects/Core/Sources/Enum/NoticePopUpType.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// NoticePopUpType.swift
// Core
//
// Created by 김영인 on 2023/03/17.
// Copyright © 2023 SOPT-iOS. All rights reserved.
//

import Foundation

public enum NoticePopUpType {
case forceUpdate
case recommendUpdate
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// SignUpFormValidateResult.swift
// Core
//
// Created by 김영인 on 2023/03/18.
// Copyright © 2023 SOPT-iOS. All rights reserved.
//

import Foundation

public enum SignUpFormValidateResult {
case valid(text: String)
case invalid(text: String)
}
1 change: 1 addition & 0 deletions SOPT-Stamp-iOS/Projects/Core/Tests/Resources/dummy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dummy
12 changes: 6 additions & 6 deletions SOPT-Stamp-iOS/Projects/Data/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

import ProjectDescription
import ProjectDescriptionHelpers
import DependencyPlugin

let project = Project.makeModule(
name: "Data",
product: .staticFramework,
dependencies: [
.Project.Network,
.Project.Domain
],
hasTest: true
targets: [.unitTest, .dynamicFramework],
internalDependencies: [
.domain,
.Modules.network
]
)
1 change: 1 addition & 0 deletions SOPT-Stamp-iOS/Projects/Data/Tests/Resources/dummy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dummy
6 changes: 0 additions & 6 deletions SOPT-Stamp-iOS/Projects/Data/Tests/SampleTests.swift

This file was deleted.

22 changes: 0 additions & 22 deletions SOPT-Stamp-iOS/Projects/Demo/SOPT-Stamp-Demo/Project.swift

This file was deleted.

Loading