Build

Packaging Tools Requires: project open

Choose the SDK, Core library version and build settings for your app, and manage the project's package feeds.

The Build panel shows the project's application type and SDK, which OpenPV Core version it builds against, and how the Service Manager and your app are compiled. The actions on the right install or remove the SDK, manage the project's package feeds and run code generation.

Note: These settings save with the rest of the project — click Save... on the toolbar. Choosing a Core Version is the exception: it's written to the project straight away.

The Build panel is shown below, with each numbered item described in turn:

  1. Application Type — the kind of app the project packages, such as Dotnet. Changing it swaps the settings below, and clears Project and Publish Profile.
  2. Installed SDK and Target Support — the versions installed in the project, with the versions currently available in brackets. Shows No SDK Installed until you click Add SDK Package.
  3. Core Version — the OpenPV Core version the project builds against. Any uses the newest build for this major version; choosing a version holds the project on it.
  4. Update — downloads the selected Core version into the local NuGet cache.
  5. Refresh — asks the feeds again for the Core versions they offer.
  6. Show Pre-Release Versions — includes pre-release Core builds in the list. It's ticked each time the project opens.
  7. Container Build Root — the folder mounted into the build container. Leave it blank to use the project folder. Only editable when Use repository root (.git) is cleared.
  8. Use repository root (.git) as the container build root — mounts the nearest folder above the project that contains .git, so project references elsewhere in the repository resolve. On by default.
  9. Verbose Build Log — adds more detail to the build output.
  10. Service Manager — how the service manager is built: Standard, Optimized or Native.
  11. Application — how your app is built: PreBuilt, Standard, Optimized or Native.
  12. Project — your app's .csproj file.
  13. Publish Profile — the .pubxml publish profile used to publish your app.
  14. Pre-Build Command — a command that runs in the project folder before your app is published.
  15. Add SDK Package — installs the OpenPV SDK into the project, or reinstalls it.
  16. Delete SDK Package — removes the SDK from the project.
  17. Library Feeds... — NuGet package feeds the project uses, as well as nuget.org.
  18. Code Generation — runs each extension's code generator. The same as CodeGen on the toolbar.
  19. Add Component — adds an optional platform component to the package, from the ones available for the project's platform.
  20. Remove Component — removes the component selected in Optional Components.
  21. Launch Project — opens the project in Visual Studio, or in VS Code if Visual Studio isn't installed. See Launch Project on the Packaging page.

Below Pre-Build Command, Optional Components lists the components that Add Component and Remove Component manage.

The Build panel, numbered
The Build panel, numbered

Pin a Core Library Version

Watch video walkthrough

  1. Click Core Version and choose the version to build against — here, 5.40.5. It's written to the project's Directory.Packages.props right away, for both Ahsoka.Core and Ahsoka.Core.Drawing.

    The Core Version choices
    The Core Version choices
  2. Click Update to download that version into the local NuGet cache.

    Core 5.40.5 selected, and the Update button
    Core 5.40.5 selected, and the Update button
  3. The Console opens while it downloads, and closes when it's done. To see what happened, click Console on the toolbar — here, Core 5.40.5 downloaded to cache.

    Core 5.40.5 downloaded to the cache
    Core 5.40.5 downloaded to the cache
Note: To go back to the newest build, choose Any.
Note: The list only shows versions that aren't older than this toolkit, within the same major version. Clear Show Pre-Release Versions to hide pre-release builds, and click Refresh after adding a library feed.
Note: After you change the Core version, the next Generate asks to update the SDK package — answer Yes.

Choose How Your App Is Built

Watch video walkthrough

  1. Click Service Manager and choose how the service manager is built: Standard uses the ready-made service manager, Optimized builds a trimmed one that includes your extensions, and Native compiles it to native code in the Docker / Podman container.

    The Service Manager build choices
    The Service Manager build choices
  2. Click Application and choose how your app is built: PreBuilt skips publishing and packages the files already in your app's output folder, Standard is a regular dotnet publish with no trimming, Optimized trims unused code for a smaller app that starts faster, and Native compiles it ahead of time into a native binary in the container, so the target doesn't need the .NET runtime.

    The Application build choices
    The Application build choices
Note: For OpenViewLinux and OpenViewLinuxPro targets, your app is published in the Docker / Podman container when a container engine is set up. Otherwise it's published on your PC.
Note: If the Project or Publish Profile file doesn't exist, your app isn't published — check both paths if your app is missing from the package.

Run a Command Before the Build

Watch video walkthrough

  1. Tick Pre-Build Command to enable its box.

    The Pre-Build Command checkbox
    The Pre-Build Command checkbox
  2. Type the command — here, dotnet tool restore. It runs in the project folder each time you Generate a package, before your app is published.

    A pre-build command entered
    A pre-build command entered
Note: If the command fails, packaging stops with Pre-build command failed, followed by its exit code.
Note: Clearing the checkbox erases the command.

Set the Container Build Root

Watch video walkthrough

  1. By default, the container mounts your repository root. To choose the folder yourself, clear Use repository root (.git) as the container build root.

    The Use repository root checkbox
    The Use repository root checkbox
  2. Container Build Root and its Choose Path... button are now enabled. Click Choose Path... and pick the folder, or leave it blank to use the project folder.

    Container Build Root enabled
    Container Build Root enabled
Note: The container always mounts the folders that hold your project, publish profile and app output. A build root can only widen that, for example to include files your project references above its own folder.

Delete the SDK Package

Watch video walkthrough

  1. Click Delete SDK Package.

    The Delete SDK Package button
    The Delete SDK Package button
  2. It's removed right away, with no confirmation. Application and SDK now shows No SDK Installed — OpenPV Services aren't available to your app until you add the SDK again.

    No SDK Installed, after deleting it
    No SDK Installed, after deleting it
Note: This deletes the SDK from the project's obj/.platform_support folder. Your code, Directory.Packages.props and NuGet.Config aren't changed.

Add the SDK Package

Watch video walkthrough

  1. Click Add SDK Package. It's safe to click when the SDK is already installed — it reinstalls it.

    The Add SDK Package button
    The Add SDK Package button
  2. The Console shows the install, ending with Install Completed, then closes.

    The SDK install, in the Console
    The SDK install, in the Console
  3. Installed SDK shows the version that was installed — here, 5.40.4.

    Installed SDK 5.40.4
    Installed SDK 5.40.4
Note: Add SDK Package also downloads the project's extensions and regenerates AhsokaStartup.g.cs. It uses the project as last saved, so save first if you've just added extensions.

Add a Library Feed

Watch video walkthrough

  1. Click Library Feeds....

    The Library Feeds button
    The Library Feeds button
  2. The dialog lists the project's own feeds. nuget.org is always searched, so it isn't listed. To add a hosted feed, click Add Remote Feed.

    The Library Feeds dialog, with no feeds yet
    The Library Feeds dialog, with no feeds yet
  3. Replace Feed URL with the feed's NuGet v3 address — here, a sample, https://pkgs.example.com/myfeed/v3/index.json. For a private feed, also enter a PAT (optional), a personal access token. Then click OK.

    A sample remote feed URL entered
    A sample remote feed URL entered
  4. The feed is added as repo-0. To use a folder of .nupkg files instead, click Add Local Folder.

    The remote feed added, and the Add Local Folder button
    The remote feed added, and the Add Local Folder button
  5. Enter the folder in Folder Path, or click the folder button to browse for it — here, the PackageOutput folder next to the project, which holds Ahsoka.Core.5.40.5.nupkg and Ahsoka.Core.Drawing.5.40.5.nupkg. Then click OK.

    A local folder entered
    A local folder entered
  6. Both feeds are listed. A local folder is stored relative to the project — here, ../PackageOutput.

    Both feeds in the list
    Both feeds in the list
Note: Feeds are used right away, and written to the project's NuGet.Config when you Save the project, so dotnet restore and your teammates use them too. Saving rewrites the whole file, so changes made to it by hand are lost.
Note: A PAT is saved in NuGet.Config as plain text. Don't commit it to a shared repository.
Note: NuGet finds packages in a local folder by file name and version, such as Ahsoka.Core.5.40.5.nupkg. When your PC is offline, only local folders are used, so you can still build without internet access.
Note: OK doesn't check the address or folder — a mistake only shows up when packages can't be found. To see Core versions from a new feed, click Refresh under Core Library Version.

Remove a Library Feed

Watch video walkthrough

  1. In Library Feeds, select the feed — here, the sample repo-0 — and click Remove Feed.

    The sample feed selected, and the Remove Feed button
    The sample feed selected, and the Remove Feed button
  2. It's removed right away, with no confirmation. Save the project to remove it from NuGet.Config as well.

    The feed list after removing the sample feed
    The feed list after removing the sample feed
Note: A feed can't be edited — remove it and add it again. Close the dialog with the X in its top-right corner.

Run Code Generation

Watch video walkthrough

  1. Click Code Generation. There's no confirmation — it saves the project first.

    The Code Generation button
    The Code Generation button
  2. The Console runs each extension's code generator, ends with Generators Completed, then closes. To review it, click Console on the toolbar. This project has no extensions, so there's nothing to generate.

    Code generation finished, in the Console
    Code generation finished, in the Console
Note: Run it again after adding an extension or changing an extension's settings, so its generated code is up to date.
Note: The SDK must be installed first — without it, the generators can't run.

Add an Optional Component

Watch video walkthrough

  1. Click Add Component.

    The Add Component button
    The Add Component button
  2. Available Optional BSP Components lists the components for the project's platform. Select one — here, hlio-image-openviewpro-docker_ipks.zip on an OpenViewLinuxPro project — and click Add Component.

    A component selected in Available Optional BSP Components
    A component selected in Available Optional BSP Components
  3. It's added to Optional Components. When you Generate a package, it's included and installed on the target if needed.

    The component in the Optional Components list
    The component in the Optional Components list
Note: The list comes from the Platform Support package downloaded for the project's platform. It's empty on platforms that have no optional components, such as OpenViewLinux.
Note: Components save with the rest of the project — click Save... on the toolbar.

Remove an Optional Component

Watch video walkthrough

  1. In Optional Components, select the component and click Remove Component.

    The component selected, and the Remove Component button
    The component selected, and the Remove Component button
  2. It's removed right away, with no confirmation.

    Optional Components after removing the component
    Optional Components after removing the component
Note: Select the component first — the list always keeps one item selected, so Remove Component removes whichever one that is.