build: added makefile and gitignore

This commit is contained in:
Yandrik 2021-10-24 17:01:45 +02:00
parent 0562ff034b
commit 951a80cdab
2 changed files with 55 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
utils/

53
Makefile.toml Normal file
View File

@ -0,0 +1,53 @@
[config]
skip_core_tasks = true
[env]
PLANTUML_FILE = "utils/plantuml.jar"
######################
# Organizational #
######################
[tasks.default]
alias = "tasks"
[tasks.tasks]
description = "List all tasks that can be run"
category = "Tools"
command = "cargo"
args = ["make", "--list-all-steps"]
#######################
# Diagrams & PlantUML #
#######################
[tasks.get_plantuml]
private = true
category = "Diagrams"
script_runner = "@duckscript"
script = '''
if not is_file ${PLANTUML_FILE}
echo plantuml not found, downloading to ${PLANTUML_FILE} from sourceforge...
wget -O ${PLANTUML_FILE} https://sourceforge.net/projects/plantuml/files/plantuml.jar/download
echo plantuml was downloaded successfully
else
echo plantuml already in utils directory, no download required
end
'''
[tasks.diagrams]
category = "diagrams"
description = "Compiles all diagrams in the project to png images. Downloads plantuml if needed."
dependencies = ["get_plantuml"]
script_runner = "@duckscript"
script = '''
paths = split ${PATHS} ;
for path in ${paths}
puml_path = join_path ${path} *.puml
echo Building diagrams in ${path}...
exec java -jar ${PLANTUML_FILE} -tpng ${puml_path}
end
echo All diagrams rebuilt.
'''