Skip to content

Conversation

@ktoso
Copy link
Collaborator

@ktoso ktoso commented Oct 16, 2025

Rather than generating an output file per TYPE which we did before.

The per-type mode cannot work correctly because SwiftPM expects to know all the output Swift files. So we'd have to parse sources and determine up front what the outputs will be -- doable, but problematic -- instead, we now generate files based on input files, and map which type goes into which output file.

This makes it also easier to find where thunks are -- they are in the same named file as the original type or func was declared in.

This may have some edge case problems still.

Resolves #365

@ktoso ktoso force-pushed the wip-write-into-per-file-output-files branch from 5aac152 to 0b09a7e Compare October 16, 2025 13:07
@ktoso
Copy link
Collaborator Author

ktoso commented Oct 16, 2025

Pending some cleanups and handling the JNI mode

@ktoso ktoso force-pushed the wip-write-into-per-file-output-files branch from 0b09a7e to f389162 Compare October 16, 2025 13:15
@ktoso ktoso force-pushed the wip-write-into-per-file-output-files branch from f389162 to d6cc154 Compare October 24, 2025 11:36
Rather than generating an output file per TYPE which we did before.

The per-type mode cannot work correctly because SwiftPM expects to know
all the output Swift files. So we'd have to parse sources and determine
up front what the outputs will be -- doable, but problematic -- instead,
we now generate files based on input files, and map which type goes into
which output file.

This makes it also easier to find where thunks are -- they are in the
same named file as the original type or func was declared in.

This may have some edge case problems still.

Resolves swiftlang#365
@ktoso ktoso force-pushed the wip-write-into-per-file-output-files branch from d6cc154 to afc0c5a Compare October 24, 2025 12:07
@ktoso ktoso marked this pull request as ready for review October 24, 2025 12:08
@ktoso ktoso force-pushed the wip-write-into-per-file-output-files branch from 15b5fac to 499ea03 Compare October 24, 2025 12:27
@ktoso ktoso force-pushed the wip-write-into-per-file-output-files branch from e5e7f4e to 72ce01b Compare October 24, 2025 14:12
@ktoso ktoso merged commit 89b2bcc into swiftlang:main Oct 24, 2025
77 of 78 checks passed
@ktoso ktoso deleted the wip-write-into-per-file-output-files branch October 24, 2025 22:19
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.

[JExtract] Support multiple types in the same file or filename not equal to type name

1 participant