diff --git a/.gitignore b/.gitignore index 7fca59eb..2854ddc7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ _datafiles/**/plugin-data/* **/config-overrides.yaml **/.roundcount vendor/ -modules/all-modules.go server.crt server.key tmp-gomud.exe diff --git a/Makefile b/Makefile index 935ca5b0..75427807 100644 --- a/Makefile +++ b/Makefile @@ -36,17 +36,14 @@ docker-%: .PHONY: build_rpi_zero2w build_rpi_zero2w: generate ### Build a binary for a raspberry pi zero 2w env GOOS=linux GOARCH=arm64 go build -o $(BIN)-rpi - make ungenerate .PHONY: build_win64 build_win64: generate ### Build a binary for 64bit windows env GOOS=windows GOARCH=amd64 go build -o $(BIN)-win64.exe - make ungenerate .PHONY: build_linux64 build_linux64: generate ### Build a binary for linux env GOOS=linux GOARCH=amd64 go build -o $(BIN)-linux64 - make ungenerate .PHONY: build build: validate build_local ### Validate the code and build the binary. @@ -54,11 +51,6 @@ build: validate build_local ### Validate the code and build the binary. .PHONY: build_local build_local: generate CGO_ENABLED=0 go build -trimpath -a -o $(BIN) - make ungenerate - -.PHONY: ungenerate -ungenerate: ### Reverts to a clean version of modules/all-modules.go - @cp cmd/generate/_all-modules.go modules/all-modules.go .PHONY: generate generate: ### Generates include directives for modules diff --git a/cmd/generate/_all-modules.go b/cmd/generate/_all-modules.go deleted file mode 100644 index 8a423d9c..00000000 --- a/cmd/generate/_all-modules.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by go:generate; DO NOT EDIT. - -// Generated with command: go generate -// (from the project root) - -package modules - -import ( - "fmt" - "os" -) - -func init() { - fmt.Println("!!! Run \"go generate\" before building this project !!!") - os.Exit(1) -} diff --git a/cmd/generate/module-imports.go b/cmd/generate/module-imports.go index 5fcaaa29..56cc71f6 100644 --- a/cmd/generate/module-imports.go +++ b/cmd/generate/module-imports.go @@ -15,6 +15,7 @@ import ( "log" "os" "path/filepath" + "sort" "strings" ) @@ -44,6 +45,7 @@ func main() { } } } + sort.Strings(pkgs) var buf bytes.Buffer buf.WriteString("// Code generated by go:generate; DO NOT EDIT.\n\n") buf.WriteString("// Generated with command: go generate\n") diff --git a/modules/all-modules.go b/modules/all-modules.go index 8a423d9c..f0a25516 100644 --- a/modules/all-modules.go +++ b/modules/all-modules.go @@ -6,11 +6,8 @@ package modules import ( - "fmt" - "os" + _ "github.com/GoMudEngine/GoMud/modules/auctions" + _ "github.com/GoMudEngine/GoMud/modules/gmcp" + _ "github.com/GoMudEngine/GoMud/modules/leaderboards" + _ "github.com/GoMudEngine/GoMud/modules/time" ) - -func init() { - fmt.Println("!!! Run \"go generate\" before building this project !!!") - os.Exit(1) -}