From 716d7d93d9d3551d3c086b45eb918126399393cd Mon Sep 17 00:00:00 2001 From: caesay Date: Mon, 1 Jan 2024 11:05:22 +0000 Subject: [PATCH] Add build instructions to readme --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- Velopack.sln | 1 + 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2890da70..1d293e8a 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,46 @@ [![Codecov](https://img.shields.io/codecov/c/github/velopack/velopack?style=flat-square)](https://app.codecov.io/gh/velopack/velopack) [![License](https://img.shields.io/github/license/velopack/velopack?style=flat-square)](https://github.com/velopack/velopack/blob/develop/LICENSE) -# Velopack \ No newline at end of file +# Velopack + +# Compiling + +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 + - [.NET 6 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) + - [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) + - [Rust / Cargo](https://www.rust-lang.org/tools/install) + - `dotnet tool install -g dotnet-coverage` + - `dotnet tool install -g nbgv` + +### 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. + +```shell +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: +```shell +git clone https://github.com/velopack/velopack.git +cd velopack/src/Rust +cargo build --release +``` + +On Windows: +```shell +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 +``` \ No newline at end of file diff --git a/Velopack.sln b/Velopack.sln index db47deb6..a53b8376 100644 --- a/Velopack.sln +++ b/Velopack.sln @@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionLevel", "SolutionLe src\Directory.Build.props = src\Directory.Build.props Velopack.entitlements = Velopack.entitlements version.json = version.json + README.md = README.md EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Velopack.Packaging", "src\Velopack.Packaging\Velopack.Packaging.csproj", "{352C15EA-622F-4132-80D8-9B6E3C83404E}"