Skip to content

[SwiftRefactor] PackageManifest: Make a couple of properties external… #3139

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Aug 13, 2025

…ly accessible

In it's current state AddPackageTarget does multiple things:

  1. Updates the manifest to introduce new targets and dependencies.

  2. Generates one or more auxiliary files depending on the type of target being added (i.e. a primary file for the target and sometimes a macro specific defintions file).

We'd like to scope the refactoring action down to manifest updates only.

The callers are going to be resposble for #2 from the list. In order to do that PackageTarget.sanitizedName and PackageTarget.Dependency.name have to be externally accessible (under @_spi(PackageRefactor) still) to form the content of the file.

Comment on lines 337 to 338
@_spi(PackageRefactor)
public extension PackageTarget {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to keep this one as an extension and not name? I'd probably just move it as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, there is localizedFirstWordCapitalized but we can deal with that later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

…ly accessible

In it's current state `AddPackageTarget` does multiple things:

1. Updates the manifest to introduce new targets and dependencies.

2. Generates one or more auxiliary files depending on the type of
target being added (i.e. a primary file for the target and sometimes
a macro specific defintions file).

We'd like to scope the refactoring action down to manifest updates only.

The callers are going to be resposble for swiftlang#2 from the list. In order to
do that `PackageTarget.sanitizedName` and `PackageTarget.Dependency.name`
have to be externally accessible (under `@_spi(PackageRefactor)` still)
to form the content of the file.
@xedin xedin force-pushed the make-name-package-target-name-and-sanitized-name-accessible branch from 680659b to f807ce6 Compare August 13, 2025 23:19
@xedin
Copy link
Contributor Author

xedin commented Aug 14, 2025

@swift-ci please test

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.

2 participants