Files
velopack/docfx/docs/compiling.md
2024-01-27 11:42:17 +00:00

1.9 KiB

Applies to: Windows, MacOS, Linux

Compiling Velopack

Velopack is made up of some Rust binaries which are re-distributed with installed apps, a .NET NuGet package, and a .NET command line tool. In order to test the project, you need to build the Rust binaries before compiling dotnet.

Prerequisites

Debug / Test

On windows, you need to build the Rust binaries using the windows feature before running tests. On OSX, you should run cargo build instead.

git clone https://github.com/velopack/velopack.git
cd velopack/src/Rust
cargo build --features windows
cd ../../
dotnet build
dotnet test --no-build

Release / Build

This is slightly complicated, because you will need to compile Rust on x64 OSX and x64 Windows before creating the final packages.

On OSX:

git clone https://github.com/velopack/velopack.git
cd velopack/src/Rust
cargo build --release

On Windows:

git clone https://github.com/velopack/velopack.git
cd velopack/src/Rust
cargo build --release --features windows
copy {path_to_osx_update} target/release/updatemac
dotnet build -c Release /p:PackRustAssets=true

Compiling on Linux

If you are on Linux (tested on Ubuntu), there are additional package pre-requisites:

sudo apt install libssl-dev pkg-config 

You need to verify that nbgv is working on the command line, you may be missing a DOTNET_ROOT variable in your bash profile, which might need to point at /usr/share/dotnet or $HOME/.dotnet.

If you are missing localisation packages, you can search for them or add export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 to your bash profile.