mirror of
https://github.com/maputnik/editor.git
synced 2026-04-26 03:10:01 +00:00
Refactor into a go module, update dependencies (#18)
* Refactor into a go module `go get` is no longer supported outside of a go module. This commit converts the project into a go module, moving dependencies into a go.mod file. * Use go.rice instead of go-bindata-assetfs go.rice appears to be maintained and more popular * Edit dependencies * Pin to specific versions * Updating workflows * Fix syntax, I hope * Update go * Increment version number * Version number * version number
This commit is contained in:
31
Makefile
31
Makefile
@@ -2,33 +2,30 @@ SOURCEDIR=.
|
||||
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
|
||||
BINARY=maputnik
|
||||
EDITOR_VERSION ?= v1.7.0
|
||||
GOPATH := $(if $(GOPATH),$(GOPATH),$(HOME)/go)
|
||||
GOBIN := $(if $(GOBIN),$(GOBIN),$(HOME)/go/bin)
|
||||
|
||||
all: $(BINARY)
|
||||
|
||||
dependencies:
|
||||
go get -u golang.org/x/sys/...
|
||||
go get github.com/gorilla/handlers
|
||||
go get github.com/gorilla/mux
|
||||
go get github.com/gorilla/websocket
|
||||
go get github.com/fsnotify/fsnotify
|
||||
go get github.com/urfave/cli
|
||||
go get github.com/elazarl/go-bindata-assetfs/...
|
||||
go get github.com/jteeuwen/go-bindata/...
|
||||
go get github.com/mitchellh/gox
|
||||
$(BINARY): $(GOBIN)/gox $(SOURCES) rice-box.go
|
||||
$(GOBIN)/gox -osarch "windows/amd64 linux/amd64 darwin/amd64" -output "bin/{{.OS}}/${BINARY}"
|
||||
|
||||
$(BINARY): $(SOURCES) bindata_assetfs.go
|
||||
gox -osarch "windows/amd64 linux/amd64 darwin/amd64" -output "bin/{{.OS}}/${BINARY}"
|
||||
|
||||
editor/create_folder: dependencies
|
||||
editor/create_folder:
|
||||
mkdir -p editor
|
||||
|
||||
editor/pull_release: editor/create_folder
|
||||
# if the directory /home/runner/work/editor/editor/build/build exists, we assume that we are are running the makefile within the editor ci workflow
|
||||
test -d /home/runner/work/editor/editor/build/build && echo "exists" && cd editor && cp -R /home/runner/work/editor/editor/build/build public/ || (echo "does not exist" && cd editor && rm -rf public && curl -L https://github.com/maputnik/editor/releases/download/$(EDITOR_VERSION)/public.zip --output public.zip && unzip public.zip && rm public.zip)
|
||||
|
||||
bindata_assetfs.go: editor/pull_release
|
||||
go-bindata-assetfs --prefix "editor/" editor/public/...
|
||||
$(GOBIN)/gox:
|
||||
go install github.com/mitchellh/gox@v1.0.1
|
||||
|
||||
$(GOBIN)/rice:
|
||||
go install github.com/GeertJohan/go.rice/rice@v1.0.3
|
||||
|
||||
rice-box.go: $(GOBIN)/rice editor/pull_release
|
||||
$(GOBIN)/rice embed-go
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf editor/public && rm -f bindata.go && rm -f bindata_assetfs.go && rm -rf bin
|
||||
rm -rf editor/public && rm -f rice-box.go && rm -rf bin
|
||||
|
||||
Reference in New Issue
Block a user