Skip to content
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

Fix generating package info when it needs to ignore macCatalyst #4693

Closed
wants to merge 1 commit into from

Conversation

DevYeom
Copy link

@DevYeom DevYeom commented Aug 24, 2022

Resolves #4610

Short description πŸ“

I modified to exclude a macCatalyst platform in packageInfo when using only iOS in Dependencies.swift.

dependencies_sample

let dependencies = Dependencies(
    carthage: nil,
    swiftPackageManager: SwiftPackageManagerDependencies(
        [
            .remote(url: "https://github.com/DevYeom/OneWay.git", requirement: .upToNextMajor(from: "0.1.0")),
            .remote(url: "https://github.com/kean/Get.git", requirement: .upToNextMajor(from: "0.1.0")),
        ],
        productTypes: [
            "OneWay": .framework,
            "Get": .framework,
        ],
        baseSettings: .settings(
            configurations: [
                .debug(name: "Debug", settings: [:], xcconfig: nil),
                .release(name: "Beta", settings: [:], xcconfig: nil),
                .release(name: "Release", settings: [:], xcconfig: nil),
            ]
        ),
        targetSettings: [],
        projectOptions: [:]
    ),
    platforms: [.iOS]
)

AS-IS: 🚫 Build Fail

as_is

TO-BE: βœ… Build Success

to_be

How to test the changes locally 🧐

  1. Download test project from linked issue
  2. tuist fetch
  3. tuist generate
  4. run build

Checklist βœ…

  • The code architecture and patterns are consistent with the rest of the codebase
  • The title of the PR will be used as changelog entry, please make sure it is clear and suitable
  • In case the PR introduces changes that affect users, the documentation has been updated
  • Contributors have checked that, if needed, the PR includes the label changelog:added, changelog:fixed, or changelog:changed

Comment on lines +90 to +91
// Platforms include iOS only
let shouldIgnoreMacCatalyst = platforms.subtracting([.iOS]).isEmpty
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the correct solution πŸ€”
AFAIK maccatalyst is indeed for iOS targets. The change should rather be to enhance the Dependencies.swift to allow to decide whether maccatalyst should be enabled or not.

Given support for maccatalyst is already not working (because mac should be added also to the other dependencies, but we are not doing it), I would just change this to ignore macCatalist πŸ€”

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for feedback πŸ˜€
It would be best to fix that part.
I look forward to seeing what you change in the future.
I will use it by removing the macCatalyst support from library until it is updated.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone were using macCatalyst, I thought they would include both iOS and macOS in Dependencies.platforms.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macOS is to develop natively for macOS, macCatalyst is a layer on top of iOS that makes the iOS app runnable on macOS

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no experience with macCatalyst, so I was wrong. πŸ˜…

@DevYeom DevYeom closed this Aug 24, 2022
@DevYeom DevYeom deleted the fix/ignore-maccatalyst-platforms branch August 24, 2022 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't build when a library that includes macCatalyst support is added in dependencies
2 participants