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

๐Ÿ”— :: (#48) XCConfig ์„ค์ • #89

Merged
merged 29 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
47d00ad
๐Ÿ“ :: gitignore ์— XCConfig ์ถ”๊ฐ€
HongSJae Dec 16, 2023
4e69aab
๐Ÿงฉ :: ConfigurationPlugin ์ถ”๊ฐ€
HongSJae Dec 16, 2023
dc222b2
๐Ÿงฉ :: App/Tests ์ถ”๊ฐ€
HongSJae Dec 16, 2023
f280164
๐Ÿงฉ :: Project Template ์ˆ˜์ •
HongSJae Dec 16, 2023
76e6bc0
๐Ÿ› ๏ธ :: Presentation์— ์žˆ๋Š” Resource ๋ชจ๋‘ DesignSystem์œผ๋กœ ์ด๋™
HongSJae Dec 16, 2023
c6a2b12
๐Ÿงฉ :: OnboardingImage
HongSJae Dec 16, 2023
1bb998d
๐Ÿงฉ :: JobisLottieView
HongSJae Dec 16, 2023
06b8146
๐Ÿ› ๏ธ :: ๋ณต์ˆ˜๋ช…์‚ฌ๋กœ ๋ณ€์ˆ˜๋ช… ์ˆ˜์ •
HongSJae Dec 16, 2023
ab2fbf3
๐Ÿงฉ :: Plugins ์— ConfigurationPlugin ์ถ”๊ฐ€
HongSJae Dec 16, 2023
e2e0eb4
๐Ÿงฉ :: OnboardingVC Designsystem ์‚ฌ์šฉ
HongSJae Dec 16, 2023
1b373eb
๐Ÿงฉ :: Presentation Resources ์ œ๊ฑฐ
HongSJae Dec 16, 2023
c93a89b
๐Ÿงฉ :: entitlements
HongSJae Dec 16, 2023
5abe577
๐Ÿ› ๏ธ :: JwtPlugin init ๋„ฃ์–ด์ฃผ๊ธฐ
HongSJae Dec 16, 2023
31c8cce
๐Ÿ› ๏ธ :: staticLibarary
HongSJae Dec 16, 2023
7b43dc6
๐Ÿงฉ :: Info.plist ์ˆ˜์ •
HongSJae Dec 16, 2023
15b55f3
Revert "๐Ÿงฉ :: Info.plist ์ˆ˜์ •"
HongSJae Dec 17, 2023
7414d5f
๐Ÿงฉ :: Info.plist ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์„ค์ •
HongSJae Dec 17, 2023
d1055d5
๐Ÿงฉ :: Project Template
HongSJae Dec 17, 2023
a2ce4d2
๐Ÿ› ๏ธ :: Lib Dependency baseSetting
HongSJae Dec 17, 2023
06f70f6
๐Ÿงฉ :: Sources/Resources Template
HongSJae Dec 17, 2023
b5a5707
๐Ÿงฉ :: DesignSystem Demo ์ถ”๊ฐ€
HongSJae Dec 17, 2023
21437b3
๐Ÿงฉ :: Presentation/AppNetwork/Flow/Domain/Data TargetTest ์ถ”๊ฐ€
HongSJae Dec 17, 2023
1170bed
๐Ÿงฉ :: CodeSign ์ถ”๊ฐ€
HongSJae Dec 17, 2023
39958c8
๐Ÿงฉ :: Product Project.swift ํŒŒ์ผ ์ˆ˜์ •
HongSJae Dec 17, 2023
f23acc2
๐Ÿ› ๏ธ :: Path XCConfig ํŒŒ์ผ return ์ง€์›€
HongSJae Dec 17, 2023
b9de78c
๐Ÿ› ๏ธ :: BASE_URL -> API_BASE_URL
HongSJae Dec 17, 2023
668134a
๐Ÿงฉ :: Graph update
HongSJae Dec 17, 2023
c296a82
โ™ป๏ธ :: CI Scripts ์ˆ˜์ •
HongSJae Dec 17, 2023
5033c78
Merge branch 'develop' into feature/(#48)-xcconfig_setting
HongSJae Dec 21, 2023
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,5 @@ Derived/

### Tuist managed dependencies ###
Tuist/Dependencies

XCConfig/
3 changes: 3 additions & 0 deletions Plugins/ConfigurationPlugin/Plugin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ProjectDescription

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

public extension ConfigurationName {
static var dev: ConfigurationName { configuration(ProjectDeployTarget.dev.rawValue) }
static var stage: ConfigurationName { configuration(ProjectDeployTarget.stage.rawValue) }
static var prod: ConfigurationName { configuration(ProjectDeployTarget.prod.rawValue) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ProjectDescription

public extension ProjectDescription.Path {
static func relativeToXCConfig(type: ProjectDeployTarget, name: String) -> Self {
.relativeToRoot("XCConfig/\(name)/\(type.rawValue).xcconfig")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Foundation
import ProjectDescription

public enum ProjectDeployTarget: String {
case dev = "DEV"
case stage = "STAGE"
case prod = "PROD"

public var configurationName: ConfigurationName {
ConfigurationName.configuration(self.rawValue)
}
}
3 changes: 0 additions & 3 deletions Plugins/EnviromentPlugin/Plugin.swift

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions Plugins/EnvironmentPlugin/Plugin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ProjectDescription

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

public struct ProjectEnvironment {
public let appName: String
public let targetName: String
public let targetTestName: String
public let organizationName: String
public let deploymentTarget: DeploymentTarget
public let platform: Platform
public let baseSetting: SettingsDictionary
}

public let env = ProjectEnvironment(
appName: "JOBIS-DSM-iOS-v2",
targetName: "JOBIS-DSM-iOS-v2",
targetTestName: "DSM-JOBISTests",
organizationName: "com.team.return",
deploymentTarget: .iOS(targetVersion: "15.0", devices: [.iphone, .ipad]),
platform: .iOS,
baseSetting: [:]
)
10 changes: 0 additions & 10 deletions Projects/App/JOBIS-DSM-iOS-v2Debug.entitlements

This file was deleted.

107 changes: 97 additions & 10 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,101 @@
import ProjectDescription
import ProjectDescriptionHelpers
import ProjectDescription
import DependencyPlugin
import EnvironmentPlugin
import ConfigurationPlugin
import Foundation

let isCI: Bool = (ProcessInfo.processInfo.environment["TUIST_CI"] ?? "0") == "1"

let configurations: [Configuration] = [
.debug(name: .dev, xcconfig: .relativeToXCConfig(type: .dev, name: env.targetName)),
.debug(name: .stage, xcconfig: .relativeToXCConfig(type: .stage, name: env.targetName)),
.release(name: .prod, xcconfig: .relativeToXCConfig(type: .prod, name: env.targetName))
]

let settings: Settings = .settings(
base: env.baseSetting,
configurations: configurations,
defaultSettings: .recommended
)

let scripts: [TargetScript] = isCI ? [] : [.swiftLint]

let targets: [Target] = [
.init(
name: env.targetName,
platform: env.platform,
product: .app,
bundleId: "$(APP_BUNDLE_ID)",
deploymentTarget: env.deploymentTarget,
infoPlist: .file(path: "Support/Info.plist"),
sources: .sources,
resources: .resources,
entitlements: "Support/\(env.appName).entitlements",
scripts: scripts,
dependencies: [
.Projects.flow
],
settings: .settings(base: env.baseSetting)
),
.init(
name: env.targetTestName,
platform: .iOS,
product: .unitTests,
bundleId: "\(env.organizationName).\(env.targetName)Tests",
deploymentTarget: env.deploymentTarget,
infoPlist: .default,
sources: .unitTests,
dependencies: [
.target(name: env.targetName)
]
)
]

let schemes: [Scheme] = [
.init(
name: "\(env.targetName)-DEV",
shared: true,
buildAction: .buildAction(targets: ["\(env.targetName)"]),
testAction: TestAction.targets(
["\(env.targetTestName)"],
configuration: .dev,
options: TestActionOptions.options(
coverage: true,
codeCoverageTargets: ["\(env.targetName)"]
)
),
runAction: .runAction(configuration: .dev),
archiveAction: .archiveAction(configuration: .dev),
profileAction: .profileAction(configuration: .dev),
analyzeAction: .analyzeAction(configuration: .dev)
),
.init(
name: "\(env.targetName)-PROD",
shared: true,
buildAction: BuildAction(targets: ["\(env.targetName)"]),
testAction: nil,
runAction: .runAction(configuration: .prod),
archiveAction: .archiveAction(configuration: .prod),
profileAction: .profileAction(configuration: .prod),
analyzeAction: .analyzeAction(configuration: .prod)
),
.init(
name: "\(env.targetName)-STAGE",
shared: true,
buildAction: BuildAction(targets: ["\(env.targetName)"]),
testAction: nil,
runAction: .runAction(configuration: .stage),
archiveAction: .archiveAction(configuration: .stage),
profileAction: .profileAction(configuration: .stage),
analyzeAction: .analyzeAction(configuration: .stage)
)
]

let project = Project.makeModule(
name: "JOBIS-DSM-iOS-v2",
platform: .iOS,
product: .app,
dependencies: [
.Projects.flow
],
resources: ["Resources/**"],
infoPlist: .file(path: "Support/Info.plist")
let project = Project(
name: env.targetName,
organizationName: env.organizationName,
settings: settings,
targets: targets,
schemes: schemes
)
10 changes: 7 additions & 3 deletions Projects/App/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
<dict>
<key>AppIdentifierPrefix</key>
<string>$(AppIdentifierPrefix)</string>
<key>BASE_URL</key>
<string>https://dev-server.team-return.com</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>API_BASE_URL</key>
<string>$(API_BASE_URL)</string>
<key>S3_BASE_URL</key>
<string>$(S3_BASE_URL)</string>
<key>CFBundleDisplayName</key>
<string>$(BUNDLE_DISPLAY_NAME)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand All @@ -27,7 +31,7 @@
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
Expand Down
17 changes: 17 additions & 0 deletions Projects/App/Tests/TargetTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import XCTest

final class TargetTests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
XCTAssertEqual(1, 1)
}

}
3 changes: 2 additions & 1 deletion Projects/Core/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import DependencyPlugin

let project = Project.makeModule(
name: "Core",
product: .staticFramework,
product: .framework,
targets: [.unitTest],
dependencies: [
.Modules.thirdPartyLib
]
Expand Down
17 changes: 17 additions & 0 deletions Projects/Core/Tests/TargetTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import XCTest

final class TargetTests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
XCTAssertEqual(1, 1)
}

}
1 change: 1 addition & 0 deletions Projects/Data/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import DependencyPlugin
let project = Project.makeModule(
name: "Data",
product: .staticFramework,
targets: [.unitTest],
dependencies: [
.Projects.domain,
.Modules.appNetwork
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class RemoteBaseDataSource<API: JobisAPI> {
#if DEBUG
self.provider = MoyaProvider<API>(plugins: [JwtPlugin(keychain: keychain), MoyaLogginPlugin()])
#else
self.provider = MoyaProvider<API>(plugins: [JwtPlugin()])
self.provider = MoyaProvider<API>(plugins: [JwtPlugin(keychain: keychain)])
#endif
}

Expand Down
17 changes: 17 additions & 0 deletions Projects/Data/Tests/TargetTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import XCTest

final class TargetTests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
XCTAssertEqual(1, 1)
}

}
1 change: 1 addition & 0 deletions Projects/Domain/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import DependencyPlugin
let project = Project.makeModule(
name: "Domain",
product: .staticFramework,
targets: [.unitTest],
dependencies: [
.Projects.core
]
Expand Down
17 changes: 17 additions & 0 deletions Projects/Domain/Tests/TargetTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import XCTest

final class TargetTests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
XCTAssertEqual(1, 1)
}

}
3 changes: 2 additions & 1 deletion Projects/Flow/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import DependencyPlugin

let project = Project.makeModule(
name: "Flow",
product: .staticFramework,
product: .staticLibrary,
targets: [.unitTest],
dependencies: [
.Projects.data,
.Projects.presentation
Expand Down
17 changes: 17 additions & 0 deletions Projects/Flow/Tests/TargetTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import XCTest

final class TargetTests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
XCTAssertEqual(1, 1)
}

}
3 changes: 2 additions & 1 deletion Projects/Modules/AppNetwork/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import DependencyPlugin

let project = Project.makeModule(
name: "AppNetwork",
product: .staticFramework,
product: .framework,
targets: [.unitTest],
dependencies: [
.Projects.core
]
Expand Down
2 changes: 1 addition & 1 deletion Projects/Modules/AppNetwork/Sources/JobisAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public protocol JobisAPI: TargetType, JwtAuthorizable {
public extension JobisAPI {
var baseURL: URL {
URL(
string: Bundle.main.object(forInfoDictionaryKey: "BASE_URL") as? String ?? ""
string: Bundle.main.object(forInfoDictionaryKey: "API_BASE_URL") as? String ?? ""
) ?? URL(string: "https://www.google.com")!
}

Expand Down
Loading
Loading