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 integration of SPM packages with spaces in their name #6264

Merged
merged 2 commits into from May 14, 2024

Conversation

kapitoshka438
Copy link
Contributor

@kapitoshka438 kapitoshka438 commented May 9, 2024

Short description πŸ“

Describe here the purpose of your PR.

If a package contains space symbols in its name, PackageInfoMapper produces invalid Swift flags, making compiler recognize words as separate flags:
OTHER_SWIFT_FLAGS = "$(inherited) -package-name Mobile Buy SDK";
This PR fixes this by enclosing such names inside quotes:
OTHER_SWIFT_FLAGS = "$(inherited) -package-name \"Mobile Buy SDK\"";

Include a set of steps for the reviewer to test the changes locally (see the documentation for reference).

This PR adds a new fixture ios_app_with_spm_dependencies with an application target that depends on Mobile Buy SDK

Contributor checklist βœ…

  • The code has been linted using run mise run lint:fix
  • The change is tested via unit testing or acceptance testing, or both
  • The title of the PR is formulated in a way that is usable as a changelog entry
  • In case the PR introduces changes that affect users, the documentation has been updated

Reviewer checklist βœ…

  • The code architecture and patterns are consistent with the rest of the codebase
  • Reviewer has checked that, if needed, the PR includes the label changelog:added, changelog:fixed, or changelog:changed, and the title is usable as a changelog entry

Copy link
Member

@fortmarek fortmarek left a comment

Choose a reason for hiding this comment

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

One nit, we can merge after it's resolved 🀞 πŸ™Œ

Comment on lines 295 to 299
let sanitizedPackageName = if packageInfo.name.contains(" ") {
"\"\(packageInfo.name)\""
} else {
packageInfo.name
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a test for this in the PackageInfoMapperTests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a new test to PackageInfoMapperTests, it's hopefully what you expect )))

@fortmarek fortmarek changed the title Enclose package name inside quotes if it contains spaces Fix integration of SPM packages with spaces in their name May 14, 2024
@fortmarek fortmarek added the changelog:fixed PR will be listed in the Fixed section of CHANGELOG label May 14, 2024
@fortmarek
Copy link
Member

Amazing contribution πŸ‘

@fortmarek fortmarek merged commit 03c54ac into tuist:main May 14, 2024
8 checks passed
@kapitoshka438 kapitoshka438 deleted the fix-package-name-if-spaces branch May 14, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:fixed PR will be listed in the Fixed section of CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants