Skip to content

Commit

Permalink
feat(ProjectDescription): make models mutable except for entry point …
Browse files Browse the repository at this point in the history
…models
  • Loading branch information
dxmvsh committed Dec 30, 2023
1 parent 6cde0e0 commit 654c978
Show file tree
Hide file tree
Showing 35 changed files with 188 additions and 188 deletions.
2 changes: 1 addition & 1 deletion Sources/ProjectDescription/AnalyzeAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation
/// It's initialized with the `.analyzeAction` static method
public struct AnalyzeAction: Equatable, Codable {
/// Indicates the build configuration the product should be analyzed with.
public let configuration: ConfigurationName
public var configuration: ConfigurationName

/// Returns an analyze action.
/// - Parameter configuration: Indicates the build configuration the product should be analyzed with.
Expand Down
10 changes: 5 additions & 5 deletions Sources/ProjectDescription/ArchiveAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import Foundation
/// It's initialized with the `.archiveAction` static method.
public struct ArchiveAction: Equatable, Codable {
/// Indicates the build configuration to run the archive with.
public let configuration: ConfigurationName
public var configuration: ConfigurationName
/// If set to true, Xcode will reveal the Organizer on completion.
public let revealArchiveInOrganizer: Bool
public var revealArchiveInOrganizer: Bool
/// Set if you want to override Xcode's default archive name.
public let customArchiveName: String?
public var customArchiveName: String?
/// A list of actions that are executed before starting the archive process.
public let preActions: [ExecutionAction]
public var preActions: [ExecutionAction]
/// A list of actions that are executed after the archive process.
public let postActions: [ExecutionAction]
public var postActions: [ExecutionAction]

init(
configuration: ConfigurationName,
Expand Down
4 changes: 2 additions & 2 deletions Sources/ProjectDescription/Arguments.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import Foundation

/// A collection of arguments and environment variables.
public struct Arguments: Equatable, Codable {
public let environmentVariables: [String: EnvironmentVariable]
public let launchArguments: [LaunchArgument]
public var environmentVariables: [String: EnvironmentVariable]
public var launchArguments: [LaunchArgument]

public init(
environmentVariables: [String: EnvironmentVariable] = [:],
Expand Down
8 changes: 4 additions & 4 deletions Sources/ProjectDescription/BuildAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import Foundation
/// It's initialized with the `.buildAction` static method.
public struct BuildAction: Equatable, Codable {
/// A list of targets to build, which are defined in the project.
public let targets: [TargetReference]
public var targets: [TargetReference]
/// A list of actions that are executed before starting the build process.
public let preActions: [ExecutionAction]
public var preActions: [ExecutionAction]
/// A list of actions that are executed after the build process.
public let postActions: [ExecutionAction]
public var postActions: [ExecutionAction]
/// Whether the post actions should be run in the case of a failure
public let runPostActionsOnFailure: Bool
public var runPostActionsOnFailure: Bool

public init(
targets: [TargetReference],
Expand Down
18 changes: 9 additions & 9 deletions Sources/ProjectDescription/BuildRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ import Foundation
/// A BuildRule is used to specify a method for transforming an input file in to an output file(s).
public struct BuildRule: Codable, Equatable {
/// Compiler specification for element transformation.
public let compilerSpec: CompilerSpec
public var compilerSpec: CompilerSpec

/// Regex pattern when `sourceFilesWithNamesMatching` is used.
public let filePatterns: String?
public var filePatterns: String?

/// File types which are processed by build rule.
public let fileType: FileType
public var fileType: FileType

/// Build rule name.
public let name: String?
public var name: String?

/// Build rule output files.
public let outputFiles: [String]
public var outputFiles: [String]

/// Build rule input files.
public let inputFiles: [String]
public var inputFiles: [String]

/// Build rule output files compiler flags.
public let outputFilesCompilerFlags: [String]
public var outputFilesCompilerFlags: [String]

/// Build rule custom script when `customScript` is used.
public let script: String?
public var script: String?

/// Build rule run once per architecture.
public let runOncePerArchitecture: Bool?
public var runOncePerArchitecture: Bool?

public init(
name: String? = nil,
Expand Down
12 changes: 6 additions & 6 deletions Sources/ProjectDescription/Cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ public struct Cache: Codable, Equatable {
/// A cache profile.
public struct Profile: Codable, Equatable {
/// The unique name of a profile
public let name: String
public var name: String

/// The configuration to be used when building the project during a caching warmup
public let configuration: String
public var configuration: String

/// The device to be used when building the project during a caching warmup
public let device: String?
public var device: String?

/// The version of the OS to be used when building the project during a caching warmup
public let os: String?
public var os: String?

/// Returns a `Cache.Profile` instance.
///
Expand All @@ -35,9 +35,9 @@ public struct Cache: Codable, Equatable {
}

/// A list of the cache profiles.
public let profiles: [Profile]
public var profiles: [Profile]
/// The path where the cache will be stored, if `nil` it will be a default location in a shared directory.
public let path: Path?
public var path: Path?

/// Returns a `Cache` instance containing the given profiles.
/// If no profile list is provided, tuist's default profile will be taken as the default.
Expand Down
6 changes: 3 additions & 3 deletions Sources/ProjectDescription/Cloud.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public struct Cloud: Codable, Equatable {
}

/// The base URL that points to the Cloud server.
public let url: String
public var url: String

/// The project unique identifier.
public let projectId: String
public var projectId: String

/// The configuration options.
public let options: [Option]
public var options: [Option]

/// Returns a generic cloud configuration.
/// - Parameters:
Expand Down
8 changes: 4 additions & 4 deletions Sources/ProjectDescription/ConfigGenerationOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ extension Config {

/// When passed, Xcode will resolve its Package Manager dependencies using the system-defined
/// accounts (for example, git) instead of the Xcode-defined accounts
public let resolveDependenciesWithSystemScm: Bool
public var resolveDependenciesWithSystemScm: Bool

/// Disables locking Swift packages. This can speed up generation but does increase risk if packages are not locked
/// in their declarations.
public let disablePackageVersionLocking: Bool
public var disablePackageVersionLocking: Bool

/// Allows setting a custom directory to be used when resolving package dependencies
/// This path is passed to `xcodebuild` via the `-clonedSourcePackagesDirPath` argument
public let clonedSourcePackagesDirPath: Path?
public var clonedSourcePackagesDirPath: Path?

/// Allows configuring which targets Tuist checks for potential side effects due multiple branches of the graph
/// including the same static library of framework as a transitive dependency.
public let staticSideEffectsWarningTargets: StaticSideEffectsWarningTargets
public var staticSideEffectsWarningTargets: StaticSideEffectsWarningTargets

public static func options(
resolveDependenciesWithSystemScm: Bool = false,
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectDescription/ConfigurationName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Foundation
/// ```
public struct ConfigurationName: ExpressibleByStringLiteral, Codable, Equatable {
/// The configuration name.
public let rawValue: String
public var rawValue: String

init(_ rawValue: String) {
self.rawValue = rawValue
Expand Down
4 changes: 2 additions & 2 deletions Sources/ProjectDescription/CoreDataModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import Foundation
/// A Core Data model.
public struct CoreDataModel: Codable, Equatable {
/// Relative path to the model.
public let path: Path
public var path: Path

/// Optional Current version (with or without extension)
public let currentVersion: String?
public var currentVersion: String?

/// Creates a Core Data model from a path.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
/// A collection of Carthage dependencies.
public struct CarthageDependencies: Codable, Equatable {
/// List of dependencies that will be installed using Carthage.
public let dependencies: [Dependency]
public var dependencies: [Dependency]

/// Creates `CarthageDependencies` instance.
/// - Parameter dependencies: List of dependencies that can be installed using Carthage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ public enum PackagesOrManifest: Codable, Equatable {
public struct SwiftPackageManagerDependencies: Codable, Equatable {
/// The path to the `Package.swift` manifest defining the dependencies, or the list of packages that will be installed using
/// Swift Package Manager.
public let packagesOrManifest: PackagesOrManifest
public var packagesOrManifest: PackagesOrManifest

/// The custom `Product` type to be used for SPM targets.
public let productTypes: [String: Product]
public var productTypes: [String: Product]

// The base settings to be used for targets generated from SwiftPackageManager
public let baseSettings: Settings
public var baseSettings: Settings

// Additional settings to be added to targets generated from SwiftPackageManager.
public let targetSettings: [String: SettingsDictionary]
public var targetSettings: [String: SettingsDictionary]

/// Custom project configurations to be used for projects generated from SwiftPackageManager.
public let projectOptions: [String: ProjectDescription.Project.Options]
public var projectOptions: [String: ProjectDescription.Project.Options]

/// Creates `SwiftPackageManagerDependencies` instance using the package manifest at `Tuist/Package.swift`.
/// - Parameter productTypes: The custom `Product` types to be used for SPM targets.
Expand Down
10 changes: 5 additions & 5 deletions Sources/ProjectDescription/DeploymentTargets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import Foundation
/// A struct representing the minimum deployment versions for each platform.
public struct DeploymentTargets: Hashable, Codable {
/// Minimum deployment version for iOS
public let iOS: String?
public var iOS: String?
/// Minimum deployment version for macOS
public let macOS: String?
public var macOS: String?
/// Minimum deployment version for watchOS
public let watchOS: String?
public var watchOS: String?
/// Minimum deployment version for tvOS
public let tvOS: String?
public var tvOS: String?
/// Minimum deployment version for visionOS
public let visionOS: String?
public var visionOS: String?

public init(iOS: String? = nil, macOS: String? = nil, watchOS: String? = nil, tvOS: String? = nil, visionOS: String? = nil) {
self.iOS = iOS
Expand Down
4 changes: 2 additions & 2 deletions Sources/ProjectDescription/EnvironmentVariable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ public struct EnvironmentVariable: Equatable, Codable, Hashable, ExpressibleBySt
// MARK: - Attributes

/// The value of the environment variable
public let value: String
public var value: String
/// Whether the variable is enabled or not
public let isEnabled: Bool
public var isEnabled: Bool

// MARK: - Init

Expand Down
8 changes: 4 additions & 4 deletions Sources/ProjectDescription/ExecuteAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import Foundation

/// An action that can be executed as part of another action for pre or post execution.
public struct ExecutionAction: Equatable, Codable {
public let title: String
public let scriptText: String
public let target: TargetReference?
public var title: String
public var scriptText: String
public var target: TargetReference?

/// The path to the shell which shall execute this script. if it is nil, Xcode will use default value.
public let shellPath: String?
public var shellPath: String?

public init(title: String = "Run Script", scriptText: String, target: TargetReference? = nil, shellPath: String? = nil) {
self.title = title
Expand Down
10 changes: 5 additions & 5 deletions Sources/ProjectDescription/Headers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ public struct Headers: Codable, Equatable {
}

/// Path to an umbrella header, which will be used to get list of public headers.
public let umbrellaHeader: Path?
public var umbrellaHeader: Path?

/// Relative glob pattern that points to the public headers.
public let `public`: FileList?
public var `public`: FileList?

/// Relative glob pattern that points to the private headers.
public let `private`: FileList?
public var `private`: FileList?

/// Relative glob pattern that points to the project headers.
public let project: FileList?
public var project: FileList?

/// Rule, which determines how to resolve found duplicates in public/private/project scopes
public let exclusionRule: AutomaticExclusionRule
public var exclusionRule: AutomaticExclusionRule

private init(
public publicHeaders: FileList? = nil,
Expand Down
4 changes: 2 additions & 2 deletions Sources/ProjectDescription/LaunchArgument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ public struct LaunchArgument: Equatable, Codable {
// MARK: - Attributes

/// Name of argument
public let name: String
public var name: String
/// If enabled then argument is marked as active
public let isEnabled: Bool
public var isEnabled: Bool

// MARK: - Init

Expand Down
6 changes: 3 additions & 3 deletions Sources/ProjectDescription/Path.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public struct Path: ExpressibleByStringInterpolation, Codable, Hashable {
case relativeToRoot
}

public let type: PathType
public let pathString: String
public let callerPath: String?
public var type: PathType
public var pathString: String
public var callerPath: String?

/// Default PathType is `.relativeToManifest`
public init(_ path: String) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectDescription/PluginLocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
/// A location to a plugin, either local or remote.
public struct PluginLocation: Codable, Equatable {
/// The type of location `local` or `git`.
public let type: LocationType
public var type: LocationType

/// A `Path` to a directory containing a `Plugin` manifest.
///
Expand Down
10 changes: 5 additions & 5 deletions Sources/ProjectDescription/ProfileAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import Foundation
/// It's initialized with the `.profileAction` static method
public struct ProfileAction: Equatable, Codable {
/// Indicates the build configuration the product should be profiled with.
public let configuration: ConfigurationName
public var configuration: ConfigurationName

/// A list of actions that are executed before starting the profile process.
public let preActions: [ExecutionAction]
public var preActions: [ExecutionAction]

/// A list of actions that are executed after the profile process.
public let postActions: [ExecutionAction]
public var postActions: [ExecutionAction]

/// The name of the executable or target to profile.
public let executable: TargetReference?
public var executable: TargetReference?

/// Command line arguments passed on launch and environment variables.
public let arguments: Arguments?
public var arguments: Arguments?

init(
configuration: ConfigurationName = .release,
Expand Down
Loading

0 comments on commit 654c978

Please sign in to comment.