build: added makefile and gitignore
This commit is contained in:
parent
0562ff034b
commit
951a80cdab
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
utils/
|
||||
|
53
Makefile.toml
Normal file
53
Makefile.toml
Normal 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.
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user