Skip to content
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

Add new build scripts, minor cleanup #169

Merged
merged 2 commits into from
Feb 20, 2024
Merged

Conversation

Arlodotexe
Copy link
Member

@Arlodotexe Arlodotexe commented Feb 20, 2024

This PR introduces two new scripts for building the Windows Community Toolkit Gallery and Components, aimed at streamlining the build process and reducing the need to string together disparate commands to build a single component or gallery head, or create nuget packages/binlogs, in a desired configuration.

These scripts were adapted from helpers I had created locally over the last few weeks, themselves made and refined from long strings of various other scripts needed to create nuget packages and binlogs. This PR contributes these scripts and goes a step further to integrate with other existing scripts to enable per-head, per-multitarget, and per-component building.

Build-Toolkit-Components.ps1

This script streamlines building and packing components in the Windows Community Toolkit with the specified parameters. It allows you to specify the MultiTarget TFM(s) to include or exclude, the WinUI major version to use, the components to build, whether to build samples or source, optional packing when provided with a NupkgOutput, and more. The components can be built in Release configuration and individual (per-component) binlogs can be generated by passing -bl.

Usage Example

.\tooling\Build-Toolkit-Components.ps1 -MultiTargets wasm,uwp -Components ColorPicker,Segmented -NupkgOutput ./ -PreviewVersion local -WinUIMajorVersion 2 -bl

Build-Toolkit-Gallery.ps1

Used to build the Windows Community Toolkit Gallery app with customizable parameters. It allows you to specify the Head to build, the MultiTargets to include, pick the components to build, enable binlogs, and more.

Usage Examples

.\tooling\Build-Toolkit-Gallery.ps1 -MultiTargets uwp,wasdk -Heads uwp,winappsdk -Components Media,Animations -Release
.\tooling\Build-Toolkit-Gallery.ps1 -MultiTargets wasm -Heads wasm -Components Converters,Animations,Helpers,Behaviors -Release -WinUIMajorVersion 3

MultiTarget Support Scripts

The pull request also updates and adds scripts in the MultiTarget directory to support the new build scripts:

  • GenerateAllProjectReferences.ps1: Updated to support components selection for generating project references.
  • GenerateMultiTargetAwareProjectReferenceProps.ps1: Refactored for improved component directory handling, and to use Get-MultiTargets.ps1.
  • Get-MultiTargets.ps1: New script to retrieve MultiTarget properties for a specific component, extracted from GenerateMultiTargetAwareProjectReferenceProps.ps1 for use in multiple places.

@Arlodotexe
Copy link
Member Author

Arlodotexe commented Feb 20, 2024

Adding that CI remains unmodified. Future plans to possibly modify the build matrix to build and display each component separately, which this can help with, but changing CI now means removing build steps (e.g. collapsing restore, build and pack) without adding anything. It can wait, these scripts are primarily for maintainers to use locally.

@Arlodotexe Arlodotexe enabled auto-merge (rebase) February 20, 2024 18:16
@Arlodotexe Arlodotexe merged commit d1684ab into main Feb 20, 2024
7 of 8 checks passed
@delete-merged-branch delete-merged-branch bot deleted the tooling/build-scripts branch February 20, 2024 19:15
Comment on lines +17 to +18
.PARAMETER PreviewVersion
Specifies the preview version to use if packaging is enabled. Appended with a dash after the version number (formatted Version-PreviewVersion). This parameter is required when NupkgOutput is supplied.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Arlodotexe missed this, this should be optional, this is blocking our release now as we won't have a preview version postfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants