forked from spinkube/spin-trigger-mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·39 lines (32 loc) · 1011 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Makefile to build and run MQTT plugin for Spin framework.
.PHONY: all
all: build_plugin install_plugin
.PHONY: lint
lint:
@echo "Running linting check..."
cargo clippy --all --all-targets -- -D warnings
cargo fmt --all -- --check
.PHONY: lint-rust-examples
lint-rust-examples:
@echo "Running linting check on example..." \
&& cargo clippy --manifest-path "examples/mqtt-app/Cargo.toml" -- -D warnings \
&& cargo fmt --manifest-path "examples/mqtt-app/Cargo.toml" -- --check \
.PHONY: lint-all
lint-all: lint lint-rust-examples
.PHONY: build_plugin
build_plugin:
@echo "Building Mqtt Plugin..."
cargo build --release
.PHONY: install_plugin
install_plugin:
@echo "Installing Mqtt Plugin in Spin..."
spin plugins update && spin plugins upgrade pluginify -y
spin pluginify --install
.PHONY: clean
clean:
@echo "Cleaning up..."
cargo clean
cargo clean --manifest-path ./examples/mqtt-app/Cargo.toml
rm -f trigger-mqtt-*.tar.gz
rm -f trigger-mqtt.json
spin plugin uninstall trigger-mqtt