forked from metasoarous/oz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (52 loc) · 1.54 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Makefile adapted from
# from https://tech.davis-hansson.com/p/make/
# Use bash as the shell
SHELL := bash
# Exit on any shell error
.SHELLFLAGS := -eu -o pipefail -c
# Delete target file if script fails
.DELETE_ON_ERROR:
# Warn when a Make variable is not defined
MAKEFLAGS += --warn-undefined-variables
# Do not use standard rules for C builds
MAKEFLAGS += --no-builtin-rules
# No default target
.PHONY: all
all:
# Working tree state:
ALLOW_DIRTY=false
.PHONY: dirty
dirty:
$(eval ALLOW_DIRTY=true)
@echo "WARNING: Deploys will be allowed from a dirty working tree."
# Runs Clojure tests.
# Tests always run in the dev environment
.PHONY: test
test:
clojure -A:test:runner
# Make sure there aren't uncommitted changes
.PHONY: check-clean-tree
check-clean-tree:
@if [[ "$(ALLOW_DIRTY)" != "true" && -n "$$(git status --porcelain)" ]]; then \
echo "ERROR: Working directory not clean."; \
exit 97; \
fi
.PHONY: build
build:
rm -rf resources/oz/public/js && \
rm -rf .shadow-cljs && \
npm install && \
clojure -M:shadow-cljs release app lib && \
clojure -A:pack mach.pack.alpha.skinny --no-libs --project-path target/oz.jar
.PHONY: release
release: check-clean-tree build
# Add the js compilation output and commit
git add resources/oz/public/js package-lock.json && \
clojure -Spom && \
git add pom.xml && \
git commit -m "add build targets and update pom" && \
git push origin && \
mvn -e deploy:deploy-file -Dfile=target/oz.jar -DrepositoryId=clojars -Durl=https://clojars.org/repo -DpomFile=pom.xml
.PHONY: clean
clean:
rm -rf target/*