-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (38 loc) · 1.27 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.PHONY: all, update, instantiate, tests, clean, pages, format-check, format
# Julia command
JULIA = julia
PKG_NAME = ONSAS
# Update dependecies
update:
$(JULIA) --project=. -e 'import Pkg; Pkg.update()' && $(JULIA) --project=./docs/ -e 'import Pkg; Pkg.update()'
# Update dependecies
instantiate:
$(JULIA) --project=. -e 'import Pkg; Pkg.instantiate()'
# Run all tests
tests:
$(JULIA) --project=. -e 'include("test/runtests.jl")'
# Make docs
pages:
$(JULIA) --project=./docs/ -e 'import Pkg; Pkg.instantiate(); include("./docs/make.jl")'
# Remove generated files
clean:
find . -name "*.msh" -type f -exec rm -f {} +
find . -name "*.vti" -type f -exec rm -f {} +
find . -name "*.vtu" -type f -exec rm -f {} +
# Check JuliaFormatter is applied
format-check:
$(JULIA) --project=. -e '\
using JuliaFormatter; \
files = read(`find . -name "*.jl"`, String); \
for file in split(files, "\n"); \
if file != "" && !isdir(file) && !format(file, verbose=true, overwrite=false); \
println("Formatting issue found in: ", file); \
exit(1); \
end; \
end; \
println("No Formatting issues found.")'
# Apply JuliaFormatter is applied
format:
$(JULIA) --project=. -e 'using JuliaFormatter; format(".", overwrite=true, verbose=true)'
# Run all tests
all: tests pages format-check clean