Skip to content

Commit

Permalink
🔥 :: XCConfig ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
uuuunseo committed Aug 21, 2024
1 parent 83995e3 commit 1119ecd
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 57 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,8 @@ graph.dot
Derived/

### Tuist managed dependencies ###
Tuist/.build
Tuist/.build

XCConfig/*
XCConfig.zip
!XCConfig/Shared.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation

// swiftlint: disable all
public enum ModulePaths {
case feature(Feature)
case domain(Domain)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public extension TargetDependency {
static func core(name: String) -> Self {
return .project(target: name, path: .relativeToCore(name))
}
static func shated(name: String) -> Self {
static func shared(name: String) -> Self {
return .project(target: name, path: .relativeToShared(name))
}
static func userInterface(name: String) -> Self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public extension TargetDependency {
path: .relativeToDomain(target.rawValue)
)
}

static func core(
target: ModulePaths.Core,
type: ModularTargetType = .sources
Expand All @@ -31,7 +31,7 @@ public extension TargetDependency {
path: .relativeToCore(target.rawValue)
)
}

static func shared(
target: ModulePaths.Shared,
type: ModularTargetType = .sources
Expand All @@ -41,7 +41,7 @@ public extension TargetDependency {
path: .relativeToShared(target.rawValue)
)
}

static func userInterface(
target: ModulePaths.UserInterface,
type: ModularTargetType = .sources
Expand Down
24 changes: 12 additions & 12 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import Foundation
import ProjectDescription
import ProjectDescriptionHelpers

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

let settings: Settings = .settings(
base: env.baseSetting,
Expand All @@ -32,11 +38,9 @@ let targets: [Target] = [
+ [
.core(target: .Networking),
.target(name: "\(env.name)Widget"),
.target(name: "\(env.name)WatchApp")
],
settings: .settings(
base: env.baseSetting
)
.target(name: "\(env.name)WatchApp"),
],
settings: settings
),
.target(
name: "\(env.name)Widget",
Expand All @@ -52,9 +56,7 @@ let targets: [Target] = [
dependencies: [
.userInterface(target: .DesignSystem)
],
settings: .settings(
base: env.baseSetting
)
settings: settings
),
.target(
name: "\(env.name)WatchApp",
Expand All @@ -69,9 +71,7 @@ let targets: [Target] = [
dependencies: [
.userInterface(target: .DesignSystem)
],
settings: .settings(
base: env.baseSetting
)
settings: settings
)
]

Expand Down
5 changes: 1 addition & 4 deletions Projects/Domain/BaseDomain/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ let project = Project.module(
.implements(
module: .domain(.BaseDomain),
dependencies: [
.domain(target: .BaseDomain, type: .interface),
.core(target: .Networking, type: .interface),
.shared(target: .GlobalThirdPartyLibrary)
.domain(target: .BaseDomain, type: .interface)
]
),
.tests(module: .domain(.BaseDomain), dependencies: [
.domain(target: .BaseDomain)
])
]
)
16 changes: 7 additions & 9 deletions Projects/Feature/BaseFeature/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import ProjectDescriptionHelpers
let project = Project.module(
name: ModulePaths.Feature.BaseFeature.rawValue,
targets: [
.interface(module: .feature(.BaseFeature), dependencies: [

]),
.implements(module: .feature(.BaseFeature), product: .framework, dependencies: [
.feature(target: .BaseFeature, type: .interface)
]),
.tests(module: .feature(.BaseFeature), dependencies: [
.feature(target: .BaseFeature)
])
.implements(
module: .feature(.BaseFeature),
product: .framework,
dependencies: [
.userInterface(target: .DesignSystem)
]
)
]
)
3 changes: 2 additions & 1 deletion Tuist/ProjectDescriptionHelpers/Action/Action+Templete.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ProjectDescription
public extension TargetScript {
static let swiftLint = TargetScript.pre(
path: Path.relativeToRoot("Scripts/SwiftLintRunScript.sh"),
name: "SwiftLint"
name: "SwiftLint",
basedOnDependencyAnalysis: false
)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ProjectDescription
import Foundation

protocol Configurable {
func with(_ block: (inout Self) throws -> Void) rethrows -> Self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public extension Project {
settings: settings,
targets: targets,
schemes: targets.contains { $0.product == .app } ?
[.makeScheme(target: .dev, name: name), .makeScheme(target: .dev, name: name)] :
[.makeScheme(target: .dev, name: name), .makeExampleScheme(target: .dev, name: name)] :
[.makeScheme(target: .dev, name: name)],
fileHeaderTemplate: fileHeaderTemplate,
additionalFiles: additionalFiles,
Expand Down
15 changes: 8 additions & 7 deletions Tuist/ProjectDescriptionHelpers/Project/Project+makeModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public extension Project {
) -> Project {
let scripts: [TargetScript] = generateEnvironment.scripts
let ldFlagsSettings: SettingsDictionary = product == .framework ?
["OTHER_LDFLAGS": .string("$(inherited) --all_load")] :
["OTHER_LDFLAGS": .string("$(inherited")]
["OTHER_LDFLAGS": .string("$(inherited) -all_load")] :
["OTHER_LDFLAGS": .string("$(inherited)")]

var configurations = configurations
if configurations.isEmpty {
Expand All @@ -49,7 +49,8 @@ public extension Project {

let settings: Settings = .settings(
base: env.baseSetting
.merging(settings),
.merging(settings)
.merging(ldFlagsSettings),
configurations: configurations,
defaultSettings: .recommended
)
Expand All @@ -69,7 +70,7 @@ public extension Project {
infoPlist: .default,
sources: .interface,
scripts: scripts,
dependencies: internalDependencies,
dependencies: interfaceDependencies,
additionalFiles: additionalFiles
)
)
Expand All @@ -95,7 +96,7 @@ public extension Project {
if targets.contains(.testing) && targets.contains(.interface) {
allTargets.append(
Target.target(
name: name,
name: "\(name)Testing",
destinations: destinations,
product: .framework,
bundleId: "\(env.organizationName).\(name)Testing",
Expand Down Expand Up @@ -171,7 +172,7 @@ public extension Project {
"UILaunchStoryboardName": "LaunchScreen",
"ENABLE_TESTS": .boolean(true),
]),
sources: .exampleSource,
sources: .exampleSources,
resources: ["Example/Resources/**"],
scripts: scripts,
dependencies: exampleDependencies
Expand All @@ -182,7 +183,7 @@ public extension Project {
let schemes: [Scheme] = targets.contains(.example) ?
[.makeScheme(target: .dev, name: name), .makeExampleScheme(target: .dev, name: name)] :
[.makeScheme(target: .dev, name: name)]

return Project(
name: name,
organizationName: env.organizationName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ProjectDescription

public extension SettingsDictionary {
static let ldFlages: SettingsDictionary = [
"OTHER_LDFLAGS": .string("$(inherited")
"OTHER_LDFLAGS": .string("$(inherited)")
]

static let allLoadLDFlages: SettingsDictionary = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ProjectDescription

public extension SourceFilesList {
static let exampleSource: SourceFilesList = "Example/Sources/**"
static let exampleSources: SourceFilesList = "Example/Sources/**"
static let interface: SourceFilesList = "Interface/**"
static let sources: SourceFilesList = "Sources/**"
static let testing: SourceFilesList = "Testing/**"
Expand Down
18 changes: 9 additions & 9 deletions Tuist/ProjectDescriptionHelpers/Target/Target+Modular.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ public extension Target {
}
.toTarget(with: module.targetName(type: .interface), product: .framework)
}

static func interface(module: ModulePaths, dependencies: [TargetDependency] = []) -> Target {
TargetSpec(sources: .interface, dependencies: dependencies)
.toTarget(with: module.targetName(type: .interface), product: .framework)
}

static func interface(name: String, spec: TargetSpec) -> Target {
spec.with {
$0.sources = .interface
}
.toTarget(with: "\(name)Interface", product: .framework)
}

static func interface(name: String, dependencies: [TargetDependency] = []) -> Target {
TargetSpec(sources: .interface, dependencies: dependencies)
.toTarget(with: "\(name)Interface", product: .framework)
}
}

// MARK: - Implements
// MARK: Implements
public extension Target {
static func implements(
module: ModulePaths,
Expand Down Expand Up @@ -73,7 +73,7 @@ public extension Target {
}
}

// MARK: - Testing
// MARK: Testing
public extension Target {
static func testing(module: ModulePaths, spec: TargetSpec) -> Target {
spec.with {
Expand Down Expand Up @@ -131,7 +131,7 @@ public extension Target {
public extension Target {
static func example(module: ModulePaths, spec: TargetSpec) -> Target {
spec.with {
$0.sources = .exampleSource
$0.sources = .exampleSources
$0.settings = .settings(
base: spec.settings?.base ?? [:],
configurations: .default,
Expand All @@ -154,15 +154,15 @@ public extension Target {
"UILaunchStoryboardName": "LaunchScreen",
"ENABLE_TESTS": .boolean(true),
]),
sources: .exampleSource,
sources: .exampleSources,
dependencies: dependencies
)
.toTarget(with: module.targetName(type: .example), product: .app)
}

static func example(name: String, spec: TargetSpec) -> Target {
spec.with {
$0.sources = .exampleSource
$0.sources = .exampleSources
$0.settings = .settings(
base: spec.settings?.base ?? [:],
configurations: .default,
Expand All @@ -185,7 +185,7 @@ public extension Target {
"UILaunchStoryboardName": "LaunchScreen",
"ENABLE_TESTS": .boolean(true),
]),
sources: .exampleSource,
sources: .exampleSources,
dependencies: dependencies
)
.toTarget(with: "\(name)Example", product: .app)
Expand Down
1 change: 0 additions & 1 deletion XCConfig/App/DEV.xcconfig

This file was deleted.

1 change: 0 additions & 1 deletion XCConfig/App/PROD.xcconfig

This file was deleted.

1 change: 0 additions & 1 deletion XCConfig/App/STAGE.xcconfig

This file was deleted.

1 change: 0 additions & 1 deletion XCConfig/Networking/DEV.xcconfig

This file was deleted.

1 change: 0 additions & 1 deletion XCConfig/Networking/PROD.xcconfig

This file was deleted.

1 change: 0 additions & 1 deletion XCConfig/Networking/STAGE.xcconfig

This file was deleted.

0 comments on commit 1119ecd

Please sign in to comment.