-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (52 loc) · 2.19 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# load .env
ifneq (,$(wildcard ./.env))
include .env
export
endif
###############################################################################
.PHONY: launch # | Run with INFO logging & release mode
launch:
cargo run --release serve
.PHONY: run # | Run with INFO logging
run:
cargo run serve
.PHONY: debug # | Run with crate-level DEBUG logging & info-level workflows
debug:
RUST_LOG=none,dria_oracle=debug,dkn_workflows=debug,ollama_workflows=info cargo run serve
###############################################################################
.PHONY: install # | Install to path
install:
cargo install --path .
.PHONY: build # | Build
build:
cargo build
.PHONY: docs # | Generate & open documentation
docs:
cargo doc --open --no-deps --document-private-items
.PHONY: lint # | Run clippy
lint:
cargo clippy
.PHONY: format # | Run formatter
format:
cargo fmt -v
.PHONY: version # | Print version
version:
@cargo pkgid | cut -d# -f2
.PHONY: test # | Run tests
test:
RUST_LOG=none,dria_oracle=info cargo test --all-features
###############################################################################
# abi source can be given from outside, and defaults as shown here
ABI_SRC_PATH?=../dria-contracts/artifacts
ABI_DEST_PATH=./src/contracts/abi
.PHONY: abis # | Copy contract abis from a neighbor repo (ABI_SRC_PATH).
abis:
@echo "Copying contract ABIs from $(ABI_SRC_PATH) to $(ABI_DEST_PATH)"
cp $(ABI_SRC_PATH)/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.json $(ABI_DEST_PATH)/ERC20.json
cp $(ABI_SRC_PATH)/contracts/llm/LLMOracleCoordinator.sol/LLMOracleCoordinator.json $(ABI_DEST_PATH)/LLMOracleCoordinator.json
cp $(ABI_SRC_PATH)/contracts/llm/LLMOracleRegistry.sol/LLMOracleRegistry.json $(ABI_DEST_PATH)/LLMOracleRegistry.json
###############################################################################
# https://stackoverflow.com/a/45843594
.PHONY: help # | List targets
help:
@grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/\1 \2/' | expand -t20