-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: improve documentation (#15)
- Loading branch information
Showing
9 changed files
with
104 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,12 @@ else | |
endif | ||
|
||
GOBIN ?= $(shell go env GOPATH)/bin | ||
GOMAKE ?= github.com/tkrop/[email protected].21 | ||
GOMAKE ?= github.com/tkrop/[email protected].22 | ||
TARGETS := $(shell command -v go-make >/dev/null || \ | ||
go install $(GOMAKE) && go-make targets) | ||
|
||
# Declare all targets phony to make them available for auto-completion. | ||
.PHONY: $(TARGETS) | ||
.PHONY:: $(TARGETS) | ||
|
||
# Delegate all targets to go-make in a single call suppressing other targets. | ||
$(eval $(wordlist 1,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))::;@:) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,6 +239,7 @@ MOCKS := $(shell for TARGET in $(MOCK_TARGETS); \ | |
TARGETS_PUBLISH := $(addprefix publish-, all $(COMMANDS)) | ||
TARGETS_TEST_INIT := test-clean init-sources init-hooks | ||
TARGETS_INIT_MAKE := $(addprefix init/,$(INIT_MAKE)) | ||
TARGETS_INIT_ALL := $(addprefix init/,$(sort $(INIT_MAKE) $(UPDATE_MAKE))) | ||
TARGETS_INIT_CODACY := $(addprefix init-, $(CODACY_BINARIES)) | ||
TARGETS_LINT_CODACY_CLIENTS := $(addprefix lint-, $(CODACY_CLIENTS)) | ||
TARGETS_LINT_CODACY_BINARIES := $(addprefix lint-, $(CODACY_BINARIES)) | ||
|
@@ -367,8 +368,8 @@ targets:: | |
else cat -; fi || true; | ||
|
||
#@ create a clone of the base repository to update from. | ||
BASE := [email protected]:tkrop/go-make.git | ||
setup/base:: | ||
BASE ?= [email protected]:tkrop/go-make.git | ||
setup/base:: # TODO: support cloning of a distinct revision. | ||
@$(eval BASEDIR = $(shell mktemp -d)) ( \ | ||
trap "rm -rf $${DIR}" INT TERM EXIT; \ | ||
while pgrep $(MAKE) > /dev/null; do sleep 1; done; \ | ||
|
@@ -387,7 +388,7 @@ git-message = \ | |
sed -E 's/^.*\(?([^() ]*\#[0-9]+)\)?.*$$/\1/')"; \ | ||
NUMBER="$${COMMIT\#\#*\#}"; CONTEXT="$${COMMIT%%\#*}"; \ | ||
MESSAGE="$${MESSAGE} ($${CONTEXT}\#$$((NUMBER+1)))"; \ | ||
fi; \ | ||
fi \ | ||
|
||
#@ shows the git log as pretty printed graph. | ||
git-graph:: | ||
|
@@ -406,9 +407,9 @@ git-create-fix git-create-chore git-create-feature:: git-create-%: | |
@BRANCH="$(firstword $(RUNARGS))"; \ | ||
MESSAGE="$(wordlist 2,$(words $(RUNARGS)),$(RUNARGS))"; \ | ||
if [ -z "$${BRANCH}" ]; then BRANCH="update-deps"; fi; \ | ||
git checkout -B "$${BRANCH}"; $(call git-message,$*) \ | ||
git commit --message "$${MESSAGE}"; \ | ||
git push --set-upstream origin "$${BRANCH}"; | ||
$(call git-message,$*); \ | ||
git checkout -B "$${BRANCH}" && git commit --message "$${MESSAGE}" && \ | ||
git push --set-upstream origin "$${BRANCH}" || git checkout $${BRANCH}; | ||
#@ <message> # commits the current change set using the given message using current issue. | ||
git-commit:: git-commit-feature | ||
git-commit-fix git-commit-chore git-commit-feature:: git-commit-%: | ||
|
@@ -469,7 +470,7 @@ $(TARGETS_INIT_CODACY):: init-%: | |
|
||
#@ initialize project by copying config files from template. | ||
init-make:: $(TARGETS_INIT_MAKE) $(TARGETS_UPDATE_MAKE) | ||
$(TARGETS_INIT_MAKE):: init/%: setup/base | ||
$(TARGETS_INIT_ALL):: init/%: setup/base | ||
@DIR="$$(pwd)"; FILE="$*"; FILE="$${FILE##$(DIR_CONFIG)}"; \ | ||
cd "$(BASEDIR)"; git show HEAD:config/$${FILE} > $${DIR}/$${FILE} 2>/dev/null; \ | ||
|
||
|
@@ -1225,10 +1226,6 @@ $(TARGETS_CLEAN_RUN):: clean-run-%: run-clean-% | |
|
||
## Update: targets to update tools, configs, and dependencies. | ||
|
||
# TODO: | ||
# 'update-deps' check how to utilize: 'go list -m -u -mod=mod all' | ||
|
||
|
||
#@ update default or customized update targets. | ||
update:: $(TARGETS_UPDATE) | ||
#@ check default or customized update targets for updates. | ||
|
@@ -1277,6 +1274,8 @@ update-list = \ | |
go list -m -u -mod=mod $(2) | grep "\[.*\]$$" \ | ||
) | sort -u | sed "s/\]//g; s/\[/=> /" | ||
|
||
# TODO: check how to utilize: 'go list -m -u -mod=mod all' in 'update-deps'. | ||
|
||
#@ [major|pre|minor] # update minor (and major) dependencies to latest versions. | ||
update-deps:: test-go update/go.mod | ||
update/go.mod:: $(GOBIN)/gomajor | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.0.21 | ||
0.0.22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,12 @@ else | |
endif | ||
|
||
GOBIN ?= $(shell go env GOPATH)/bin | ||
GOMAKE ?= github.com/tkrop/[email protected].21 | ||
GOMAKE ?= github.com/tkrop/[email protected].22 | ||
TARGETS := $(shell command -v go-make >/dev/null || \ | ||
go install $(GOMAKE) && go-make targets) | ||
|
||
# Declare all targets phony to make them available for auto-completion. | ||
.PHONY: $(TARGETS) | ||
.PHONY:: $(TARGETS) | ||
|
||
# Delegate all targets to go-make in a single call suppressing other targets. | ||
$(eval $(wordlist 1,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))::;@:) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,6 +239,7 @@ MOCKS := $(shell for TARGET in $(MOCK_TARGETS); \ | |
TARGETS_PUBLISH := $(addprefix publish-, all $(COMMANDS)) | ||
TARGETS_TEST_INIT := test-clean init-sources init-hooks | ||
TARGETS_INIT_MAKE := $(addprefix init/,$(INIT_MAKE)) | ||
TARGETS_INIT_ALL := $(addprefix init/,$(sort $(INIT_MAKE) $(UPDATE_MAKE))) | ||
TARGETS_INIT_CODACY := $(addprefix init-, $(CODACY_BINARIES)) | ||
TARGETS_LINT_CODACY_CLIENTS := $(addprefix lint-, $(CODACY_CLIENTS)) | ||
TARGETS_LINT_CODACY_BINARIES := $(addprefix lint-, $(CODACY_BINARIES)) | ||
|
@@ -367,8 +368,8 @@ targets:: | |
else cat -; fi || true; | ||
|
||
#@ create a clone of the base repository to update from. | ||
BASE := [email protected]:tkrop/go-make.git | ||
setup/base:: | ||
BASE ?= [email protected]:tkrop/go-make.git | ||
setup/base:: # TODO: support cloning of a distinct revision. | ||
@$(eval BASEDIR = $(shell mktemp -d)) ( \ | ||
trap "rm -rf $${DIR}" INT TERM EXIT; \ | ||
while pgrep $(MAKE) > /dev/null; do sleep 1; done; \ | ||
|
@@ -387,7 +388,7 @@ git-message = \ | |
sed -E 's/^.*\(?([^() ]*\#[0-9]+)\)?.*$$/\1/')"; \ | ||
NUMBER="$${COMMIT\#\#*\#}"; CONTEXT="$${COMMIT%%\#*}"; \ | ||
MESSAGE="$${MESSAGE} ($${CONTEXT}\#$$((NUMBER+1)))"; \ | ||
fi; \ | ||
fi \ | ||
|
||
#@ shows the git log as pretty printed graph. | ||
git-graph:: | ||
|
@@ -406,9 +407,9 @@ git-create-fix git-create-chore git-create-feature:: git-create-%: | |
@BRANCH="$(firstword $(RUNARGS))"; \ | ||
MESSAGE="$(wordlist 2,$(words $(RUNARGS)),$(RUNARGS))"; \ | ||
if [ -z "$${BRANCH}" ]; then BRANCH="update-deps"; fi; \ | ||
git checkout -B "$${BRANCH}"; $(call git-message,$*) \ | ||
git commit --message "$${MESSAGE}"; \ | ||
git push --set-upstream origin "$${BRANCH}"; | ||
$(call git-message,$*); \ | ||
git checkout -B "$${BRANCH}" && git commit --message "$${MESSAGE}" && \ | ||
git push --set-upstream origin "$${BRANCH}" || git checkout $${BRANCH}; | ||
#@ <message> # commits the current change set using the given message using current issue. | ||
git-commit:: git-commit-feature | ||
git-commit-fix git-commit-chore git-commit-feature:: git-commit-%: | ||
|
@@ -469,7 +470,7 @@ $(TARGETS_INIT_CODACY):: init-%: | |
|
||
#@ initialize project by copying config files from template. | ||
init-make:: $(TARGETS_INIT_MAKE) $(TARGETS_UPDATE_MAKE) | ||
$(TARGETS_INIT_MAKE):: init/%: setup/base | ||
$(TARGETS_INIT_ALL):: init/%: setup/base | ||
@DIR="$$(pwd)"; FILE="$*"; FILE="$${FILE##$(DIR_CONFIG)}"; \ | ||
cd "$(BASEDIR)"; git show HEAD:config/$${FILE} > $${DIR}/$${FILE} 2>/dev/null; \ | ||
|
||
|
@@ -1225,10 +1226,6 @@ $(TARGETS_CLEAN_RUN):: clean-run-%: run-clean-% | |
|
||
## Update: targets to update tools, configs, and dependencies. | ||
|
||
# TODO: | ||
# 'update-deps' check how to utilize: 'go list -m -u -mod=mod all' | ||
|
||
|
||
#@ update default or customized update targets. | ||
update:: $(TARGETS_UPDATE) | ||
#@ check default or customized update targets for updates. | ||
|
@@ -1277,6 +1274,8 @@ update-list = \ | |
go list -m -u -mod=mod $(2) | grep "\[.*\]$$" \ | ||
) | sort -u | sed "s/\]//g; s/\[/=> /" | ||
|
||
# TODO: check how to utilize: 'go list -m -u -mod=mod all' in 'update-deps'. | ||
|
||
#@ [major|pre|minor] # update minor (and major) dependencies to latest versions. | ||
update-deps:: test-go update/go.mod | ||
update/go.mod:: $(GOBIN)/gomajor | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters