1 # http://www.gnu.org/software/make/manual/make.html
2 # https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html#Makefile-Basics
3 # http://clarkgrubb.com/makefile-style-guide
8 MAKEFLAGS
+= --warn-undefined-variables
10 .SHELLFLAGS
:= -eu
-o pipefail
-c
15 ######################
16 # INTERNAL VARIABLES #
17 ######################
18 TIMESTAMPED_VERSION
:= $(shell /bin
/date
"+%Y.%m.%d-%H%M%S")
19 CURRENT_DATE
:= $(shell /bin
/date
"+%Y-%m-%d")
20 USERNAME
:= $(shell id
-u
-n
)
21 USERID
:= $(shell id
-u
)
22 GREEN
:= $(shell tput
-Txterm setaf
2)
23 WHITE
:= $(shell tput
-Txterm setaf
7)
24 YELLOW
:= $(shell tput
-Txterm setaf
3)
25 RESET
:= $(shell tput
-Txterm sgr0
)
27 ######################
28 # INTERNAL FUNCTIONS #
29 ######################
32 while
(<>) { push @
{$$help{$$2 // 'targets'}}, [$$1, $$3] if
/^
([a-zA-Z\
-]+)\s
*:.
*\
#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
33 print "usage: make [target]\n\n"; \
34 for
(sort keys
%help
) { \
35 print "${WHITE}$$_:${RESET}\n"; \
36 for
(@
{$$help{$$_}}) { \
37 $$sep = " " x
(32 - length
$$_->[0]); \
38 print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
48 help
: ##@other Show this help
49 @perl
-e
'$(HELP_FUN)' $(MAKEFILE_LIST
)
52 install: ##@hacking Install all artifacts into local repository
56 test: ##@hacking Run all tests
59 .PHONY
: display-dependency-updates
60 display-dependency-updates
: ##@maintenance Display dependency updates in 'maven-boms'
61 mvn versions
:display-dependency-updates \
63 --projects maven-boms \
64 --also-make-dependents
66 .PHONY
: display-plugin-updates
67 display-plugin-updates
: ##@maintenance Display plugin updates in 'maven-parents'
68 mvn versions
:display-plugin-updates \
70 --projects maven-parents \
71 --also-make-dependents
73 .PHONY
: display-property-updates
74 display-property-updates
: ##@maintenance Display property updates in all modules
75 mvn versions
:display-property-updates \
78 .PHONY
: update-properties
79 update-properties
: ##@maintenance Update all properties to their latest versions
80 mvn versions
:update-properties \
82 -DgenerateBackupPoms
=false
83 git add pom.xml
**/**/pom.xml
84 git commit
-s
-S
-m
'Update properties to latest version'
86 .PHONY
: sonar-analysis
87 sonar-analysis
: ##@sebhoss Perform Sonarqube analysis
88 # http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Scanner+for+Maven
91 -Dsonar.host.url
=https
://quality.metio.wtf
/ \
92 -Dsonar.pitest.mode
=reuseReport
95 docker-verify
: create-build-environment
##@docker Verify project in pre-defined build environment
97 -f build
/docker
/build-environment.yml \
98 run
--rm verify-project
100 # see https://github.com/docker/docker/issues/10324 for NEXUS_HOST trick
101 .PHONY
: create-build-environment
102 create-build-environment
: ##@docker Creates a pre-defined build environment
104 -f build
/docker
/build-environment.yml \
105 build maven-build-environment
108 sign-waiver
: ##@contributing Sign the WAIVER
109 gpg2
--no-version
--armor
--sign AUTHORS
/WAIVER
110 mv AUTHORS
/WAIVER.asc AUTHORS
/WAIVER-signed-by-
$(USERNAME
)-$(CURRENT_DATE
).asc
112 .PHONY
: release-into-local-nexus
113 release-into-local-nexus
: ##@release Release all artifacts into a local nexus
115 -DnewVersion
=$(TIMESTAMPED_VERSION
) \
116 -DgenerateBackupPoms
=false
117 -mvn
clean deploy scm
:tag \
118 -DpushChanges
=false \
119 -DskipLocalStaging
=true \
122 -DnewVersion
=9999.99.99-SNAPSHOT \
123 -DgenerateBackupPoms
=false
125 .PHONY
: release-into-sonatype-nexus
126 release-into-sonatype-nexus
: ##@release Release all artifacts into Maven Central (through Sonatype OSSRH)
128 -DnewVersion
=$(TIMESTAMPED_VERSION
) \
129 -DgenerateBackupPoms
=false
130 -mvn
clean pgp
:sign deploy scm
:tag \
131 -DpushChanges
=false \
137 -DnewVersion
=9999.99.99-SNAPSHOT \
138 -DgenerateBackupPoms
=false