Skip to content

Conversation

dfed
Copy link
Owner

@dfed dfed commented May 29, 2025

Prebuilt SwiftSyntax is here, but it's only for macros, which means that in order to take advantage of prebuilt SwiftSyntax, we need to vend a Plugin that does not depend on SwiftSyntax.

This PR creates SafeDIPrebuiltGenerator, which enables adoptees to depend on SafeDI and generate a DI tree without needing to compile SwiftSyntax.

In order to unblock building SafeDI with the IDEPackageEnablePrebuilts user default enabled in Xcode 16.4, I have made it such that SafeDICore is no longer a module that is shared between both the plugin and macro target by symlinking SafeDICore's code into SafeDIMacros. Ideally we'll be able to undo this hack in a future Xcode release.

@dfed dfed self-assigned this May 29, 2025
Copy link

codecov bot commented May 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.91%. Comparing base (becaf91) to head (b5c670d).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #161   +/-   ##
=======================================
  Coverage   99.91%   99.91%           
=======================================
  Files          32       32           
  Lines        3461     3461           
=======================================
  Hits         3458     3458           
  Misses          3        3           
Files with missing lines Coverage Δ
Sources/SafeDIMacros/Macros/InjectableMacro.swift 100.00% <ø> (ø)
...ources/SafeDIMacros/Macros/InstantiableMacro.swift 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dfed dfed marked this pull request as ready for review May 29, 2025 21:30
@dfed dfed changed the title Create SafeDIPrebuiltGenerator Create SafeDIPrebuiltGenerator + enable using prebuilt SwiftSyntax binary in Swift 6.1.1 May 30, 2025
@dfed dfed merged commit 869f3ba into main May 30, 2025
20 checks passed
@dfed dfed deleted the dfed--SafeDIPrebuiltGenerator branch May 30, 2025 01:41
dfed added a commit that referenced this pull request Aug 18, 2025
Undoes some of hacked support for prebuilt SwiftSyntax binaries in Xcode
16.4 using Swift 6.1.1 added in #161. Required for compiling with Swift
6.2, but does **not** compile when building with Swift 6.1.1 and
`defaults write com.apple.dt.Xcode IDEPackageEnablePrebuilts YES`
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.

1 participant