Skip to content

Commit

Permalink
scripts for redistributable packages
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Jul 17, 2023
1 parent cc30675 commit 3739e74
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions kos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition.workspace = true
authors.workspace = true
include.workspace = true
license.workspace = true
repository = "https://github.com/kaspanet/rusty-kaspa"

[lib]
crate-type = ["cdylib", "rlib"]
Expand Down
4 changes: 3 additions & 1 deletion kos/nw.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ Kaspa Desktop OS
""""

[package]
# root = ""
root = ".."
# resources = "resources/setup"
# exclude = ["resources/setup"]
exclude = [{ glob = ["{src/*,target/*,test/*,resources/setup/*,*.lock,*.toml,.git*,build*}"] }]
output = "../setup"
use-app-nw = true
update-package-json = true
build = [{ WASM = { name = "kaspa", outdir = "app/wasm" }}]

[nwjs]
version = "0.77.0"
Expand Down
24 changes: 24 additions & 0 deletions kos/package
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
$INSTALLER = "snap"
elif [[ "$OSTYPE" == "darwin"* ]]; then
$INSTALLER = "dmg"
elif [[ "$OSTYPE" == "cygwin" ]]; then
$INSTALLER = "innosetup"
elif [[ "$OSTYPE" == "msys" ]]; then
$INSTALLER = "innosetup"
elif [[ "$OSTYPE" == "win32" ]]; then
$INSTALLER = "innosetup"
elif [[ "$OS" == "Windows"* ]]; then
$INSTALLER = "innosetup"
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo "FreeBSD is not supported"
else
echo "Unknown operating system"
fi

if [ "$1" = "--dev" ]; then
cargo nw build --sdk $INSTALLER
else
cargo nw build $INSTALLER
fi
6 changes: 6 additions & 0 deletions kos/package.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

if ($args.Contains("--dev")) {
& "cargo nw build --sdk innosetup"
} else {
& "cargo nw build innosetup"
}
6 changes: 6 additions & 0 deletions kos/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

if [ "$1" = "--dev" ]; then
cargo nw run --sdk
else
cargo nw run
fi

0 comments on commit 3739e74

Please sign in to comment.