-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathMakefile
60 lines (45 loc) · 1.61 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
.PHONY: test prep upload ci clean build
SBT_URL = "http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch//0.12.3/sbt-launch.jar"
SBT_LAUNCH = "sbt-launch.jar"
CI = noop
ifeq ($(REALM),dev)
CI = test
endif
ARTIFACT = $(PACKAGE_NAME)-$(shell echo $$PACKAGE_VERSION | sed -e "s/-SNAPSHOT/_SNAPSHOT/")-$(BUILD_NUMBER)
blar:
echo $(ARTIFACT)
prep:
wget $(SBT_URL) -O $(SBT_LAUNCH)
clean:
rm -rf ./bin
find $(HOME)/.ivy2/ -name "*-SNAPSHOT.jar" -exec rm {} \; || true
rm -f $(SBT_LAUNCH)
test: clean prep
java -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss16M -Dsbt.log.noformat=true -jar $(SBT_LAUNCH) clean compile jacoco:cover
build: clean prep
java -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss16M -Dsbt.log.noformat=true -jar $(SBT_LAUNCH) clean compile test assembly
mkdir -p ./bin/
mv target/*-assembly-*.jar ./bin/$(ARTIFACT).jar
# As soon as builds stop happening on stage, remove this
define COVERAGE_XML
<?xml version="1.0" ?>
<!DOCTYPE coverage
SYSTEM 'http://cobertura.sourceforge.net/xml/coverage-03.dtd'>
<coverage branch-rate="0" line-rate="0.4933" timestamp="$(date +%s)000" version="3.5.1">
<!-- Generated by coverage.py: http://nedbatchelder.com/code/coverage -->
<packages>
</packages>
</coverage>
endef
define JUNIT_XML
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="nosetests" tests="1" errors="0" failures="0" skip="0">
<testcase classname="FAKE_STAGE_OUTPUT" name="FAKE_STAGE_OUTPUT" time="0.001"/>
</testsuite>
endef
export JUNIT_XML
export COVERAGE_XML
noop:
echo "$$JUNIT_XML" > testlog.xml
echo "$$COVERAGE_XML" > coverage.xml
ci: $(CI)