Skip to content

Conversation

abertelrud
Copy link
Contributor

The Workspace type has a facility for scanning package plugins for imports. But since it's not passing in the actual plugin directory provided by the caller (whether it's SwiftPM or Xcode), any modules provided by an IDE aren't picked up if they are guarded by #if canImport(). This includes XcodeProjectPlugin, which is one of the additional plugin modules provided by Xcode. The same would be true for other IDEs.

Changes:

  • Workspace.loadPluginImports now also passes the path of the plugin directory to the import scanning
  • extended the testScanImportsInPluginTargets unit test to check for this case

rdar://106387043

The Workspace type has a facility for scanning package plugins for imports.  But since it's not passing in the actual plugin directory provided by the caller (whether it's SwiftPM or Xcode), any modules provided by an IDE aren't picked up if they are guarded by `#if canImport()`.  This includes `XcodeProjectPlugin`, which is one of the additional plugin modules provided by Xcode.  The same would be true for other IDEs.

Changes:
- `Workspace.loadPluginImports` now also passes the path of the plugin directory to the import scanning
- extended the `testScanImportsInPluginTargets` unit test to check for this case

rdar://106387043
@abertelrud
Copy link
Contributor Author

cc @neonichu

@abertelrud
Copy link
Contributor Author

@swift-ci please smoke test

@abertelrud abertelrud merged commit e3b6e5d into swiftlang:main Mar 24, 2023
abertelrud added a commit to abertelrud/swift-package-manager that referenced this pull request Mar 24, 2023
…ng#6323)

The Workspace type has a facility for scanning package plugins for imports.  But since it's not passing in the actual plugin directory provided by the caller (whether it's SwiftPM or Xcode), any modules provided by an IDE aren't picked up if they are guarded by `#if canImport()`.  This includes `XcodeProjectPlugin`, which is one of the additional plugin modules provided by Xcode.  The same would be true for other IDEs.

Changes:
- `Workspace.loadPluginImports` now also passes the path of the plugin directory to the import scanning
- extended the `testScanImportsInPluginTargets` unit test to check for this case

rdar://106387043
(cherry picked from commit e3b6e5d)
tomerd pushed a commit that referenced this pull request Mar 24, 2023
…6326)

The Workspace type has a facility for scanning package plugins for imports.  But since it's not passing in the actual plugin directory provided by the caller (whether it's SwiftPM or Xcode), any modules provided by an IDE aren't picked up if they are guarded by `#if canImport()`.  This includes `XcodeProjectPlugin`, which is one of the additional plugin modules provided by Xcode.  The same would be true for other IDEs.

Changes:
- `Workspace.loadPluginImports` now also passes the path of the plugin directory to the import scanning
- extended the `testScanImportsInPluginTargets` unit test to check for this case

rdar://106387043
(cherry picked from commit e3b6e5d)
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