-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Run prebuild commands provided by plugins before the build starts #3307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
abertelrud
merged 1 commit into
swiftlang:main
from
abertelrud:extension-prebuild-commands
Mar 2, 2021
Merged
Run prebuild commands provided by plugins before the build starts #3307
abertelrud
merged 1 commit into
swiftlang:main
from
abertelrud:extension-prebuild-commands
Mar 2, 2021
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci please smoke test |
abertelrud
commented
Feb 25, 2021
abertelrud
commented
Feb 25, 2021
abertelrud
commented
Feb 25, 2021
318dca5
to
b9a6499
Compare
@swift-ci please smoke test |
f628728
to
ea4892e
Compare
@swift-ci please smoke test |
ea4892e
to
842e519
Compare
@swift-ci please smoke test |
tomerd
approved these changes
Mar 1, 2021
tomerd
reviewed
Mar 1, 2021
tomerd
reviewed
Mar 1, 2021
tomerd
reviewed
Mar 1, 2021
tomerd
reviewed
Mar 1, 2021
tomerd
reviewed
Mar 1, 2021
These commands run before the build starts, and can specify directories whose contents should be considered as inputs to the build planning. The contents of the directories are added as derived sources to the build, and are expected to be compatible with the kind of target for which they are generating sources (e.g. .swift files for Swift targets). The diagnostics for this are currently missing, resulting in a compilation failure rather than a better diagnostics, but will be added. Also, resource files should be treated as resources, etc — this tool will be added. The directories into which outputs are written are added to the set of directories whose contents should affect the build plan, so that changes to the set of generated source files are taken into account when constructing the build plan.
842e519
to
c7bab23
Compare
@swift-ci please smoke test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for running plugin-provided prebuild commands.
Motivation:
This is further progress on an implementation of the Extensible Build Tools proposal (SE-0303). This adds support for prebuild commands, which are commands that always run before each build and that can produce arbitrary outputs that get added as source files to the target to which they are applied (this differs from build tool commands, which are incorporated into the build graph and only run when necessary, but which can only be used when the names of the output paths can be known ahead of time).
Modifications:
Add SPMBuildCore facilities for running prebuild commands and collecting outputs
Modified BuildOperation to run the prebuild commands emitted by plugins
Modified BuildPlan to keep track of the output paths from these commands
Modified LLBuildManifestBuilder to include output directories in the set of paths that should trigger replanning
Made other smaller changes to the PackagePlugin API to bring it in line with SE-0303
Modified the test fixtures to include prebuild commands in addition to build tool commands
To Do:
Some things left to do are:
These improvements can be made in additional PRs that build on top of this one.