I am working on an iOS project using Xcode 16.0 that leverages multiple Swift packages. Among these, I have a Shared Package that contains reusable code and is linked to several top-level feature packages (e.g., VideoPlayer, VideoEditor, etc.).
The Shared Package includes a Swift Package Manager plugin for linting code standards, which is designed to execute during its own build process. However, when building a top-level package (e.g., VideoPlayer), the Shared Package is also built as part of the dependency graph. During this process, the linting plugin in the Shared Package is executed unnecessarily, even though the intent is to only build the Shared Package's code.
This behavior results in a significant increase in build times for the top-level packages, as the linting plugin is executed every time the Shared Package is built indirectly.
Key Details: Xcode Version: 16.0
Swift Package Manager: Used for dependency management.
Issue: The linting plugin in the Shared Package executes during the build of top-level packages, increasing build times.
Expected Behaviour: The plugin should only execute when the Shared Package is built directly, not when it is built as a dependency of a top-level package.
I would like to know if there is a way to configure the Shared Package or the Swift Package Manager to prevent the plugin from executing when the Shared Package is built as a dependency of a top-level package, while still allowing the plugin to run when the Shared Package is built directly.
Any guidance, configuration tips, or best practices to address this issue would be greatly appreciated.