|
| 1 | +<!-- Priority: P1 --> |
| 2 | +<!-- Status: Completed --> |
| 3 | +# S-0007-Plugin-Packaging-Command |
| 4 | + |
| 5 | +**User Story** |
| 6 | +As a plugin developer, I want to use a unified Nuke command to package the sample plugins under the samples directory, so that plugin distribution and testing are simplified. The packaging process for each plugin should be independent, and a failure in one plugin should not affect the packaging of others. |
| 7 | + |
| 8 | +**Acceptance Criteria** |
| 9 | +- Provide a unified plugin command that supports different behaviors via operation parameters |
| 10 | +- Support packaging all sample plugins, e.g. `nuke plugin` or `nuke plugin --op all` |
| 11 | +- Support packaging a single plugin, e.g. `nuke plugin --op single --name SimplePlugin` |
| 12 | +- Each plugin is packaged into the `artifacts/plugins/{PluginName}` directory |
| 13 | +- Each plugin also generates a zip archive for distribution |
| 14 | +- Errors during the process do not interrupt the packaging of other plugins |
| 15 | +- If a plugin fails to build or package, no erroneous output files are generated |
| 16 | +- After completion, a color summary is displayed in the console, including: |
| 17 | + - Number and list of successfully packaged plugins (green) |
| 18 | + - Number and list of failed plugins (red) |
| 19 | + - Output file locations (yellow) |
| 20 | + |
| 21 | +**Technical Tasks** |
| 22 | +- [x] Add a unified Plugin target in BuildTasks.cs |
| 23 | +- [x] Implement operation parameter (--op) to distinguish different functions |
| 24 | +- [x] Implement sample plugin directory discovery |
| 25 | +- [x] Implement plugin build and packaging logic |
| 26 | +- [x] Add detailed error handling and logging |
| 27 | +- [x] Add color summary report generation |
| 28 | +- [x] Clean output directory when plugin generation fails |
| 29 | +- [x] Update documentation to explain how to use the command |
| 30 | +- [x] Test execution results in different scenarios |
| 31 | + |
| 32 | +**Usage** |
| 33 | +To package all sample plugins (both ways are equivalent): |
| 34 | + |
| 35 | + nuke plugin |
| 36 | + nuke plugin --op all |
| 37 | + |
| 38 | +To package a single specified plugin: |
| 39 | + |
| 40 | + nuke plugin --op single --name SimplePlugin |
| 41 | + |
| 42 | +**Report Format** |
| 43 | +After packaging, a color summary report will be displayed, for example: |
| 44 | + |
| 45 | +================================================== |
| 46 | +PLUGIN PACKAGING SUMMARY |
| 47 | +================================================== |
| 48 | +Total plugins processed: 3 |
| 49 | +Successfully packaged: 2 |
| 50 | +Failed to package: 1 |
| 51 | + |
| 52 | +Successful plugins: |
| 53 | + ✓ SimplePlugin |
| 54 | + ✓ ExamplePlugin |
| 55 | + |
| 56 | +Failed plugins: |
| 57 | + ✗ NavigationExamplePlugin |
| 58 | + |
| 59 | +Plugins output directory: |
| 60 | + C:\Projects\Modulus\artifacts\plugins |
| 61 | +================================================== |
| 62 | + |
| 63 | +**Notes** |
| 64 | +- The packaging process depends on the Build target and will ensure the project is built first |
| 65 | +- When using `--op single`, the `--name` parameter must be specified |
| 66 | +- Packaging output path: artifacts/plugins/{PluginName} |
| 67 | +- Zip archive path: artifacts/plugins/{PluginName}.zip |
| 68 | +- If plugin build or packaging fails, related output files will be automatically cleaned up |
0 commit comments