Skip to content

Commit

Permalink
require go1.18. put Makefile in line with my other projects
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmitchell committed Jul 4, 2022
1 parent d4de13c commit 6c4fb54
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ddayconfig.yml
!docs/ddayconfig.yml
doomsday-darwin-amd64
doomsday-darwin-arm64
doomsday-darwin
doomsday-linux
doomsday-linux-amd64
!client/doomsday
node_modules
35 changes: 14 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,46 +1,39 @@
BUILD_TARGET ?= cmd/*.go
APP_NAME := doomsday
OUTPUT_NAME ?= $(APP_NAME)
SHELL := /bin/bash
SHELL := $(shell which bash)
COMMIT_HASH := $(shell git log --pretty='format:%h' -n 1)
DIRTY_LINE := $(shell git diff --shortstat 2> /dev/null | tail -n1)
ifneq ("$(DIRTY_LINE)", "")
DIRTY := +
endif
VERSION ?= development
LOCAL_GOOS=$(shell go env GOOS)
LOCAL_GOARCH=$(shell go env GOARCH)
LDFLAGS := -X "github.com/doomsday-project/doomsday/version.Version=$(VERSION)-$(COMMIT_HASH)$(DIRTY)"
LDFLAGS := -X "main.Version=$(VERSION)-$(COMMIT_HASH)$(DIRTY)"
BUILD := go build -v -ldflags='$(LDFLAGS)' -o $(OUTPUT_NAME) $(BUILD_TARGET)

.PHONY: build darwin darwin-amd64 darwin-arm64 linux all clean embed server tsc
.PHONY: build server darwin darwin-amd64 darwin-arm64 linux linux-amd64 embed tsc all clean
.DEFAULT: build


#: Generic server build for all platfomrs
build: embed server

server:
server:
@echo $(VERSION)-$(COMMIT_HASH)$(DIRTY)
GOOS=$(GOOS) GOARCH=$(GOARCH) $(BUILD)
GOOS=$(GOOS) GOARCH=$(GOARCH) VERSION=$(VERSION) $(BUILD)

#: Builds all OSX executable
darwin: darwin-amd64 darwin-arm64

#: Builds arm64 OSX executable
darwin-amd64:
GOOS=darwin GOARCH=amd64 OUTPUT_NAME=$(APP_NAME)-darwin-amd64 $(MAKE) server

darwin-arm64:
GOOS=darwin GOARCH=arm64 OUTPUT_NAME=$(APP_NAME)-darwin-arm64 VERSION="$(VERSION)" $(MAKE) server
GOOS=darwin GOARCH=arm64 OUTPUT_NAME=$(APP_NAME)-darwin-arm64 $(MAKE) server

#: Builds amd64 OSX executable
darwin-amd64:
GOOS=darwin GOARCH=amd64 OUTPUT_NAME=$(APP_NAME)-darwin-amd64 VERSION="$(VERSION)" $(MAKE) server
linux: linux-amd64

#: Builds amd64 linux executable
linux:
GOOS=linux GOARCH=amd64 OUTPUT_NAME=$(APP_NAME)-linux VERSION="$(VERSION)" $(MAKE) server
linux-amd64:
GOOS=linux GOARCH=amd64 OUTPUT_NAME=$(APP_NAME)-linux-amd64 $(MAKE) server

#: Build client and server doomsday components
all: embed darwin linux server
all: embed darwin linux

embed: tsc
GOOS="" GOARCH="" go run web/embed/main.go web/embed/mappings.yml
Expand All @@ -50,4 +43,4 @@ tsc:
tsc --project web/tsconfig.json

clean:
rm -f $(APP_NAME) $(APP_NAME)-darwin-* $(APP_NAME)-linux
rm -f $(APP_NAME) $(APP_NAME)-darwin-amd64 $(APP_NAME)-darwin-arm64 $(APP_NAME)-linux-amd64
18 changes: 14 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
module github.com/doomsday-project/doomsday

go 1.13
go 1.18

require (
code.cloudfoundry.org/credhub-cli v0.0.0-20191230184144-6e537b521d9d
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/cloudfoundry-community/vaultkv v0.1.1
github.com/gorilla/mux v1.7.3
github.com/olekukonko/tablewriter v0.0.4
Expand All @@ -14,7 +12,19 @@ require (
github.com/starkandwayne/goutils v0.0.0-20190115202530-896b8a6904be
github.com/thomasmitchell/go-shout v0.0.0-20200117221442-ad6c1a8d1669
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.3.0
)

require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/cloudfoundry/go-socks5 v0.0.0-20180221174514-54f73bdb8a8e // indirect
github.com/cloudfoundry/socks5-proxy v0.2.0 // indirect
github.com/google/uuid v1.0.0 // indirect
github.com/hashicorp/go-version v0.0.0-20171129150820-4fe82ae3040f // indirect
github.com/mattn/go-isatty v0.0.3 // indirect
github.com/mattn/go-runewidth v0.0.7 // indirect
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 // indirect
golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 // indirect
)
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down
24 changes: 1 addition & 23 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6c4fb54

Please sign in to comment.