-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add mirc implement that adapter go-mir v3
- Loading branch information
Showing
197 changed files
with
11,725 additions
and
22 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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/mirc | ||
/gin | ||
/chi | ||
/chi-v5 | ||
/mux | ||
/httprouter | ||
/macaron | ||
/echo | ||
/iris | ||
/fiber | ||
/fiber-v2 | ||
/release/* |
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
GOFMT ?= gofmt -s -w | ||
GOFILES := $(shell find . -name "*.go" -type f) | ||
|
||
LDFLAGS += -X "github.com/alimy/mir/mirc/v3/version.BuildTime=$(shell date -v+8H -u '+%Y-%m-%d %H:%M:%S %Z+8')" | ||
LDFLAGS += -X "github.com/alimy/mir/mirc/v3/version.GitHash=$(shell git rev-parse --short=12 HEAD)" | ||
|
||
RELEASE_ROOT = release | ||
RELEASE_LINUX_AMD64 = $(RELEASE_ROOT)/linux-amd64/mirc | ||
RELEASE_DARWIN_AMD64 = $(RELEASE_ROOT)/darwin-amd64/mirc | ||
RELEASE_DARWIN_ARM64 = $(RELEASE_ROOT)/darwin-arm64/mirc | ||
RELEASE_WINDOWS_AMD64 = $(RELEASE_ROOT)/windows-amd64/mirc | ||
|
||
.PHONY: build | ||
build: fmt | ||
go build -ldflags '$(LDFLAGS)' -o mirc main.go | ||
|
||
.PHONY: release | ||
release: linux-amd64 darwin-amd64 darwin-arm64 windows-x64 | ||
cp ../LICENSE README.md $(RELEASE_LINUX_AMD64) | ||
cp ../LICENSE README.md $(RELEASE_DARWIN_AMD64) | ||
cp ../LICENSE README.md $(RELEASE_DARWIN_ARM64) | ||
cp ../LICENSE README.md $(RELEASE_WINDOWS_AMD64) | ||
cd $(RELEASE_LINUX_AMD64)/.. && rm -f *.zip && zip -r mirc-linux_amd64.zip mirc && cd - | ||
cd $(RELEASE_DARWIN_AMD64)/.. && rm -f *.zip && zip -r mirc-darwin_amd64.zip mirc && cd - | ||
cd $(RELEASE_DARWIN_ARM64)/.. && rm -f *.zip && zip -r mirc-darwin_arm64.zip mirc && cd - | ||
cd $(RELEASE_WINDOWS_AMD64)/.. && rm -f *.zip && zip -r mirc-windows_amd64.zip mirc && cd - | ||
|
||
.PHONY: linux-amd64 | ||
linux-amd64: | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '$(LDFLAGS)' -o $(RELEASE_LINUX_AMD64)/mirc main.go | ||
|
||
.PHONY: darwin-amd64 | ||
darwin-amd64: | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags '$(LDFLAGS)' -o $(RELEASE_DARWIN_AMD64)/mirc main.go | ||
|
||
.PHONY: darwin-arm64 | ||
darwin-arm64: | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags '$(LDFLAGS)' -o $(RELEASE_DARWIN_ARM64)/mirc main.go | ||
|
||
.PHONY: windows-x64 | ||
windows-x64: | ||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags '$(LDFLAGS)' -o $(RELEASE_WINDOWS_AMD64)/mirc main.go | ||
|
||
.PHONY: fmt | ||
fmt: | ||
$(GOFMT) $(GOFILES) | ||
|
||
.PHONY: check-all | ||
check-all: check-debug-all | ||
|
||
STYLES = chi hertz echo fiber fiber-v2 gin httprouter iris macaron mux | ||
.PHONY: check-debug-all | ||
check-debug-all: | ||
@for target in $(STYLES); do \ | ||
echo "==========[ processing $$target ]=========="; \ | ||
rm -rf $$target; \ | ||
./mirc new --mir ../../ --style $$target --dst $$target; \ | ||
cd $$target; \ | ||
make mod-tidy; \ | ||
cd -; \ | ||
echo ""; \ | ||
done | ||
|
||
.PHONY: check-release-all | ||
check-release-all: | ||
@for target in $(STYLES); do \ | ||
echo "==========[ processing $$target ]=========="; \ | ||
rm -rf $$target; \ | ||
./mirc new --style $$target --dst $$target; \ | ||
cd $$target; \ | ||
make mod-tidy; \ | ||
cd -; \ | ||
echo ""; \ | ||
done | ||
|
||
.PHONY: clean | ||
clean: | ||
-rm -rf $(STYLES) |
Oops, something went wrong.