54 lines
1.2 KiB
Makefile
54 lines
1.2 KiB
Makefile
|
[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.
|
||
|
'''
|
||
|
|