Skip to content

Commit

Permalink
KOGITO-8400 Setup Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
radtriste committed Aug 11, 2023
1 parent 35abd5f commit 8a561e8
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 2 deletions.
75 changes: 75 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
mvn_opts=
mvn_cmd=mvn $(mvn_opts)

default: help

.PHONY: build
## Build the project
build:
$(mvn_cmd) clean install

.PHONY: quick-build
## Perform a quick build of the project
quick-build:
$(mvn_cmd) clean install -Dquickly

.PHONY: test
## Launch full testing
test:
$(mvn_cmd) clean verify

.PHONY: quick-test
## Launch unit testing
quick-test:
$(mvn_cmd) clean verify -DquickTests

.PHONY: deploy
## Deploy the project
deploy:
$(mvn_cmd) deploy

.PHONY: clean
## Clean the project
clean:
$(mvn_cmd) clean

.PHONY: mvn
## Execute a Maven command with project configuration. Needs the `cmd` argument set
mvn:
$(mvn_cmd) ${cmd}

## Update the quarkus version. Needs the `quarkus_version` argument set
update-quarkus:
export BUILD_MVN_OPTS=${mvn_opts} && .ci/environments/common/update_quarkus.sh ${quarkus_version}
$(MAKE) show-diff

## Prepare the repository for a specific environment. Needs the `environment` argument set
prepare-env:
export BUILD_MVN_OPTS=${mvn_opts} && .ci/environments/update.sh ${environment}

## Show project dependencies
tree:
$(mvn_cmd) dependency:tree

## Show Git diff
show-diff:
git status
git diff

## This help screen
help:
@printf "Available targets:\n\n"
@awk '/^[a-zA-Z\-_0-9%:\\]+/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = $$1; \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
gsub("\\\\", "", helpCommand); \
gsub(":+$$", "", helpCommand); \
printf " \x1b[32;01m%-35s\x1b[0m %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
@printf "\n"
@printf "All Maven commands can include some maven options via the \`mvn_opts\` argument !"
@printf "\n"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ There are two ways to activate such profile during maven build:

The following two commands will execute tests on machine with locale different than _en_US_:

1. `mvn clean verify -Ptest-en`
2. `mvn clean verify -DTestEn`
1. `make test -Ptest-en`
2. `make test -DTestEn`



0 comments on commit 8a561e8

Please sign in to comment.