-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (34 loc) · 1.12 KB
/
Copy pathMakefile
File metadata and controls
42 lines (34 loc) · 1.12 KB
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
# Makefile for Daml multi-package project
# Auto-discover all packages by finding daml.yaml files
MAIN_PACKAGES := $(shell find src -path "*/main/daml.yaml" -exec dirname {} \; | sort)
TEST_PACKAGES := $(shell find src -path "*/test/daml.yaml" -exec dirname {} \; | sort)
ALL_PACKAGES := $(MAIN_PACKAGES) $(TEST_PACKAGES)
.PHONY: build test clean lint test-examples
# Build everything (main + tests)
build:
daml build --all
# Build examples (depends on main packages)
build-examples: build
cd examples && daml build
# Clean all build artifacts
clean:
daml clean --all
# Run all unit tests
test: build
@echo "Running all tests..."
@for pkg in $(TEST_PACKAGES); do \
echo ""; \
echo "Running tests in $$pkg..."; \
(cd $$pkg && daml test --all) || exit 1; \
done
# Run example tests
test-examples: build-examples
@echo "Running example tests..."
cd examples && daml test
# Run DAML linter to ensure code quality and best practices
lint:
@echo "Linting all packages..."
@for pkg in $(ALL_PACKAGES); do \
echo "Linting $$pkg..."; \
find $$pkg/daml -name "*.daml" -exec daml damlc lint {} \; 2>/dev/null || true; \
done