Add the cargo-make tasks.

This commit is contained in:
Bauke 2023-04-03 11:55:47 +02:00
parent 1afaabc2a8
commit 69c7c10368
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 41 additions and 0 deletions

41
Makefile.toml Normal file
View File

@ -0,0 +1,41 @@
[env]
# Set BROWSER="firefox" if not already defined.
BROWSER = { condition = { env_not_set = ["BROWSER"] }, value = "firefox" }
# Start a browser instance that will reload the extension when changes are made.
[tasks.dev]
clear = true
env = { NODE_ENV = "development" }
dependencies = ["build"]
command = "pnpm"
args = ["conc", "-c=auto", "-k", "makers watch", "makers run"]
# Build the WebExtension.
[tasks.build]
clear = true
command = "pnpm"
args = ["tsx", "build.ts"]
# Remove build directories.
[tasks.clean]
clear = true
command = "pnpm"
args = ["trash", "build/${BROWSER}"]
# Re-build and pack the WebExtension for publishing.
[tasks.pack]
clear = true
dependencies = ["clean", "build"]
command = "pnpm"
args = ["web-ext", "build", "--config=build/web-ext-${BROWSER}.json"]
# Start a browser instance with the extension loaded.
[tasks.run]
clear = true
command = "pnpm"
args = ["web-ext", "run", "--config=build/web-ext-${BROWSER}.json"]
# Alias for `WATCH=true makers build`.
[tasks.watch]
env = { WATCH="true" }
extend = "build"