Add linux stubs for rust functions

This commit is contained in:
caesay
2024-01-09 16:40:56 +00:00
parent d42c3a5f67
commit 57e7a00906
11 changed files with 224 additions and 24 deletions

View File

@@ -0,0 +1,34 @@
#!/bin/bash
# Find the absolute path of the script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check if version parameter is provided
if [ "$#" -ne 1 ]; then
echo "Please provide a version number."
echo "Usage: ./build.sh version_number"
exit 1
fi
echo "Building Velopack"
cd "$SCRIPT_DIR/../../src/Rust"
cargo build
cd "$SCRIPT_DIR/../.."
dotnet build src/Velopack.Vpk/Velopack.Vpk.csproj
cd "$SCRIPT_DIR"
version="$1"
releasesDir="$SCRIPT_DIR/releases"
# Write to Const.cs
echo "class Const { public const string RELEASES_DIR = @\"$releasesDir\"; } " > "$(dirname "$0")/Const.cs"
echo "Const.cs file updated with releases directory ($releasesDir)."
echo "Compiling AvaloniaCrossPlat with dotnet..."
dotnet publish -c Release --self-contained -r linux-x64 -o "$(dirname "$0")/publish"
echo "class Const { public const string RELEASES_DIR = @\"{REPLACE_ME}\"; } " > "$(dirname "$0")/Const.cs"
echo "Const.cs file reset"
echo "Building Velopack Release v$version"
"$(dirname "$0")/../../build/Debug/net8.0/vpk" pack -u AvaloniaCrossPlat -v "$version" -o "$releasesDir" -p "$(dirname "$0")/publish" -i Velopack.icns