-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (49 loc) · 1.85 KB
/
Makefile
File metadata and controls
59 lines (49 loc) · 1.85 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
.PHONY: all, update, instantiate, tests, clean, pages, format-check, format, install-hooks
# Julia command
JULIA = julia +1.13
PKG_NAME = ONSAS
# Update dependecies
update:
$(JULIA) --project=. -e 'import Pkg; Pkg.update()' && \
$(JULIA) --project=./docs/ -e 'import Pkg; Pkg.update()' && \
$(JULIA) --project=./test/ -e 'import Pkg; Pkg.update()'
# Update dependecies
instantiate:
$(JULIA) --project=. -e 'import Pkg; Pkg.instantiate()' && \
$(JULIA) --project=./docs/ -e 'import Pkg; Pkg.instantiate()' && \
$(JULIA) --project=./test/ -e 'import Pkg; Pkg.instantiate()'
# Run all tests
tests:
$(JULIA) --project=. -e 'import Pkg; Pkg.test(;coverage=false, julia_args=["--check-bounds=yes", "--compiled-modules=yes"], force_latest_compatible_version=false, allow_reresolve=true)'
# Make docs
pages:
$(JULIA) --project=./docs/ -e 'import Pkg; Pkg.instantiate(); include("./docs/make.jl")'
# Remove generated files
clean:
find . -name "*.cov" -type f -exec rm -f {} +
find . -name "*.msh" -type f -exec rm -f {} +
find . -name "*.vti" -type f -exec rm -f {} +
find . -name "*.vtu" -type f -exec rm -f {} +
find . -name "*.pvd" -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)'
# Install git hooks
install-hooks:
cp .githooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
@echo "Git hooks installed."
# Run all tests
all: tests pages format-check clean