-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make mage-tools easy to understand
- Loading branch information
1 parent
6bdd4c3
commit 3444493
Showing
30 changed files
with
396 additions
and
293 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 was deleted.
Oops, something went wrong.
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,49 +1,10 @@ | ||
mage_folder := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) | ||
mage_generated_path := $(mage_folder)/tools/mgmake | ||
mage_tools_path := $(mage_folder)/tools | ||
mage_targets_file := $(mage_generated_path)/targets.mk | ||
mage := $(mage_generated_path)/local-mage | ||
mgmake := $(mage_folder)/mgmake_gen.go | ||
mgmain := $(mage_folder)/mgmain_gen.go | ||
mage_dir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) | ||
mage_tools_path := $(mage_dir)/tools | ||
mage := $(mage_tools_path)/mgmake/magefile | ||
|
||
define mgmake_content | ||
// Code generated by Mage-tools. DO NOT EDIT. | ||
//go:build mage | ||
// +build mage | ||
|
||
package main | ||
|
||
// mage:import | ||
import _ "go.einride.tech/mage-tools/mgmake" | ||
endef | ||
|
||
define mgmain_content | ||
// Code generated by Mage-tools. DO NOT EDIT. | ||
//go:build ignore | ||
// +build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
"github.com/magefile/mage/mage" | ||
) | ||
|
||
func main() { os.Exit(mage.Main()) } | ||
endef | ||
|
||
include $(mage_targets_file) | ||
|
||
$(mage_targets_file): $(mage_folder)/go.mod $(shell find $(mage_folder)/.. -type f -name '*.go') | ||
@git clean -fdx $(mage_generated_path) | ||
@mkdir -p $(mage_generated_path) | ||
$(file > $(mgmake),$(mgmake_content)) | ||
$(file > $(mgmain),$(mgmain_content)) | ||
@cd $(mage_folder) && \ | ||
go mod tidy && \ | ||
go run $(notdir $(mgmain)) -compile $(mage) && \ | ||
$(mage) generateMakefile $(@) | ||
$(mage): $(mage_dir)/go.mod $(shell find $(mage_dir)/.. -type f -name '*.go') | ||
@cd $(mage_dir) && go run ../main.go gen | ||
|
||
.PHONY: mage-clean | ||
mage-clean: | ||
@git clean -fdx $(mage_generated_path) $(mage_tools_path) | ||
@git clean -fdx $(mage_dir) |
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,5 +1,37 @@ | ||
.PHONY: all | ||
all: $(mage_targets) | ||
# Code generated by Mage-tools. DO NOT EDIT. | ||
|
||
.DEFAULT_GOAL := all | ||
|
||
include .mage/tools.mk | ||
include $(mage_targets) | ||
|
||
.PHONY: all | ||
all: $(mage) | ||
@$(mage) all | ||
|
||
.PHONY: cog-check | ||
cog-check: $(mage) | ||
@$(mage) cogCheck | ||
|
||
.PHONY: format-markdown | ||
format-markdown: $(mage) | ||
@$(mage) formatMarkdown | ||
|
||
.PHONY: git-verify-no-diff | ||
git-verify-no-diff: $(mage) | ||
@$(mage) gitVerifyNoDiff | ||
|
||
.PHONY: go-mod-tidy | ||
go-mod-tidy: $(mage) | ||
@$(mage) goModTidy | ||
|
||
.PHONY: go-test | ||
go-test: $(mage) | ||
@$(mage) goTest | ||
|
||
.PHONY: golangci-lint | ||
golangci-lint: $(mage) | ||
@$(mage) golangciLint | ||
|
||
.PHONY: goreview | ||
goreview: $(mage) | ||
@$(mage) goreview |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,49 +1,10 @@ | ||
mage_folder := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) | ||
mage_generated_path := $(mage_folder)/tools/mgmake | ||
mage_tools_path := $(mage_folder)/tools | ||
mage_targets_file := $(mage_generated_path)/targets.mk | ||
mage := $(mage_generated_path)/local-mage | ||
mgmake := $(mage_folder)/mgmake_gen.go | ||
mgmain := $(mage_folder)/mgmain_gen.go | ||
mage_dir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) | ||
mage_tools_path := $(mage_dir)/tools | ||
mage := $(mage_tools_path)/mgmake/magefile | ||
|
||
define mgmake_content | ||
// Code generated by Mage-tools. DO NOT EDIT. | ||
//go:build mage | ||
// +build mage | ||
|
||
package main | ||
|
||
// mage:import | ||
import _ "go.einride.tech/mage-tools/mgmake" | ||
endef | ||
|
||
define mgmain_content | ||
// Code generated by Mage-tools. DO NOT EDIT. | ||
//go:build ignore | ||
// +build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
"github.com/magefile/mage/mage" | ||
) | ||
|
||
func main() { os.Exit(mage.Main()) } | ||
endef | ||
|
||
include $(mage_targets_file) | ||
|
||
$(mage_targets_file): $(mage_folder)/go.mod $(mage_folder)/*.go | ||
@git clean -fdx $(mage_generated_path) | ||
@mkdir -p $(mage_generated_path) | ||
$(file > $(mgmake),$(mgmake_content)) | ||
$(file > $(mgmain),$(mgmain_content)) | ||
@cd $(mage_folder) && \ | ||
go mod tidy && \ | ||
go run $(notdir $(mgmain)) -compile $(mage) && \ | ||
$(mage) generateMakefile $(@) | ||
$(mage): $(mage_dir)/go.mod $(mage_dir)/*.go | ||
@cd $(mage_dir) && go run go.einride.tech/mage-tools gen | ||
|
||
.PHONY: mage-clean | ||
mage-clean: | ||
@git clean -fdx $(mage_generated_path) $(mage_tools_path) | ||
@git clean -fdx $(mage_dir) |
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,5 +1,3 @@ | ||
.PHONY: all | ||
all: $(mage_targets) | ||
# Code generated by Mage-tools. DO NOT EDIT. | ||
|
||
include .mage/tools.mk | ||
include $(mage_targets) |
Oops, something went wrong.