-
-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change ProjectDescription model constructors to static functions #5843
Change ProjectDescription model constructors to static functions #5843
Conversation
@@ -4,17 +4,11 @@ import Foundation | |||
public struct Arguments: Equatable, Codable { | |||
public var environmentVariables: [String: EnvironmentVariable] | |||
public var launchArguments: [LaunchArgument] | |||
|
|||
public init( | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// MARK: - Init | ||
|
||
public init(value: String, isEnabled: Bool) { | ||
init(value: String, isEnabled: Bool) { | ||
self.value = value | ||
self.isEnabled = isEnabled | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, if you define an init(stringLiteral:)
, you will lose the init generated by the compiler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right! No strong opinion, I would define that in an extension, so we have the generated one for free.
e73cba9
to
927331a
Compare
* Remove tuist-env * Fix the release pipeline * Remove deprecated methods (#5560) * [tuist-4] Remove `tuistenv` (#5556) * Remove tuist-env * Fix the release pipeline * chore: remove deprecated methods * chore: remove disableAnalytics * fix: fix fixture definition --------- Co-authored-by: Pedro Piñera Buendía <663605+pepicrft@users.noreply.github.com> * Fix the bundle script * Change the coloring behaviour (#5668) * Not auto-generate a scheme per platform (#5679) * Eliminate signing capabilities (#5716) * Eliminate signing capabilities * Update the root Package.resolved * Removed TargetDependency's .packagePlugin API in favor of using PackageType (#5719) * feat(TargetDependency): remove packagePlugin api * feat(TargetDependency+ManifestMapper): remove packagePlugin api handle * test(TargetDependency+ManifestMapperTests): add tests for package types: runtime, macro and plugin * style(TargetDependency+ManifestMapperTests): add lint changes * chore: remove carthage support (#5740) * Resolve Tuist-4 Compiler Errors (#5818) * Remove Dependencies.swift (#5812) * Squashed commit of the following: commit f74176d Author: fortmarek <marekfort@me.com> Date: Tue Jan 16 09:21:28 2024 +0100 Remove cache warm for Silicon commit b954bdb Author: fortmarek <marekfort@me.com> Date: Tue Jan 16 09:20:46 2024 +0100 Minor updates commit 4693f71 Author: fortmarek <marekfort@me.com> Date: Mon Jan 15 23:52:01 2024 +0100 Run lint:fix commit 984a73f Author: fortmarek <marekfort@me.com> Date: Mon Jan 15 23:51:44 2024 +0100 Update external dependencies tutorial commit 909fc24 Author: fortmarek <marekfort@me.com> Date: Mon Jan 15 23:45:31 2024 +0100 Add PackageSettings in Package.swift commit c70affb Merge: a932745 7f34cba Author: fortmarek <marekfort@me.com> Date: Mon Jan 15 09:35:51 2024 +0100 Merge remote-tracking branch 'origin/main' into tests/dependencies-acceptance commit a932745 Merge: ef80095 675239c Author: Daniele Formichelli <df@bendingspoons.com> Date: Tue Jan 2 13:55:15 2024 +0100 Merge branch 'main' into tests/dependencies-acceptance commit ef80095 Merge: 54f9875 e14da60 Author: Daniele Formichelli <df@bendingspoons.com> Date: Sun Dec 31 16:55:49 2023 +0100 Merge branch 'main' into tests/dependencies-acceptance commit 54f9875 Author: Daniele Formichelli <df@bendingspoons.com> Date: Sun Dec 31 16:55:43 2023 +0100 fix: feature one target sources commit 9671063 Author: Daniele Formichelli <df@bendingspoons.com> Date: Sat Dec 30 16:52:44 2023 +0100 chore: format commit 7df88d4 Author: Daniele Formichelli <df@bendingspoons.com> Date: Sat Dec 30 16:46:10 2023 +0100 chore: simplify spm fixture commit 9a05c9e Author: Daniele Formichelli <df@bendingspoons.com> Date: Sat Dec 30 15:47:38 2023 +0100 chore: lint commit 96c989f Author: Daniele Formichelli <df@bendingspoons.com> Date: Fri Dec 29 21:34:45 2023 +0100 test: re-enable dependencies acceptance tests * Remove Dependencies.swift support * Remove intermediary graph.json * Fix issues after merging tuist-4 * Remove Dependencies.swift from fixtures * Move Package loading to TuistLoader * Remove TuistDependenciesTesting from FetchServiceTests * Add dump command for package * Add back PackageSettings in app_with_spm_dependencies * Fix missing tests due to missing Package.swift error * Remove platforms from string assertion due to Set non-determinism * Add package settings to multiplatform_app_with_sdk fixture * Remove ProjectDescriptionHelpers import in Package.swift for multiplatform_app_with_sdk * Update platforms for multiplatform_app_with_sdk fixture * Remove deprecated APIs * Fix Test Compilation * Update test fixture tempalte to multiplatform API * Migrate fixtures to `destinations` api * Migrate fixtures to `deploymentTargets` apis * Update manifest helper methods * Update fixture generator to use `destinations` * Update to use a tuist 4 version of this template repo * Fixing a couple fixtures * Fix Tuist helper method to use correct signature * Update doc comments * More missed callsites * Remove Cache from ProjectDescription (#5833) * Fix missing macro case in switch * Remove binary cache-related models from TuistCore * chore: fix warnings * Change ProjectDescription model constructors to static functions (#5843) * Remove public inits in favor of static constructors * Fix tests * Lint * Fix remaining tests * Skip loading default helpers if equal to srcroot * Fix lint issue * Fix infinite loop in app_with_spm_dependencies fixture * Lint * Remove unnecessary force try * Fix generate acceptance tests * Fix test acceptance tests * Rename cache directory name (#5842) * Rename cache directory name * Rename cache categories * Fix compilation issues * Fix CleanServiceTests --------- Co-authored-by: Daniele Formichelli <df@bendingspoons.com> * Bump Minimum Swift to 5.9 * Autoformat code style - Update .swiftformat - Ignore unwanted rules * Fix failing tests * Simplify tuist init (#5853) * Simplify tuist init * Address PR feedback * Add Package.swift, update init message * Update tabs * Remove Package.swift --------- Co-authored-by: Daniele Formichelli <df@bendingspoons.com> Co-authored-by: Dimash <44325936+dxmvsh@users.noreply.github.com> Co-authored-by: fortmarek <marekfort@me.com> Co-authored-by: Charles Pisciotta <cpisciottadeveloping@gmail.com> Co-authored-by: Mike Simons <msimons@etsy.com> Co-authored-by: Mike Simons <waltflanagan@users.noreply.github.com>
Resolves #5714
Short description 📝
We're making all constructors of
ProjectDescription
models internal in favor of public static constructors with the exception of:Project
(any that needs to rundumpIfNeeded
) -> this convention is inline withPackageDescription
and imho makes senseHow to test the changes locally 🧐
CI should pass
Contributor checklist ✅
mise run lint:fix
Reviewer checklist ✅
changelog:added
,changelog:fixed
, orchangelog:changed
, and the title is usable as a changelog entry