@@ -6,10 +6,45 @@ set shell := ["bash", "-c"]
66# Default target
77default : build
88
9- # Build the project using Nix
10- build :
11- @ echo " Building Aptos Core with Nix..."
12- nix build .#aptos-node
9+ # Build the project or a specific binary using Nix development shell
10+ build binary = " all":
11+ #!/usr/bin/env bash
12+ if [ " {{binary}}" = " all" ]; then
13+ echo " Building Aptos Core with Nix development shell..."
14+ nix develop -c cargo build --release
15+ else
16+ case " {{binary}}" in
17+ " aptos-node" )
18+ package=" aptos-node"
19+ ;;
20+ " aptos" )
21+ package=" crates/aptos"
22+ ;;
23+ " aptos-debugger" )
24+ package=" crates/aptos-debugger"
25+ ;;
26+ " aptos-backup-cli" )
27+ package=" storage/backup/backup-cli"
28+ ;;
29+ " aptos-keygen" )
30+ package=" crates/aptos-keygen"
31+ ;;
32+ " transaction-emitter" )
33+ package=" crates/transaction-emitter"
34+ ;;
35+ " aptos-node-checker" )
36+ package=" ecosystem/node-checker"
37+ ;;
38+ * )
39+ echo " Error: Unknown binary '{{binary}}'. Use 'just list-binaries' to see available binaries."
40+ exit 1
41+ ;;
42+ esac
43+
44+ echo " Building {{binary}} with Nix development shell..."
45+ nix develop -c cargo build --release -p " $package "
46+ echo " Binary available at target/release/{{binary}}"
47+ fi
1348
1449# Enter the development environment
1550dev :
@@ -41,23 +76,39 @@ update:
4176 @ echo " Updating flake.lock..."
4277 nix flake update
4378
44- # Build aptos-node binary
45- aptos-node :
46- @ echo " Building aptos-node with Nix..."
47- nix build .#aptos-node
48- @ echo " Binary available at result/bin/aptos-node"
49-
50- # Build Docker image using Nix
51- docker-nix :
52- @ echo " Building Docker image with Nix..."
53- nix build .#aptos-node-docker
54- @ echo " Docker image available as result.tar.gz"
55-
5679# Build Docker image
5780docker :
5881 @ echo " Building Docker image..."
5982 docker build -f nix/ Dockerfile.nix -t aptos-node .
6083
84+ # Build any binary by package name
85+ build-bin package :
86+ @ echo " Building {{ package}} with Nix development shell..."
87+ nix develop -c cargo build --release -p {{ package}}
88+ @ echo " Binary available at target/release/{{ package}} "
89+
90+ # List available binary build targets
91+ list-binaries :
92+ @ echo " Available binary build targets:"
93+ @ echo " Generic: just build <binary-name>"
94+ @ echo " Common binaries:"
95+ @ echo " aptos-node - Main Aptos node"
96+ @ echo " aptos - Aptos CLI tool"
97+ @ echo " aptos-debugger - Debugging tool"
98+ @ echo " aptos-backup-cli - Backup CLI tool"
99+ @ echo " aptos-keygen - Key generation tool"
100+ @ echo " transaction-emitter - Transaction emitter"
101+ @ echo " aptos-node-checker - Node checker tool"
102+ @ echo " "
103+ @ echo " Use 'just build' to build all packages"
104+ @ echo " Use 'just build-bin <package-name>' for custom package builds"
105+
61106# Help - list available recipes
62107help :
63- @ just --list
108+ @ just --list
109+ @ echo " "
110+ @ echo " Binary Build Options:"
111+ @ echo " Use 'just list-binaries' to see available binary build targets"
112+ @ echo " Use 'just build <binary-name>' for common binary builds"
113+ @ echo " Use 'just build' to build all packages"
114+ @ echo " Use 'just build-bin <package-name>' for custom package builds"
0 commit comments