Skip to content

Commit

Permalink
Remove unncessary Foundation imports from ProjectDescription and make…
Browse files Browse the repository at this point in the history
… the required ones @_implementationOnly (tuist#7207)

* Remove unncessary Foundation imports from ProjectDescription and make the required ones @_implementationOnly

* Add project description and automation settings for library distribution in Module.swift
  • Loading branch information
pepicrft authored Jan 8, 2025
1 parent bd9d273 commit d6a3c55
Show file tree
Hide file tree
Showing 66 changed files with 18 additions and 128 deletions.
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/AnalyzeAction.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// An action that analyzes the built products.
///
/// It's initialized with the `.analyzeAction` static method
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/ArchiveAction.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// An action that archives the built products.
///
/// It's initialized with the `.archiveAction` static method.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Arguments.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A collection of arguments and environment variables.
public struct Arguments: Equatable, Codable, Sendable {
public var environmentVariables: [String: EnvironmentVariable]
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/BuildAction.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// An action that builds products.
///
/// It's initialized with the `.buildAction` static method.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/BuildRule+CompilerSpec.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

extension BuildRule {
/// The type of compiler spec which is used for a selected file type.
/// All the values are taken from build rule options hidden under a pup-up button's menu next to a label `Using` in a target's
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/BuildRule+FileType.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

extension BuildRule {
/// File types processed by a build rule.
/// All the values are taken from build rule options hidden under a pup-up button's menu next to a label `Process` in a
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/BuildRule.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
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, Sendable {
/// Compiler specification for element transformation.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Cloud.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A cloud configuration, used for remote caching.
public struct Cloud: Codable, Equatable, Sendable {
/// Options for cloud configuration.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/CompatibleXcodeVersions.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Options of compatibles Xcode versions.
public enum CompatibleXcodeVersions: ExpressibleByArrayLiteral, ExpressibleByStringInterpolation, Codable, Equatable, Sendable {
/// The project supports all Xcode versions.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/ConfigurationName.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A configuration name.
///
/// It has build-in support for ``debug`` and ``release`` configurations.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/CopyFileElement.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A file element from a glob pattern or a folder reference which is conditionally applied to specific platforms with an optional
/// "Code Sign On Copy" flag.
public enum CopyFileElement: Codable, Equatable, Sendable {
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/CopyFilesAction.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A build phase action used to copy files.
///
/// Copy files actions, represented as target copy files build phases, are useful to associate project files
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/CoreDataModel.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A Core Data model.
public struct CoreDataModel: Codable, Equatable, Sendable {
/// Relative path to the model.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/DeploymentTargets.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

// MARK: - DeploymentTargets

/// A struct representing the minimum deployment versions for each platform.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Destination.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Set of deployment destinations
public typealias Destinations = Set<Destination>

Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectDescription/Dump.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Foundation
@_implementationOnly import Foundation

func dumpIfNeeded(_ entity: some Encodable) {
guard !ProcessInfo.processInfo.arguments.isEmpty,
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Entitlements.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

// MARK: - Entitlements

public enum Entitlements: Codable, Equatable, Sendable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectDescription/Environment.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Foundation
@_implementationOnly import Foundation

/// A convenience structure to read environment variables.
@dynamicMemberLookup
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/EnvironmentVariable.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// It represents an environment variable that is passed when running a scheme's action
public struct EnvironmentVariable: Equatable, Codable, Hashable, ExpressibleByStringLiteral, Sendable {
// MARK: - Attributes
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/ExecuteAction.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// An action that can be executed as part of another action for pre or post execution.
public struct ExecutionAction: Equatable, Codable, Sendable {
public var title: String
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/FileCodeGen.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Options for source file code generation.
public enum FileCodeGen: String, Codable, Equatable, Sendable {
/// Public codegen
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/FileElement.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A file element from a glob pattern or a folder reference.
///
/// - glob: a glob pattern for files to include
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/FileHeaderTemplate.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A header template from a file or a string.
///
/// Lets you define custom file header template for built-in Xcode templates, e.g. when you create new Swift file you can
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/FileList.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A collection of file globs.
///
/// The list of files can be initialized with a string that represents the glob pattern, or an array of strings, which represents
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/FileListGlob.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A glob pattern that refers to files.
public struct FileListGlob: Codable, Equatable, Sendable {
/// The path with a glob pattern.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Headers.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A group of public, private and project headers.
public struct Headers: Codable, Equatable, Sendable {
/// Determine how to resolve cases, when the same files found in different header scopes
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/InfoPlist.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

// MARK: - InfoPlist

/// A info plist from a file, a custom dictonary or a extended defaults.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/LaunchArgument.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A launch argument, passed when running a scheme.
public struct LaunchArgument: Equatable, Codable, Sendable {
// MARK: - Attributes
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/LaunchStyle.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

public enum LaunchStyle: Codable, Sendable {
case automatically
case waitForExecutableToBeLaunched
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/MetalOptions.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Options to configure scheme metal options for run and test actions.
public struct MetalOptions: Equatable, Codable, Sendable {
/// API Validation
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/PackageSettings.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A custom Swift Package Manager configuration
///
///
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Path.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A path represents to a file, directory, or a group of files represented by a glob expression.
///
/// Paths can be relative and absolute. We discourage using absolute paths because they create a dependency with the environment
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Platform.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

// MARK: - Platform

/// A supported platform representation.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/PlatformCondition.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A condition applied to an "entity" allowing it to only be used in certain circumstances
public struct PlatformCondition: Codable, Hashable, Equatable, Sendable {
public let platformFilters: Set<PlatformFilter>
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Plist.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

// MARK: - Plist

public enum Plist {
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Plugin.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A plugin representation.
///
/// Supported plugins include:
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/PluginLocation.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A location to a plugin, either local or remote.
public struct PluginLocation: Codable, Equatable, Sendable {
/// The type of location `local` or `git`.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/PrivacyManifest.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Describe the data your app or third-party SDK collects and the reasons required APIs it uses.
public struct PrivacyManifest: Codable, Equatable, Sendable {
/// A Boolean that indicates whether your app or third-party SDK uses data for tracking as defined under the App
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Product.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Possible products types.
public enum Product: String, Codable, Equatable, Sendable {
/// An application.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/ProfileAction.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// An action that profiles the built products.
///
/// It's initialized with the `.profileAction` static method
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Project.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A project representation.
///
/// A project manifest needs to be defined in a `Project.swift` manifest file.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/ProjectOptions.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

extension Project {
/// Options to configure a project.
public struct Options: Codable, Equatable, Sendable {
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/ResourceFileElement.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A resource file element from a glob pattern or a folder reference.
///
/// - glob: a glob pattern for files to include
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/ResourceFileElements.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A collection of resource file.
public struct ResourceFileElements: Codable, Equatable, Sendable {
/// List of resource file elements
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/ResourceSynthesizer.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A resource synthesizer for given file extensions.
///
/// For example to synthesize resource accessors for strings, you can use:
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/RunAction.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// An action that runs the built products.
///
/// It's initialized with the .runAction static method.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/RunActionOptions.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Options for the `RunAction` action
public struct RunActionOptions: Equatable, Codable, Sendable {
/// Language to use when running the app.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Scheme.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A custom scheme for a project.
///
/// A scheme defines a collection of targets to Build, Run, Test, Profile, Analyze and Archive.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/SchemeDiagnosticsOptions.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Options to configure scheme diagnostics for run and test actions.
public struct SchemeDiagnosticsOptions: Equatable, Codable, Sendable {
/// Enable the address sanitizer
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/SchemeLanguage.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A language to use for run and test actions.
public struct SchemeLanguage: Codable, Equatable, ExpressibleByStringLiteral, Sendable {
public let identifier: String
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/ScreenCaptureFormat.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Preferred screen capture format for UI tests results in Xcode 15+
///
/// Available options are screen recordings and screenshots.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Settings.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

public typealias SettingsDictionary = [String: SettingValue]

/// A value or a collection of values used for settings configuration.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/SettingsTransformers.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

extension SettingsDictionary {
public mutating func merge(_ other: SettingsDictionary) {
merge(other) { $1 }
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/SimulatedLocation.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Simulated location represents a GPS location that is used when running an app on the simulator.
public struct SimulatedLocation: Codable, Equatable, Sendable {
/// The identifier of the location (e.g. London, England)
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/SourceFilesList.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A glob pattern configuration representing source files and its compiler flags, if any.
public struct SourceFileGlob: Codable, Equatable, Sendable {
/// Type of the source file.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Target.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A target of a project.
public struct Target: Codable, Equatable, Sendable {
/// The name of the target. Also, the product name if not specified with ``productName``.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/TargetDependency.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Dependency status used by dependencies
public enum LinkingStatus: String, Codable, Hashable, Sendable {
/// Required dependency
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/TargetReference.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A target reference for a specified project.
///
/// The project is specified through the path and should contain the target name.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/TargetScript.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A build phase action used to run a script.
///
/// Target scripts, represented as target script build phases in the generated Xcode projects, are useful to define actions to be
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Template/Template.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A scaffold template model.
public struct Template: Codable, Equatable, Sendable {
/// Description of template
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/TemplateString.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

public struct TemplateString: Encodable, Decodable, Equatable {
/// Contains a string that can be interpolated with options.
let rawString: String
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/TestAction.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// An action that tests the built products.
///
/// You can create a test action with either a set of test targets or test plans using the `.targets` or `.testPlans` static
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/TestActionOptions.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// The type `TestActionOptions` represents a set of options for a test action.
public struct TestActionOptions: Equatable, Codable, Sendable {
/// Language used to run the tests.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/TestableTarget.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

public struct TestableTarget: Equatable, Codable, ExpressibleByStringInterpolation, Sendable {
/// With the introduction of Swift Testing and Xcode 16, you can now choose to run your tests
/// in parallel across either the full suite of tests in a target with `.enabled`, just those created
Expand Down
2 changes: 0 additions & 2 deletions Sources/ProjectDescription/Workspace.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A workspace representation.
///
/// By default, `tuist generate` generates an Xcode workspace that has the same name as the current project.
Expand Down
Loading

0 comments on commit d6a3c55

Please sign in to comment.