-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
46 lines (37 loc) · 1.57 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
.DEFAULT_GOAL := build
.PHONY: sbt clean clean-dist build dist publish-local
HARNESS_ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
SBT_SYSTEM_SCALA ?= no
SBT_URL ?= https://git.io/sbt
SBT ?= $(HARNESS_ROOT)/sbt/sbt
DIST ?= dist
VERSION := $(shell grep ^version build.sbt | grep -o '".*"' | sed 's/"//g')
# Enforce version of Scala set in build.sbt (specificly passed to sbt later!)
SCALA_VERSION := $(shell grep ^scalaVersion build.sbt | grep -o '".*"' | sed 's/"//g')
# Install sbtx locally
sbt:
ifeq ($(SBT),$(HARNESS_ROOT)/sbt/sbt)
@ SBT_DIR="$$(dirname $(SBT))" && mkdir -p $$SBT_DIR && cd $$SBT_DIR && \
[ -x sbt ] || ( echo "Installing sbt extras locally (from $(SBT_URL))"; \
which curl &> /dev/null && ( curl \-#SL -o sbt \
https://git.io/sbt && chmod 0755 sbt || exit 1; ) || \
( which wget &>/dev/null && wget -O sbt https://git.io/sbt && chmod 0755 sbt; ) \
)
endif
build: sbt
$(SBT) ++$(SCALA_VERSION) -batch authServer/universal:stage
publish-local: build
$(SBT) ++$(SCALA_VERSION) -batch harnessAuthCommon/publish-local
clean: sbt
$(SBT) ++$(SCALA_VERSION) -batch harnessAuthCommon/clean
$(SBT) ++$(SCALA_VERSION) -batch authServer/clean
dist: clean clean-dist build
mkdir -p $(DIST) && cd $(DIST) && mkdir bin conf logs lib
cp auth-server/bin/* $(DIST)/bin/
cp auth-server/src/main/resources/*.conf $(DIST)/conf/
cp auth-server/src/main/resources/*.xml $(DIST)/conf/
cp auth-server/target/universal/stage/lib/* $(DIST)/lib/
cp auth-server/target/universal/stage/bin/authserver $(DIST)/bin/main
echo $(VERSION) > $(DIST)/RELEASE
clean-dist:
rm -rf $(DIST)