Hello! I want to write a plugin for Swift Package Manager and I'm running into an issue where SPM doesn't allow to run swift package describe in plugins (due to plugin sandbox limitation). As a workaround we can perform this command manually (before plugin usage) or generate in the plugin using PackagePlugin.Package/Target. So I added an extra argument to the scan command - --json-package-manifest-path and serialize SPM.Package from that path if it exists.
You can check out the proof of concept for a possible Periphery plugin here:
Hello! I want to write a plugin for Swift Package Manager and I'm running into an issue where SPM doesn't allow to run
swift package describe
in plugins (due to plugin sandbox limitation). As a workaround we can perform this command manually (before plugin usage) or generate in the plugin usingPackagePlugin.Package/Target
. So I added an extra argument to the scan command ---json-package-manifest-path
and serializeSPM.Package
from that path if it exists.You can check out the proof of concept for a possible Periphery plugin here:
https://github.com/peripheryapp/periphery/assets/323908/1eb8458e-1856-4a1f-8fc9-aebbb817fbca