keep more data in flattened pom for Central
[memoization.java.git] / Makefile
blobbba1dec0039bc9965a83302be1d880fbfba4cc7f
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
5 ############
6 # PROLOGUE #
7 ############
8 MAKEFLAGS += --warn-undefined-variables
9 SHELL = /bin/sh
10 .SHELLFLAGS := -eu -o pipefail -c
11 .DEFAULT_GOAL := all
12 .DELETE_ON_ERROR:
13 .SUFFIXES:
15 ######################
16 # INTERNAL VARIABLES #
17 ######################
18 TIMESTAMP := $(shell /bin/date "+%Y%m%d%H%M%S")
19 CURRENT_YEAR := $(shell /bin/date "+%Y")
20 USERID := $(shell id -u)
21 GREEN := $(shell tput -Txterm setaf 2)
22 WHITE := $(shell tput -Txterm setaf 7)
23 YELLOW := $(shell tput -Txterm setaf 3)
24 RESET := $(shell tput -Txterm sgr0)
26 ######################
27 # INTERNAL FUNCTIONS #
28 ######################
29 HELP_FUN = \
30 %help; \
31 while(<>) { push @{$$help{$$2 // 'targets'}}, [$$1, $$3] if /^([a-zA-Z\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
32 print "usage: make [target]\n\n"; \
33 for (sort keys %help) { \
34 print "${WHITE}$$_:${RESET}\n"; \
35 for (@{$$help{$$_}}) { \
36 $$sep = " " x (32 - length $$_->[0]); \
37 print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
38 }; \
39 print "\n"; }
41 ###############
42 # GOALS/RULES #
43 ###############
44 .PHONY: all
45 all: help
47 help: ##@other Show this help
48 @perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
50 .PHONY: sonar-analysis
51 sonar-analysis: ##@sebhoss Perform Sonarqube analysis
52 # http://docs.sonarqube.org/display/SONAR/Analyzing+with+Maven
53 mvn clean install
54 mvn sonar:sonar -Dsonar.host.url=http://localhost:59000 -Dsonar.pitest.mode=reuseReport
56 .PHONY: sign-waiver
57 sign-waiver: ##@contributing Sign the WAIVER
58 gpg2 --no-version --armor --sign AUTHORS/WAIVER
60 .PHONY: docker-verify
61 docker-verify: ##@docker Verify project in pre-defined build environment
62 docker-compose -f build/docker/build-environment.yml run --rm verify-project
63 # since we are 'root' inside the container, we need another container run to cleanup after ourselves
64 docker-compose -f build/docker/build-environment.yml run --rm clean-project
65 # findbugs likes to create these
66 rm -rf ?/
68 .PHONY: update-parent
69 update-parent: ##@maintenance Updates the Maven parent to its latest version
70 mvn versions:update-parent -U -DgenerateBackupPoms=false
71 git add pom.xml
72 git commit pom.xml -s -S -m 'Update to latest parent'
74 .PHONY: update-maintenance-badge
75 update-maintenance-badge: ##@maintenance Updates the maintenance badge to the current year
76 sed -i -e "s/maintenance\/yes\/[0-9]*/maintenance\/yes\/$(CURRENT_YEAR)/" README.asciidoc
77 git add README.asciidoc
78 git commit pom.xml -s -S -m 'Update maintenance badge'
80 .PHONY: release-into-local-nexus
81 release-into-local-nexus: ##@release Release all artifacts into a local nexus
82 mvn clean deploy scm:tag -Prelease -Drevision=$(TIMESTAMP) -DpushChanges=false -DskipLocalStaging=true -Drelease=local
84 .PHONY: release-into-sonatype-nexus
85 release-into-sonatype-nexus: ##@release Release all artifacts into Maven Central (through Sonatype OSSRH)
86 mvn clean deploy scm:tag -Prelease -Drevision=$(TIMESTAMP) -DpushChanges=false -Drelease=sonatype
87 git push --tags origin master