~nromdotcom/gemif

914458c58f6158ecb8e30fdfc595e50df9e5eaba — Norm MacLennan 11 months ago 9f912f9
Update to fully-qualified module path to enable go get-ing
M Makefile => Makefile +12 -9
@@ 1,5 1,8 @@
.PHONY: help build clean build-all package release
.DEFAULT_GOAL := help

pkg_root = git.sr.ht/~nromdotcom/gemif

### Calculate a few variables for use in building and deploying the app
VERSION = $(shell git describe --tags --always)
COMMIT = $(shell git log --pretty='format:%h' -n 1)


@@ 35,20 38,20 @@ upgrade_deps: ## Upgrade versions of dependencies

##@ Build
gemif-build: clean generate ## Build GemIF server for your native architecture
	go build -o ./bin/gemif -ldflags=$(ldflags) gemif/cmd/gemif
	go build -o ./bin/gemif -ldflags=$(ldflags) $(pkg_root)/cmd/gemif

gemif-build-all: clean generate ## Build GemIF server for linux and mac
	GOOS=darwin GOARCH=amd64 go build -o ./bin/gemif-darwin-amd64/gemif -ldflags=$(ldflags) gemif/cmd/gemif
	GOOS=linux GOARCH=amd64 go build -o ./bin/gemif-linux-amd64/gemif -ldflags=$(ldflags) gemif/cmd/gemif
	GOOS=linux GOARCH=arm64 go build -o ./bin/gemif-linux-arm64/gemif -ldflags=$(ldflags) gemif/cmd/gemif
	GOOS=darwin GOARCH=amd64 go build -o ./bin/gemif-darwin-amd64/gemif -ldflags=$(ldflags) $(pkg_root)/cmd/gemif
	GOOS=linux GOARCH=amd64 go build -o ./bin/gemif-linux-amd64/gemif -ldflags=$(ldflags) $(pkg_root)/cmd/gemif
	GOOS=linux GOARCH=arm64 go build -o ./bin/gemif-linux-arm64/gemif -ldflags=$(ldflags) $(pkg_root)/cmd/gemif

gemifc-build: clean ## Build story copiler for your native architecture
	go build -o ./bin/gemifc -ldflags=$(ldflags) gemif/cmd/gemifc
	go build -o ./bin/gemifc -ldflags=$(ldflags) $(pkg_root)/cmd/gemifc

gemifc-build-all: clean ## Build story compiler for linux and mac
	GOOS=darwin GOARCH=amd64 go build -o ./bin/gemif-darwin-amd64/gemifc -ldflags=$(ldflags) gemif/cmd/gemifc
	GOOS=linux GOARCH=amd64 go build -o ./bin/gemif-linux-amd64/gemifc -ldflags=$(ldflags) gemif/cmd/gemifc
	GOOS=linux GOARCH=arm64 go build -o ./bin/gemif-linux-arm64/gemifc -ldflags=$(ldflags) gemif/cmd/gemifc
	GOOS=darwin GOARCH=amd64 go build -o ./bin/gemif-darwin-amd64/gemifc -ldflags=$(ldflags) $(pkg_root)/cmd/gemifc
	GOOS=linux GOARCH=amd64 go build -o ./bin/gemif-linux-amd64/gemifc -ldflags=$(ldflags) $(pkg_root)/cmd/gemifc
	GOOS=linux GOARCH=arm64 go build -o ./bin/gemif-linux-arm64/gemifc -ldflags=$(ldflags) $(pkg_root)/cmd/gemifc

build: gemif-build gemifc-build ## Build gemif and gemifc for native architecture
build-all: gemif-build-all gemifc-build-all ## Build gemif and gemifc for linux and mac


@@ 57,7 60,7 @@ clean: ## Delete any compiled artifacts
	rm -rf ./bin

generate: ## Generate bindata from static files
	go generate gemif/cmd/gemif
	go generate $(pkg_root)/cmd/gemif

protobuf: ## until i can reliably re-generate this, separate it from generate
	protoc -I pkg/ --go_out=. pkg/gamemanager/statetoken.proto

M cmd/gemif/main.go => cmd/gemif/main.go +2 -2
@@ 3,11 3,11 @@ package main

import (
	"fmt"
	"gemif/pkg/gamemanager"
	"gemif/pkg/gemserver"
	"io/ioutil"
	"log"

	"git.sr.ht/~nromdotcom/gemif/pkg/gamemanager"
	"git.sr.ht/~nromdotcom/gemif/pkg/gemserver"
	"github.com/pelletier/go-toml"
)


M cmd/gemifc/main.go => cmd/gemifc/main.go +1 -1
@@ 4,13 4,13 @@ package main
// correctly for some reason, so we use v2.
import (
	"fmt"
	"gemif/pkg/gamemanager"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	"regexp"

	"git.sr.ht/~nromdotcom/gemif/pkg/gamemanager"
	"gopkg.in/yaml.v2"
)


M cmd/gemifc/roomparser.go => cmd/gemifc/roomparser.go +2 -1
@@ 3,9 3,10 @@ package main
import (
	"errors"
	"fmt"
	"gemif/pkg/gamemanager"
	"regexp"
	"strings"

	"git.sr.ht/~nromdotcom/gemif/pkg/gamemanager"
)

// ErrInvalidRoomHeader happens when the header of a room is malformed or missing.

M go.mod => go.mod +1 -1
@@ 1,4 1,4 @@
module gemif
module git.sr.ht/~nromdotcom/gemif

go 1.14


M pkg/gamemanager/engineconfig_test.go => pkg/gamemanager/engineconfig_test.go +1 -1
@@ 2,9 2,9 @@ package gamemanager_test

import (
	"fmt"
	"gemif/pkg/gamemanager"
	"testing"

	"git.sr.ht/~nromdotcom/gemif/pkg/gamemanager"
	"github.com/stretchr/testify/assert"
)


M pkg/gamemanager/gamestate_test.go => pkg/gamemanager/gamestate_test.go +1 -1
@@ 1,9 1,9 @@
package gamemanager_test

import (
	"gemif/pkg/gamemanager"
	"testing"

	"git.sr.ht/~nromdotcom/gemif/pkg/gamemanager"
	"github.com/stretchr/testify/assert"
)


M pkg/gemserver/router.go => pkg/gemserver/router.go +2 -2
@@ 2,10 2,10 @@ package gemserver

import (
	"fmt"
	"gemif/pkg/gamemanager"
	"gemif/pkg/scenerenderer"
	"os"

	"git.sr.ht/~nromdotcom/gemif/pkg/gamemanager"
	"git.sr.ht/~nromdotcom/gemif/pkg/scenerenderer"
	"github.com/markbates/pkger"
	"github.com/pitr/gig"
)

M pkg/gemserver/routes.go => pkg/gemserver/routes.go +2 -2
@@ 2,14 2,14 @@ package gemserver

import (
	"fmt"
	"gemif/pkg/gamemanager"
	"gemif/pkg/scenerenderer"
	"io/ioutil"
	"net/url"
	"path"
	"path/filepath"
	"sort"

	"git.sr.ht/~nromdotcom/gemif/pkg/gamemanager"
	"git.sr.ht/~nromdotcom/gemif/pkg/scenerenderer"
	"github.com/markbates/pkger"
	"github.com/pitr/gig"
)

M pkg/scenerenderer/scenerenderer.go => pkg/scenerenderer/scenerenderer.go +2 -1
@@ 3,8 3,9 @@ package scenerenderer
import (
	"bytes"
	"fmt"
	"gemif/pkg/gamemanager"
	"text/template"

	"git.sr.ht/~nromdotcom/gemif/pkg/gamemanager"
)

// Template contains the room templates.

M sample.config.toml => sample.config.toml +2 -0
@@ 7,4 7,6 @@ key_file  = "./anda.key"
[engine]
stories_dir         = "./stories/compiled"
render_descriptions = true
# proto = protobuf
# json  = json
statetoken_format   = "proto"
\ No newline at end of file