Skip to content
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
10 changes: 10 additions & 0 deletions Sources/ProjectDescription/BuildAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import Foundation
public struct BuildAction: Equatable, Codable {
/// A list of targets to build, which are defined in the project.
public var targets: [TargetReference]
/// A list of target selection scopes that determine which targets to build.
///
/// Each scope describes a group of targets (e.g. all targets or a filtered subset) that
/// should be resolved into the `targets` list during generation.
public var targetSelection: [TargetSelectionScope]
/// A list of actions that are executed before starting the build process.
public var preActions: [ExecutionAction]
/// A list of actions that are executed after the build process.
Expand All @@ -17,12 +22,14 @@ public struct BuildAction: Equatable, Codable {

public init(
targets: [TargetReference] = [],
targetSelection: [TargetSelectionScope] = [],
preActions: [ExecutionAction] = [],
postActions: [ExecutionAction] = [],
buildImplicitDependencies: Bool = true,
runPostActionsOnFailure: Bool = false
) {
self.targets = targets
self.targetSelection = targetSelection
self.preActions = preActions
self.postActions = postActions
self.buildImplicitDependencies = buildImplicitDependencies
Expand All @@ -32,19 +39,22 @@ public struct BuildAction: Equatable, Codable {
/// Returns a build action.
/// - Parameters:
/// - targets: A list of targets to build, which are defined in the project.
/// - targetSelection: A list of target selection scopes that determine which targets to build.
/// - preActions: A list of actions that are executed before starting the build process.
/// - postActions: A list of actions that are executed after the build process.
/// - runPostActionsOnFailure: Whether the post actions should be run in the case of a failure
/// - Returns: Initialized build action.
public static func buildAction(
targets: [TargetReference],
targetSelection: [TargetSelectionScope] = [],
preActions: [ExecutionAction] = [],
postActions: [ExecutionAction] = [],
buildImplicitDependencies: Bool = true,
runPostActionsOnFailure: Bool = false
) -> BuildAction {
BuildAction(
targets: targets,
targetSelection: targetSelection,
preActions: preActions,
postActions: postActions,
buildImplicitDependencies: buildImplicitDependencies,
Expand Down
25 changes: 25 additions & 0 deletions Sources/ProjectDescription/FileTestPlan.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Foundation

/// Reference an existing `.xctestplan` file on disk.
public struct FileTestPlan: Hashable, Codable {
/// Path to the existing `.xctestplan` file.
public var path: FilePath

// Internal

/// Name of the test plan.
public var name: String
/// Parameter testTargets is not used in Project.swift or Workspace.swift. It is filled after loading testplan and can be used in plugins.
public var testTargets: [TestableTarget]
/// Whether this test plan is the default plan.
public var isDefault: Bool

public init(path: FilePath) {
self.name = path.basenameWithoutExt
self.path = path

// Internal
self.testTargets = []
self.isDefault = false
}
}
Loading
Loading