-
Notifications
You must be signed in to change notification settings - Fork 355
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (55 loc) · 2.68 KB
/
Copy pathMakefile
File metadata and controls
68 lines (55 loc) · 2.68 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
60
61
62
63
64
65
66
67
68
# Map stdin to /dev/null to avoid interactive prompts if there is some failure related to the
# build script.
ifeq (${TRAVIS_SCALA_VERSION},)
SBT := cat /dev/null | project/sbt
else
SBT := cat /dev/null | project/sbt ++${TRAVIS_SCALA_VERSION}
endif
WIKI_PRG := atlas-wiki/runMain com.netflix.atlas.wiki.Main
WIKI_INPUT_DIR := $(shell pwd)/atlas-wiki/src/main/resources
WIKI_OUTPUT_DIR := $(shell pwd)/target/atlas.wiki
LAUNCHER_JAR_URL := https://repo1.maven.org/maven2/com/netflix/iep/iep-launcher/6.0.6/iep-launcher-6.0.6.jar
.PHONY: build snapshot release clean format update-wiki publish-wiki
build:
$(SBT) clean test checkLicenseHeaders scalafmtCheckAll
snapshot:
# Travis uses a depth when fetching git data so the tags needed for versioning may not
# be available unless we explicitly fetch them
git fetch --unshallow --tags
$(SBT) storeBintrayCredentials
$(SBT) clean test checkLicenseHeaders publish
release:
# Travis uses a depth when fetching git data so the tags needed for versioning may not
# be available unless we explicitly fetch them
git fetch --unshallow --tags
# Storing the bintray credentials needs to be done as a separate command so they will
# be available early enough for the publish task.
#
# The storeBintrayCredentials still needs to be on the subsequent command or we get:
# [error] (iep-service/*:bintrayEnsureCredentials) java.util.NoSuchElementException: None.get
$(SBT) storeBintrayCredentials
$(SBT) clean test checkLicenseHeaders storeBintrayCredentials publish bintrayRelease
clean:
$(SBT) clean
format:
$(SBT) formatLicenseHeaders scalafmtAll
$(WIKI_OUTPUT_DIR):
mkdir -p target
git clone git@github.com:Netflix/atlas.wiki.git $(WIKI_OUTPUT_DIR)
update-wiki: $(WIKI_OUTPUT_DIR)
cd $(WIKI_OUTPUT_DIR) && git rm -rf *
$(SBT) "$(WIKI_PRG) $(WIKI_INPUT_DIR) $(WIKI_OUTPUT_DIR)"
publish-wiki: update-wiki
cd $(WIKI_OUTPUT_DIR) && git add * && git status
cd $(WIKI_OUTPUT_DIR) && git commit -a -m "update wiki"
cd $(WIKI_OUTPUT_DIR) && git push origin master
# Build a single runnable jar. The classpath is extracted from sbt by keeping only
# .jar entries, which relies on exportJars being set (see project/BuildSettings.scala)
# so every runtime classpath entry is a packaged jar rather than a classes directory.
one-jar:
mkdir -p target
curl -fL $(LAUNCHER_JAR_URL) -o target/iep-launcher.jar
classpath=`$(SBT) --error "export atlas-standalone/runtime:fullClasspath" | tr -d '\r' | tr ':' '\n' | grep '\.jar$$'`; \
test -n "$$classpath" || { echo "error: no jars in classpath from sbt export" >&2; exit 1; }; \
java -classpath target/iep-launcher.jar com.netflix.iep.launcher.JarBuilder \
target/standalone.jar com.netflix.atlas.standalone.Main $$classpath