spiff-element-units/Makefile

91 lines
1.9 KiB
Makefile
Raw Normal View History

2023-04-12 17:15:05 +00:00
TEST_DATA_DIR := tests/data
2023-04-12 18:25:12 +00:00
PROCESS_MODELS_DIR := $(TEST_DATA_DIR)/process-models
SPECS_JSON_DIR := $(TEST_DATA_DIR)/specs-json
2023-04-12 18:31:35 +00:00
# Used to move back and forth between the process-models clone
CDUP_TO_PROCESS_MODELS_CLONE_DIR := ../../jbirddog/process-models
CDUP_BACK_TO_THIS_CLONE_DIR := ../../sartography/spiff-element-units
2023-04-12 16:30:45 +00:00
DEV_SERVICE := dev
MODULE := module
2023-04-12 16:30:45 +00:00
2023-04-12 17:15:05 +00:00
MY_USER := $(shell id -u)
MY_GROUP := $(shell id -g)
ME := $(MY_USER):$(MY_GROUP)
DO := docker compose run $(DEV_SERVICE)
DO_AS_ME := docker compose run -u $(ME) $(DEV_SERVICE)
2023-04-12 17:15:05 +00:00
2023-04-12 16:30:45 +00:00
.PHONY: all
all: dev-env
#
# local development
#
.PHONY: dev-env
2023-04-12 16:30:45 +00:00
dev-env:
docker compose build --progress=plain $(DEV_SERVICE)
2023-04-12 17:15:05 +00:00
.PHONY: shell
shell:
$(DO) /bin/bash
.PHONY: compile
compile:
$(DO) cargo build --color=never # --offline
2023-04-12 17:15:05 +00:00
.PHONY: tests
tests:
$(DO) cargo test --color=never # --offline
.PHONY: fmt
fmt:
$(DO) cargo fmt
2023-04-12 18:25:12 +00:00
2023-04-12 20:29:23 +00:00
#
# integration between spiff-element-units and the outside SpiffWorkflow world.
2023-04-12 20:29:23 +00:00
#
2023-04-24 14:13:38 +00:00
.PHONY: copy-process-models
copy-process-models:
rm -rf $(PROCESS_MODELS_DIR)
mkdir -p $(PROCESS_MODELS_DIR)
cd $(CDUP_TO_PROCESS_MODELS_CLONE_DIR) && \
find . -name "*.bpmn" -exec rsync -R {} $(CDUP_BACK_TO_THIS_CLONE_DIR)/$(PROCESS_MODELS_DIR) \;
,PHONY: script-specs-json
2023-04-12 20:29:23 +00:00
script-specs-json:
rm -rf $(SPECS_JSON_DIR)
$(DO_AS_ME) /integration/bin/script_specs_json
.PHONY: bindings
bindings:
$(DO) /$(MODULE)/bin/make_bindings
.PHONY: run-integration-tests
run-integration-tests:
$(DO_AS_ME) /integration/bin/run_tests
.PHONY: integration-tests
integration-tests: bindings run-integration-tests
.PHONY: wheel
wheel:
$(DO) /$(MODULE)/bin/make_wheel
2023-04-12 20:29:23 +00:00
#
# until i figure out if its worth adding cargo everything to run as non root
# in the dev container... then also add back `-u $(ME)` to `DO`.
2023-04-12 20:29:23 +00:00
#
.PHONY: take-ownership
take-ownership:
sudo chown -R $(ME) .
.PHONY: check-ownership
check-ownership:
2023-04-12 20:29:23 +00:00
find . ! -user $(MY_USER) ! -group $(MY_GROUP)