Skip to content

Commit

Permalink
Create new module target extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Arclite committed May 9, 2024
1 parent fbb0b46 commit 3b803ee
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
23 changes: 22 additions & 1 deletion Tuist/ProjectDescriptionHelpers/TargetExtensions.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
import ProjectDescription

extension Target {
static func moduleTestTarget(name: String, type: String = "Capabilities", dependencies: [ProjectDescription.TargetDependency] = []) -> Target {
static func capabilitiesTarget(
name: String,
dependencies: [TargetDependency] = []
) -> Target {
Target.target(
name: name,
destinations: [.iPhone, .iPad, .macCatalyst, .appleVisionWithiPadDesign],
product: .framework,
bundleId: "com.cocoatype.Highlighter.\(name)",
sources: ["Modules/Capabilities/\(name)/Sources/**"],
dependencies: dependencies
)
}

static func capabilitiesTestTarget(
name: String,
dependencies: [TargetDependency] = []
) -> Target {
moduleTestTarget(name: name, type: "Capabilities", dependencies: [])
}

static func moduleTestTarget(name: String, type: String, dependencies: [TargetDependency] = []) -> Target {
return Target.target(
name: "\(name)Tests",
destinations: [.iPhone, .iPad, .macCatalyst, .appleVisionWithiPadDesign],
Expand Down
2 changes: 1 addition & 1 deletion Tuist/ProjectDescriptionHelpers/Targets/AppRatings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public enum AppRatings {
]
)

public static let testTarget = Target.moduleTestTarget(name: "AppRatings", dependencies: [
public static let testTarget = Target.capabilitiesTestTarget(name: "AppRatings", dependencies: [
.target(Defaults.target),
.target(Editing.target),
.target(TestHelpers.target),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ public enum AutoRedactionsUI {
]
)

public static let testTarget = Target.moduleTestTarget(name: "AutoRedactionsUI")
public static let testTarget = Target.capabilitiesTestTarget(name: "AutoRedactionsUI")
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ public enum ErrorHandling {
]
)

public static let testTarget = Target.moduleTestTarget(name: "ErrorHandling")
public static let testTarget = Target.capabilitiesTestTarget(name: "ErrorHandling")
}
2 changes: 1 addition & 1 deletion Tuist/ProjectDescriptionHelpers/Targets/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ public enum Logging {
]
)

public static let testTarget = Target.moduleTestTarget(name: "Logging")
public static let testTarget = Target.capabilitiesTestTarget(name: "Logging")
}
2 changes: 1 addition & 1 deletion Tuist/ProjectDescriptionHelpers/Targets/Redacting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import ProjectDescription

public struct Redacting {
public enum Redacting {
public static let target = Target.target(
name: "Redacting",
destinations: [.mac],
Expand Down

0 comments on commit 3b803ee

Please sign in to comment.