diff --git a/.gitignore b/.gitignore index daf913b1..17a0109d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,9 @@ _testmain.go *.exe *.test *.prof + +# Bindata +bindata_assetfs.go + +# Built binary +maputnik diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..b63e9721 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "editor"] + path = editor + url = git@github.com:maputnik/editor.git + branch = master diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..691be69a --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +SOURCEDIR=. +SOURCES := $(shell find $(SOURCEDIR) -name '*.go') +BINARY=maputnik + +all: $(BINARY) + +$(BINARY): $(SOURCES) + go build -o ${BINARY} + +editor/node_modules: + cd editor && npm install + +editor/public: editor/node_modules + cd editor && npm run build + +bindata_assetfs.go: editor/public + go-bindata-assetfs editor/public/ + +.PHONY: clean +clean: + rm -rf editor/public && rm -rf maputnik diff --git a/README.md b/README.md index 23fecf28..b59bb1c1 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,21 @@ -# desktop -A Golang based cross platform executable for integrating Maputnik locally +# Maputnik Desktop +A Golang based cross platform executable for integrating Maputnik locally. ### Build -First you need a app bundle distribution of Maptunik and copy over `public` -to the `gui` folder in this project. +Clone the repository recursively since the Maputnik editor is embedded +as submodule. ``` -npm run dist +git clone --recursive git@github.com:maputnik/desktop.git ``` -Package the the `gui` as binary assets. +Run `make` to build the app distribution bundle and create the `maputnik` binary +embedding the editor. ``` -go get github.com/elazarl/go-bindata-assetfs/... -go-bindata-assetfs gui/... -``` - -Install the go package. - -``` -go install +make ``` +You should now find the `maputnik` binary in your directory. diff --git a/editor b/editor new file mode 160000 index 00000000..3b59e54b --- /dev/null +++ b/editor @@ -0,0 +1 @@ +Subproject commit 3b59e54b2adf4fa5180a15cb7b0abdd12586c881