Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add makefile to spring boot qs #762

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stitakis
Copy link
Member

fixes #761

cat ${SOURCE_DIR}/templates/gradle-maven-publish.template >> ${TARGET_DIR}/build.gradle

.PHONY: customise-build-gradle

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for using this locally it would be nice to have an additional target that does all three existing targets in one, basically mimicking the jenkins stage where they are being called in.
And if you want to be fancy you could add a help target ;-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case you have no help target at hand, I used this code once in the past:

### Based on https://gist.github.com/prwhite/8168133#gistcomment-2278355

# COLORS
GREEN  := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE  := $(shell tput -Txterm setaf 7)
RESET  := $(shell tput -Txterm sgr0)

## Show this help
help:
	@echo ''
	@echo 'Usage:'
	@echo '  make <${GREEN}target${RESET}>'
	@echo ''
	@echo 'Targets:'
	@awk '/^[0-9a-zA-Z_-]+:|^# .*/ { \
		helpMessage = match(lastLine, /^## (.*)/); \
		if (helpMessage) { \
			helpCommand = substr($$1, 0, index($$1, ":")-1); \
			helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
			printf "  ${GREEN}%-30s${RESET} %s\n", helpCommand, helpMessage; \
		} else { \
			printf "\n"; \
		} \
	} \
	{ lastLine = $$0 }' $(MAKEFILE_LIST)
.PHONY: help

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I've switched to this short version lately: https://github.com/opendevstack/ods-pipeline/blob/master/Makefile#L15

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I've switched to this short version lately: https://github.com/opendevstack/ods-pipeline/blob/master/Makefile#L15

cool! but this does require having awk installed, no? Not every unix distro has it installed out of the box AFAIK.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, I think I'm mixing this up now with another unix tool

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, I'll add this and also one target that calls all other.
@michaelsauter @renedupont do you think it might be worth to rename the target names to reflect some sort of standard targets/interface? Like create-project (calls all targets), create-project-template, update-project-template, etc...?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes why not
you only have to come up with names that fit all quickstarters :)

It is already hard for this qs here - if I see it right you would rename the current create-project target into create-project-template, but from my point of view what is actually happening in their is not a creation of a template but rather the initialization of the project (the service is calles spring initializr).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow local java project creation of quickstarter be-java-springboot
3 participants