diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2bd8d19 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +utils/ + diff --git a/Makefile.toml b/Makefile.toml new file mode 100644 index 0000000..1e3fd34 --- /dev/null +++ b/Makefile.toml @@ -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. +''' +