-
Notifications
You must be signed in to change notification settings - Fork 636
[rush] support build/rebuild command in rush plugin #5163
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
Conversation
@microsoft-github-policy-service agree company="TikTok Inc" |
Edit: I stand corrected that there is, in fact, currently support for plugins to define |
Can we just make |
Explicitly using extends in Is this a breaking change for all the Rush plugins that contain command-line.json? |
The existing functionality can stay as-is, I'd just recommend we update the loader of command-line.json to be based on |
Currently, the |
I have some reservations about supporting Under the current design, a subset of related phases/commands is completely specified by exactly one self-contained command-line.json file. Sometimes that file comes from a plugin, but even so Rush's design ensures that the plugin's command-line.json file will be committed to Git and easily discoverable. The design change introduced by PR #5163 is merely fixing an oversight where the 📌 In any case, if "The existing functionality can stay as-is", then this debatable proposal can be handled via a separate GitHub issue or PR. We don't need to block @chengbapi's PR behind that discussion. |
...ugins/rush-plugins/rush-rebuild-command-plugin/rush-rebuild-command-plugin/command-line.json
Show resolved
Hide resolved
@octogonz I have already solved all the issues except for moving the test case because I found other failure cases in this file. Can you check if it is mandatory? |
Summary
When rush load the default command line configuration, it adds the default build commands and register the action before loading commands from rush plugin.
This leaves no opportunity for the Rush plugin to set the build/rebuild command, even if there is no build/rebuild in the default command line configuration.
Details
Instead of including the default build/rebuild in the default command line configuration, I add a condition to check if a plugin contains a build/rebuild command. If so, the default inclusion behavior will be disabled by setting doNotIncludeDefaultBuildCommands.
To ensure that the build/rebuild commands are properly set, the plugin configuration will also extend the default build/rebuild commands if they exist in the configuration.
To provide a quick overview of the current and expected behavior:"
current behavior:
D: default
expected behavior:
How it was tested
Four automated test cases are added.
rush build
andrush rebuild
should work as expected. The build command summary should indicate that the action is registered by the pluginAffliated