-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
54 lines (41 loc) · 1.33 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
.PHONY: all build install clean test docs check local validate-release test-downstream upload
SHELL := /usr/bin/env bash
ifeq ($(OS),Windows_NT)
ifneq (,$(findstring /cygdrive/,$(PATH)))
GRADLE_BIN := ./gradlew
else
GRADLE_BIN := gradlew.bat
endif
else
GRADLE_BIN := ./gradlew
endif
all: test
install: local
build:
$(GRADLE_BIN) assemble
clean:
$(GRADLE_BIN) clean
@rm -rf java-ngrok-example-dropwizard
test:
$(GRADLE_BIN) test
docs:
$(GRADLE_BIN) javadoc
check:
$(GRADLE_BIN) checkstyleMain spotbugsMain
local:
$(GRADLE_BIN) publishToMavenLocal
validate-release:
@if [[ "${VERSION}" == "" ]]; then echo "VERSION is not set" & exit 1 ; fi
@if [[ $$(grep "version \"${VERSION}\"" build.gradle) == "" ]] ; then echo "Version not bumped in build.gradle" & exit 1 ; fi
test-downstream:
@( \
VERSION=$(shell ./gradlew -q printVersion); \
git clone https://github.com/alexdlaird/java-ngrok-example-dropwizard.git; \
( make local ) || exit $$?; \
mvn -f java-ngrok-example-dropwizard/pom.xml versions:set-property -Dproperty=java-ngrok.version -DnewVersion=$$VERSION; \
( make -C java-ngrok-example-dropwizard build ) || exit $$?; \
( make -C java-ngrok-example-dropwizard test ) || exit $$?; \
rm -rf java-ngrok-example-dropwizard; \
)
upload:
$(GRADLE_BIN) publishToSonatype closeAndReleaseSonatypeStagingRepository