chore: Makefile and consistent usage of cargo-make (#101)

* feat: add Makefile with pre build check. add targets for build, test and clean

* feat: add workspace level build file

* chore: add skeletal build files for each crate

* chore: remove environment variable to extend workspace makefile

* chore: formatting

* chore: add release flags to all builds/tests
This commit is contained in:
Rahul Ghangas 2023-01-26 09:19:55 +05:30 committed by GitHub
parent 92c431c98f
commit 1502315605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 52 additions and 3 deletions

15
Makefile Normal file
View File

@ -0,0 +1,15 @@
.PHONY: all test clean
all: .pre-build
@cargo make build
.pre-build:
ifndef $(cargo make --help)
@cargo install --force cargo-make
endif
test: .pre-build
@cargo make test
clean:
@cargo clean

2
Makefile.toml Normal file
View File

@ -0,0 +1,2 @@
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true

7
multiplier/Makefile.toml Normal file
View File

@ -0,0 +1,7 @@
[tasks.build]
command = "cargo"
args = ["build", "--release"]
[tasks.test]
command = "cargo"
args = ["test", "--release"]

View File

@ -0,0 +1,7 @@
[tasks.build]
command = "cargo"
args = ["build", "--release"]
[tasks.test]
command = "cargo"
args = ["test", "--release"]

View File

@ -1,6 +1,3 @@
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
[tasks.pack-build] [tasks.pack-build]
command = "wasm-pack" command = "wasm-pack"
args = ["build", "--release", "--target", "web", "--scope", "waku"] args = ["build", "--release", "--target", "web", "--scope", "waku"]

7
rln/Makefile.toml Normal file
View File

@ -0,0 +1,7 @@
[tasks.build]
command = "cargo"
args = ["build", "--release"]
[tasks.test]
command = "cargo"
args = ["test", "--release"]

7
semaphore/Makefile.toml Normal file
View File

@ -0,0 +1,7 @@
[tasks.build]
command = "cargo"
args = ["build", "--release"]
[tasks.test]
command = "cargo"
args = ["test", "--release"]

7
utils/Makefile.toml Normal file
View File

@ -0,0 +1,7 @@
[tasks.build]
command = "cargo"
args = ["build", "--release"]
[tasks.test]
command = "cargo"
args = ["test", "--release"]