first draft at stamping, broken because i'm not using workspaces

stamping
Nick Dumas 1 year ago
parent 68824221c1
commit be601acec6

@ -10,7 +10,7 @@ bazel_dep(name = "rules_pkg", version = "0.9.1")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(go_deps, "com_github_engoengine_engo", "com_github_threedotslabs_watermill")
use_repo(go_deps, "com_github_engoengine_ecs", "com_github_threedotslabs_watermill")
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(

@ -20,6 +20,10 @@ go_binary(
name = "echo",
embed = [":echo_lib"],
visibility = ["//visibility:public"],
x_defs = {
"code.ndumas.com/ndumas/gomud.Version":"STABLE_GIT_VERSION",
"code.ndumas.com/ndumas/gomud.Build":"STABLE_GIT_COMMIT",
},
)
load("@rules_pkg//:pkg.bzl", "pkg_tar")

@ -14,22 +14,30 @@ import (
"github.com/ThreeDotsLabs/watermill/message/router/plugin"
"github.com/ThreeDotsLabs/watermill/pubsub/gochannel"
"code.ndumas.com/ndumas/gomud"
"code.ndumas.com/ndumas/gomud/engine"
"code.ndumas.com/ndumas/gomud/logger"
"code.ndumas.com/ndumas/gomud/telnet"
)
var (
port int
verbose int
port int
verbose int
versionFlag bool
)
func main() {
flag.IntVar(&verbose, "verbose", 0, "-5:Trace, -4:Debug, 0:Info, 4:Warn, 8:Error")
flag.IntVar(&port, "port", 5555, "MUD server port")
flag.BoolVar(&versionFlag, "version", false, "print build version")
flag.Parse()
if versionFlag {
fmt.Printf("%s@%s\n", gomud.VERSION, gomud.BUILD)
return
}
l, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
if err != nil {
log.Fatalf("error binding to port %d\n: %s", port, err)

@ -0,0 +1,6 @@
#! /bin/bash
tag=$(git describe --tags --dirty=-dev)
commit=$(git rev-parse HEAD | head -c8)
echo "STABLE_GIT_VERSION:$tag"
echo "STABLE_GIT_COMMIT:$commit"

@ -0,0 +1,6 @@
package gomud
const (
VERSION = ""
BUILD = ""
)
Loading…
Cancel
Save