xl-project/makefile

92 lines
3.3 KiB
Makefile
Raw Normal View History

2024-05-11 12:50:12 +02:00
GITHASH := $(shell git rev-parse --short HEAD)$(shell git diff-index --quiet HEAD || echo "-dirty")
2024-05-11 14:53:05 +02:00
TARNAME := xl-imbus_$(GITHASH).tar.gz
DIRNAME := xl
2024-05-11 12:50:12 +02:00
2024-05-13 14:37:21 +02:00
MERMAID := java -jar java2umltext.jar --no-constructors --no-method-relationships --no-field-relationships MERMAID
UMLDIRNAME := xl_diagrams_$(GITHASH)
UMLTARNAME := $(UMLDIRNAME).tar.gz
2024-05-11 12:39:04 +02:00
run:
./gradlew run
watch:
./gradlew run --continuous
build:
./gradlew build
2024-05-11 14:07:16 +02:00
ls -lh app/build/libs/*.jar
2024-05-11 12:39:04 +02:00
clean:
./gradlew clean
2024-05-11 12:50:12 +02:00
rm -f *.tar.gz *.tar.gz.minisig *.zip *.jpg
2024-05-13 14:37:21 +02:00
rm -f *.jar *.mmd *.puml *.png *.svg
2024-05-11 12:39:04 +02:00
test:
./gradlew test
2024-05-11 12:50:12 +02:00
$(TARNAME):
2024-05-11 15:27:46 +02:00
git archive --format=tar --prefix=$(DIRNAME)/ HEAD > intermediate.tar
tar -f intermediate.tar --delete $(DIRNAME)/doc
gzip -9 -c intermediate.tar > $(TARNAME)
rm intermediate.tar
2024-05-11 12:50:12 +02:00
$(TARNAME).minisig: $(TARNAME)
minisign -Sm $(TARNAME)
2024-05-11 12:55:35 +02:00
tar: $(TARNAME)
tar -tvf $(TARNAME)
2024-05-13 12:19:58 +02:00
tar -tvf $(TARNAME) | wc -l
2024-05-11 12:50:12 +02:00
sign: $(TARNAME).minisig
2024-05-13 14:37:21 +02:00
inherit:
nu -c 'rg -Ioi ".*class .* (extends|implements).*\\{" | sd " *\\{" "" | lines | sort | save -f inheritance.txt'
install-mermaid:
npm install -g @mermaid-js/mermaid-cli
2024-05-11 12:50:12 +02:00
publish: $(TARNAME) $(TARNAME).minisig
@git diff-index --quiet HEAD || (echo "git is dirty, commit changes first"; exit 1)
ssh server mkdir -p /public/$(DIRNAME)
rsync -avz $(TARNAME).minisig server:/public/$(DIRNAME)/$(TARNAME).minisig
2024-05-11 14:53:05 +02:00
rsync -avz $(TARNAME) server:/public/$(DIRNAME)/$(TARNAME)
2024-05-13 14:37:21 +02:00
ssh server ln -sf /public/$(DIRNAME)/$(TARNAME).minisig /public/$(DIRNAME)/xl-imbus-latest.tar.gz.minisig
ssh server ln -sf /public/$(DIRNAME)/$(TARNAME) /public/$(DIRNAME)/xl-imbus-latest.tar.gz
java2umltext.jar:
curl --progress-bar -L -o java2umltext.jar https://github.com/feitosa-daniel/java2umltext/releases/download/v0.1.0/java2umltext-0.1.0.jar
@echo -n "5d0368b1bebe7cee289d0febc0433d5a4c120762b7ca611948f828bc955c44f6 java2umltext.jar" | sha256sum -c || \
(echo "Checksum mismatch, something fishy is up"; rm -f java2umltext.jar; exit 1)
uml: java2umltext.jar
$(MERMAID) app/src/main/java/model > diagrams_model.mmd
$(MERMAID) app/src/main/java/expr > diagrams_expr.mmd
$(MERMAID) app/src/main/java/gui > diagrams_gui.mmd
$(MERMAID) app/src/main/java/menu > diagrams_menu.mmd
$(MERMAID) app/src/main/java/util > diagrams_util.mmd
mmdc -q -i diagrams_model.mmd -o diagrams_model.svg -t dark -b transparent
mmdc -q -i diagrams_expr.mmd -o diagrams_expr.svg -t dark -b transparent
mmdc -q -i diagrams_gui.mmd -o diagrams_gui.svg -t dark -b transparent
mmdc -q -i diagrams_menu.mmd -o diagrams_menu.svg -t dark -b transparent
mmdc -q -i diagrams_util.mmd -o diagrams_util.svg -t dark -b transparent
mmdc -q -i diagrams_model.mmd -o diagrams_model.png
mmdc -q -i diagrams_expr.mmd -o diagrams_expr.png
mmdc -q -i diagrams_gui.mmd -o diagrams_gui.png
mmdc -q -i diagrams_menu.mmd -o diagrams_menu.png
mmdc -q -i diagrams_util.mmd -o diagrams_util.png
@tar --transform 's,^,$(UMLDIRNAME)/,' -czf $(UMLTARNAME) diagrams_*.{mmd,png,svg}
tar -tvf $(UMLTARNAME)
@# java -jar java2umltext.jar PLANTUML app/src/main/java/model > diagrams.puml
@# Optionally stamp out to PNG with plantuml and mmdc cli tools here
umlpublish: $(UMLTARNAME)
ssh server mkdir -p /public/$(DIRNAME)/diagrams
rsync -avz $(UMLTARNAME) server:/public/$(DIRNAME)/diagrams/$(UMLTARNAME)
2024-05-11 12:39:04 +02:00
2024-05-13 14:37:21 +02:00
.PHONY: run watch build clean test archive sign publish uml umlpublish