-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π :: (#48) XCConfig μ€μ
- Loading branch information
Showing
50 changed files
with
669 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,3 +68,5 @@ Derived/ | |
|
||
### Tuist managed dependencies ### | ||
Tuist/Dependencies | ||
|
||
XCConfig/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ProjectDescription | ||
|
||
let plugin = Plugin(name: "ConfigurationPlugin") |
7 changes: 7 additions & 0 deletions
7
Plugins/ConfigurationPlugin/ProjectDescriptionHelpers/Configuration+Ext.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) } | ||
} |
7 changes: 7 additions & 0 deletions
7
Plugins/ConfigurationPlugin/ProjectDescriptionHelpers/Path+XCConfig.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
Plugins/ConfigurationPlugin/ProjectDescriptionHelpers/ProjectDeployTarget.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
Plugins/EnviromentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ProjectDescription | ||
|
||
let plugin = Plugin(name: "EnvironmentPlugin") |
21 changes: 21 additions & 0 deletions
21
Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/ProjectEnvironment.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [:] | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.