-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
64 lines (51 loc) · 1.35 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
PROJECT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
TARGET_DIR=$(PROJECT_DIR)target
CI_BUILD_NUMBER ?= $(USER)-SNAPSHOT
CI_IVY_CACHE ?= $(HOME)/.ivy2
CI_SBT_CACHE ?= $(HOME)/.sbt
CI_WORKDIR ?= $(shell pwd)
TARGET ?= __package-sbt
VERSION ?= 0.0.$(CI_BUILD_NUMBER)
BUILDER_TAG = "meetup/sbt-builder:0.1.5"
# lists all available targets
list:
@sh -c "$(MAKE) -p no_op__ | \
awk -F':' '/^[a-zA-Z0-9][^\$$#\/\\t=]*:([^=]|$$)/ {split(\$$1,A,/ /);\
for(i in A)print A[i]}' | \
grep -v '__\$$' | \
grep -v 'make\[1\]' | \
grep -v 'Makefile' | \
sort"
# required for list
no_op__:
__package-sbt:
sbt clean \
"set coverageEnabled := true" \
"set coverageOutputHTML := false" \
test \
coverageReport \
coverallsMaybe \
coverageOff \
publishLocal \
component:test
cd src/component/sbt && sbt component:test
__publish-sbt: __package-sbt
sbt publish cleanLocal
__set-publish:
$(eval TARGET=__publish-sbt)
__contained-target:
docker run \
--rm \
-v $(CI_WORKDIR):/data \
-v $(CI_IVY_CACHE):/root/.ivy2 \
-v $(CI_SBT_CACHE):/root/.sbt \
-v $(HOME)/.bintray:/root/.bintray \
-e CI_BUILD_NUMBER=$(CI_BUILD_NUMBER) \
-e TRAVIS_JOB_ID=$(TRAVIS_JOB_ID) \
-e TRAVIS_PULL_REQUEST=$(TRAVIS_PULL_REQUEST) \
$(BUILDER_TAG) \
make $(TARGET)
package: __contained-target
publish: __set-publish __contained-target
version:
@echo $(VERSION)