66.DEFAULT_GOAL := help
77
88export CARGO_TOOL_VERSION_dd-rust-license-tool ?= 1.0.6
9+ export CARGO_TOOL_VERSION_cargo-deny ?= 0.18.9
910export CARGO_BIN_DIR := $(shell echo "$${HOME}/.cargo/bin")
1011DD_RUST_LICENSE_TOOL := $(CARGO_BIN_DIR ) /dd-rust-license-tool
12+ CARGO_DENY := $(CARGO_BIN_DIR ) /cargo-deny
1113
1214.PHONY : help
1315help :
1719 @printf " %-20s %s\n" " test" " Run the test suite"
1820 @printf " %-20s %s\n" " sync-licenses" " Regenerate LICENSE-3rdparty.csv"
1921 @printf " %-20s %s\n" " check-licenses" " Verify LICENSE-3rdparty.csv is up to date"
22+ @printf " %-20s %s\n" " check-deny" " Check dependency licenses with cargo-deny"
2023
2124.PHONY : cargo-install-dd-rust-license-tool
2225cargo-install-dd-rust-license-tool :
@@ -25,6 +28,13 @@ cargo-install-dd-rust-license-tool:
2528 cargo install " dd-rust-license-tool@$( CARGO_TOOL_VERSION_dd-rust-license-tool) " ; \
2629 fi
2730
31+ .PHONY : cargo-install-cargo-deny
32+ cargo-install-cargo-deny :
33+ @if [ ! -x " $( CARGO_DENY) " ] || ! " $( CARGO_DENY) " --version 2> /dev/null | grep -q " $( CARGO_TOOL_VERSION_cargo-deny) " ; then \
34+ echo " [*] Installing cargo-deny $( CARGO_TOOL_VERSION_cargo-deny) ..." ; \
35+ cargo install " cargo-deny@$( CARGO_TOOL_VERSION_cargo-deny) " ; \
36+ fi
37+
2838.PHONY : fmt
2939fmt :
3040 @echo " [*] Checking Rust source code formatting..."
@@ -49,3 +59,8 @@ sync-licenses: cargo-install-dd-rust-license-tool
4959check-licenses : cargo-install-dd-rust-license-tool
5060 @echo " [*] Checking if third-party license file is up to date..."
5161 @" $( DD_RUST_LICENSE_TOOL) " check
62+
63+ .PHONY : check-deny
64+ check-deny : cargo-install-cargo-deny
65+ @echo " [*] Checking dependency licenses with cargo-deny..."
66+ @" $( CARGO_DENY) " check licenses
0 commit comments