-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
147 lines (105 loc) · 3.98 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
##################################################################
# Project Convenience Makefile Wrapper for Maven #
##################################################################
# This makefile is just a convenience wrapper for the Maven
# program. The actual building rules for this project may
# be found in the Maven "pom.xml" file located in this folder.
######################### DEFINITIONS ############################
# Define the commandline invocation of Maven if necessary:
ifeq ($(MVN),)
MVN := mvn
endif
ifeq ($(GIT),)
GIT := git
endif
ifeq ($(RELEASE_VERSION),)
RELEASE_VERSION := $(shell xmllint --xpath "/*[local-name() = 'project']/*[local-name() = 'version']/text()" pom.xml | perl -pe 's/-SNAPSHOT//')
endif
ifeq ($(NEXT_VERSION),)
NEXT_VERSION := $(shell echo $(RELEASE_VERSION) | perl -pe 's{^(([0-9]\.)+)?([0-9]+)$$}{$$1 . ($$3 + 1)}e')
endif
ifneq (,$(findstring -SNAPSHOT,$(RELEASE_VERSION)))
RELEASE_VERSION_NSNP = $(shell echo $(RELEASE_VERSION) | perl -pe 's/-SNAPSHOT//')
else
RELEASE_VERSION_NSNP = $(RELEASE_VERSION)
endif
ifeq (,$(findstring -SNAPSHOT,$(NEXT_VERSION)))
NEXT_VERSION_SNP = $(NEXT_VERSION)-SNAPSHOT
else
NEXT_VERSION_SNP = $(NEXT_VERSION)
endif
######################## BUILD TARGETS ###########################
.PHONY: all package compile check test doc docs javadoc clean help
all:
@ $(MVN) $(MVNFLAGS) package
clean:
@ $(MVN) $(MVNFLAGS) clean
compile:
@ $(MVN) $(MVNFLAGS) compile
test:
@ $(MVN) $(MVNFLAGS) test
qulice:
@ $(MVN) clean install -Pqulice
install:
@ $(MVN) clean install
site:
@ $(MVN) site -Psite
gh-pages:
@ $(MVN) clean test install site-deploy -Pgh-pages
doc:
@ $(MVN) $(MVNFLAGS) javadoc:javadoc
package:
@ $(MVN) $(MVNFLAGS) package
deploy-staging:
@ $(MVN) clean deploy
release-prepare:
@ $(MVN) release:clean release:prepare
release-perform:
@ $(MVN) release:perform -Prelease-sign
release-rollback:
@ $(MVN) release:rollback
release-all:
@ $(MVN) release:clean release:prepare release:perform -Prelease-sign
release-silent:
@ $(MVN) -B release:clean release:prepare release:perform -Prelease-sign
manual-release-nodeploy: version-release git-checkin-release git-tag-release version-bump git-checkin-next
manual-release: version-release git-checkin-release nexus-deploy git-tag-release version-bump git-checkin-next
version-bump:
@echo setting next version: $(NEXT_VERSION_SNP)
@ $(MVN) versions:set -DgenerateBackupPoms=false -DnewVersion=$(NEXT_VERSION_SNP)
version-release:
@echo setting release version: $(RELEASE_VERSION_NSNP)
@ $(MVN) versions:set -DgenerateBackupPoms=false -DnewVersion=$(RELEASE_VERSION_NSNP)
nexus-deploy:
@echo deploying
@ $(MVN) -Pnexus-release -Prelease-sign clean verify source:jar javadoc:jar gpg:sign deploy
git-checkin-release:
@ $(MVN) scm:checkin -Dmessage="preparing release - ${RELEASE_VERSION_NSNP}"
git-tag-release:
@ $(MVN) scm:tag -Dtag="v${RELEASE_VERSION_NSNP}"
git-checkin-next:
@ $(MVN) scm:checkin -Dmessage="preparing next version - ${NEXT_VERSION_SNP}"
#clean:
# @- rm -rf ./bin/*
# @- rm -rf ./build/*
# @- rm -rf ./docs/*
update-versions:
@ $(MVN) versions:update-properties
distclean: clean ;
docs: doc ;
javadoc: doc ;
documentation: doc ;
help:
@ echo "Usage : make <target>"
@ echo "Targets :"
@ echo " all ........... Builds the project"
@ echo " clean ......... Removes build products"
@ echo " compile ....... Compiles all Java files"
@ echo " test .......... Builds and runs all unit tests"
@ echo " qulice ....... Builds and runs various static code analysis tools"
@ echo " install .......... Builds and installs to local repository"
@ echo " docs .......... Generates project documentation."
@ echo " deploy-staging .......... Deploys snapshot to staging"
@ echo " release .......... Releases to maven central (interactive)"
@ echo " release-silent .......... Releases to maven central (non-interactive)"
@ echo " help .......... Prints this help message"