forked from boot-clj/boot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
103 lines (80 loc) · 3.36 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.PHONY: help deps install deploy test clean
SHELL := /bin/bash
export PATH := bin:$(PATH)
green = '\e[0;32m'
nc = '\e[0m'
version = $(shell grep ^version version.properties |sed 's/.*=//')
verfile = version.properties
bootbin = $(PWD)/bin/boot.sh
bootexe = $(PWD)/bin/boot.exe
bootjarurl = https://github.com/boot-clj/boot/releases/download/p1/boot
bootjar = boot/boot/target/boot-$(version).jar
podjar = boot/pod/target/pod-$(version).jar
aetherjar = boot/aether/target/aether-$(version).jar
aetheruber = aether.uber.jar
workerjar = boot/worker/target/worker-$(version).jar
corejar = boot/core/target/core-$(version).jar
basejar = boot/base/target/base-$(version).jar
baseuber = boot/base/target/base-$(version)-jar-with-dependencies.jar
alljars = $(podjar) $(aetherjar) $(workerjar) $(corejar) $(baseuber) $(bootjar)
help:
@echo "version =" $(version)
@echo "Usage: make {help|deps|install|deploy|test|clean}" 1>&2 && false
clean:
(cd boot/base && mvn -q clean)
(cd boot/core && lein clean)
(cd boot/aether && lein clean)
(cd boot/pod && lein clean)
(cd boot/worker && lein clean)
bloop:
which lein
bin/lein:
mkdir -p bin
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -O bin/lein
chmod 755 bin/lein
deps: bin/lein
$(bootjar): $(verfile) boot/boot/project.clj
(cd boot/boot && lein install)
boot/base/pom.xml: $(verfile) boot/base/pom.in.xml
(cd boot/base && cat pom.in.xml |sed 's/__VERSION__/$(version)/' > pom.xml)
$(basejar): boot/base/pom.xml $(shell find boot/base/src/main/java)
(cd boot/base && mvn -q install)
$(podjar): $(verfile) boot/pod/project.clj $(shell find boot/pod/src)
(cd boot/pod && lein install)
$(aetherjar): $(verfile) boot/aether/project.clj $(podjar) $(shell find boot/aether/src)
(cd boot/aether && lein install && lein uberjar && \
mkdir -p ../base/src/main/resources && \
cp target/aether-$(version)-standalone.jar ../base/src/main/resources/$(aetheruber))
$(workerjar): $(verfile) boot/worker/project.clj $(shell find boot/worker/src)
(cd boot/worker && lein install)
$(corejar): $(verfile) boot/core/project.clj $(shell find boot/core/src)
(cd boot/core && lein install)
$(baseuber): boot/base/pom.xml $(shell find boot/base/src/main)
(cd boot/base && mvn -q assembly:assembly -DdescriptorId=jar-with-dependencies)
$(bootbin): head.sh $(baseuber)
mkdir -p bin
cat head.sh $(baseuber) > $(bootbin)
chmod 0755 $(bootbin)
@echo -e "\033[0;32m<< Created boot executable: $(bootbin) >>\033[0m"
$(bootexe): $(baseuber)
@if [ -z $$RUNNING_IN_CI ] && which launch4j; then \
sed -e "s@__VERSION__@`cat version.properties |sed 's/.*=//'`@" \
launch4j-config.in.xml > launch4j-config.xml; \
launch4j launch4j-config.xml; \
echo -e "\033[0;32m<< Created boot executable: $(bootexe) >>\033[0m"; \
[ -e $(bootexe) ] && touch $(bootexe); \
else true; fi
.installed: $(basejar) $(alljars) $(bootbin) $(bootexe)
date > .installed
install: .installed
.deployed: .installed
(cd boot/base && lein deploy clojars boot/base $(version) target/base-$(version).jar pom.xml)
(cd boot/pod && lein deploy clojars)
(cd boot/aether && lein deploy clojars)
(cd boot/worker && lein deploy clojars)
(cd boot/core && lein deploy clojars)
(cd boot/boot && lein deploy clojars)
date > .deployed
deploy: .deployed
test:
echo "<< no tests yet >>"