-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakeFile
More file actions
53 lines (38 loc) · 1.22 KB
/
MakeFile
File metadata and controls
53 lines (38 loc) · 1.22 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
43
44
45
46
47
48
49
50
51
52
53
TEMPLATE_DIR := templates
HELPERS_DIR := helpers
OUTPUT_DIR := java/src/current
# Python script for processing
JINJA_SCRIPT := jinja.py
# Python script for testing
MODAL_SCRIPT := test/modal_tester.py
# Find all .java.jinja2 files in the template directory
TEMPLATES := $(wildcard $(TEMPLATE_DIR)/*.java.jinja2)
# Define corresponding output .java files in the output directory
OUTPUTS := $(patsubst $(TEMPLATE_DIR)/%.java.jinja2, $(OUTPUT_DIR)/%.java, $(TEMPLATES))
HELPER_FILES := $(wildcard $(HELPERS_DIR)/*)
# DEPS includes the Python script and all helper files
DEPS := $(JINJA_SCRIPT) $(HELPER_FILES)
# Default mode (debug)
MODE := False
# Default target
all: $(OUTPUTS)
# Prod target
prod: MODE := True
prod: $(OUTPUTS)
# Rule to generate .java files
$(OUTPUT_DIR)/%.java: $(TEMPLATE_DIR)/%.java.jinja2 $(DEPS)
mkdir -p $(OUTPUT_DIR)
rm -f $@
uv run $(JINJA_SCRIPT) --input $< --output $@ --prod $(MODE)
chmod 444 $@
MAP_FILE ?= maps.txt
test: all
uv run modal run $(MODAL_SCRIPT) --team1=current --team2=$(BASELINE) --mapfile=$(MAP_FILE)
pullMatches:
uv run modal volume get battlecode-vol / test/matches --force
clone: all
sh clone.sh $(BASELINE)
zip: all
cd java && ./gradlew zipForSubmit
clean:
rm -rf $(OUTPUT_DIR)