Skip to content

Refactors VPK MSBuild tasks and introduces Flow download#755

Draft
Keboo wants to merge 17 commits intodevelopfrom
buildProjectUpdate
Draft

Refactors VPK MSBuild tasks and introduces Flow download#755
Keboo wants to merge 17 commits intodevelopfrom
buildProjectUpdate

Conversation

@Keboo
Copy link
Member

@Keboo Keboo commented Dec 8, 2025

Overhauls the Velopack.Build project to streamline VPK tool execution and improve integration:

  • Unifies MSBuild Tasks: Introduces a new VpkTask base class, centralizing common logic for PackTask and PublishTask. This simplifies the task implementations and standardizes how vpk commands are built and executed.
  • Streamlines VPK Tool Resolution: Refactors how the vpk executable is located, utilizing assembly metadata to directly find the tool within the build output rather than relying on dotnet tool installation and management. This removes complexity and external dependencies.
  • Removes Obsolete Build Configuration: Eliminates the SelfContained.targets file and related properties, simplifying the project's build logic.
  • Adds Velopack Flow Download Integration: Introduces a FlowRepository and FlowDownloadCommand to enable downloading releases directly from the Velopack Flow service.
  • Modernizes Build Project: Cleans up ProcessExtensions by moving argument parsing logic to a shared partial class, removes unused usings, and updates test project configurations.

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 53.92157% with 47 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.33%. Comparing base (a2592d1) to head (a5238e9).

Files with missing lines Patch % Lines
src/lib-csharp/Util/ProcessExtensions.Shared.cs 68.75% 12 Missing and 3 partials ⚠️
src/vpk/Velopack.Flow/VelopackFlowServiceClient.cs 0.00% 15 Missing ⚠️
src/vpk/Velopack.Deployment/FlowRepository.cs 44.44% 5 Missing ⚠️
src/vpk/Velopack.Packaging/HelperFile.cs 28.57% 5 Missing ⚠️
...c/vpk/Velopack.Vpk/Commands/Flow/PublishCommand.cs 0.00% 3 Missing ⚠️
...vpk/Velopack.Flow/Commands/PublishCommandRunner.cs 0.00% 1 Missing ⚠️
src/vpk/Velopack.Flow/Commands/PublishOptions.cs 0.00% 1 Missing ⚠️
...lopack.Vpk/Commands/Flow/VelopackServiceCommand.cs 0.00% 1 Missing ⚠️
src/vpk/Velopack.Vpk/Program.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #755      +/-   ##
===========================================
+ Coverage    40.91%   41.33%   +0.41%     
===========================================
  Files          244      247       +3     
  Lines        18385    18482      +97     
  Branches      2049     2065      +16     
===========================================
+ Hits          7523     7639     +116     
+ Misses       10504    10473      -31     
- Partials       358      370      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Keboo added 15 commits December 9, 2025 00:14
Removes `DotNetToolRunner` and `VpkToolResolver`, directly packages the `vpk` executable in `Velopack.Build.csproj`, updates `PackTask` and `PublishTask` to invoke the embedded `vpk`, and extracts shared process argument handling to `ProcessExtensions.Shared.cs`.
Implements argument building for PackTask and PublishTask using their properties to invoke `vpk` commands, and refines VpkToolRunner's vpk.dll path discovery.
Adds VpkTask base class for shared logic; refactors PackTask and PublishTask to inherit; updates VPK tool path resolution to include 'any' subdirectory; adds `PackRustAssets` property; refines `VelopackEntryExecutableName` logic; enhances HelperFile search path handling; includes `legacyConsole` and `yes` arguments by default for pack and publish commands.
Embeds vpk tool pack location in assembly metadata, uses metadata for vpk.dll path discovery, enables implicit usings, removes unused usings and an empty property group, and refines MSBuild conditional syntax.
Deletes src/SelfContained.targets, its import from Directory.Build.props, and solution reference.
Removes System.Collections.Generic from PackTask.cs and System, System.Collections.Generic, System.Threading, System.Threading.Tasks from PublishTask.cs.
Removes default values for `DeltaMode` and `SignParallel` in `PackTask`, adjusts `SignParallel` argument generation, adds comprehensive `PackTask` argument building unit tests, updates `Velopack.Build.Tests` to `net9.0` with revised dependencies, and removes the test project README.
Adds unit tests for PublishTask methods, verifying the correct generation of Velopack CLI arguments and environment variables based on task properties.
Introduces `FlowRepository` and `FlowDownloadCommand` for Velopack Flow, along with corresponding option mapping and tests.
Adds VelopackBaseUrl and Timeout properties to PackTask, changes DeltaMode to an enum, and implements a PreExecuteAsync step in PackTask to download releases via vpk download flow when delta mode is active.
Introduces a `--skip-duplicate` flag for the `flow publish` command to prevent re-uploading an existing release by checking the Velopack Flow service.
Adds specific error handling for `http_listener_error` during interactive authentication, converts `AcquireInteractiveAsync` to an instance method, and renames the `baseUrl` command option to `base-url`.
Converts DeltaMode property in PackTask from enum to string, updating comparison and argument passing logic for string values.
@Keboo Keboo force-pushed the buildProjectUpdate branch from 83122b2 to 4f89b68 Compare December 9, 2025 08:24
@Keboo Keboo marked this pull request as draft December 9, 2025 16:05
Keboo added 2 commits December 9, 2025 21:40
Adds `PublishVpkForPackage` target to build `Velopack.Vpk`, updates `IncludeVpkInPackage` to use `TfmSpecificPackageFile` for Vpk output, and refines `IncludeTfmDependenciesInPackage` exclusions and inclusions.
Removes the dedicated item for including runtime directories in the package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant