diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 0000000..fa8dd50 --- /dev/null +++ b/.bazelrc @@ -0,0 +1,27 @@ +common --experimental_enable_bzlmod + +# Disable lockfiles until it works properly. +# https://github.com/bazelbuild/bazel/issues/19068 +common --lockfile_mode=off + +############################### +# Directory structure # +############################### + +# Artifacts are typically placed in a directory called "dist" +# Be aware that this setup will still create a bazel-out symlink in +# your project directory, which you must exclude from version control and your +# editor's search path. +build --symlink_prefix=dist/ + +############################### +# Output # +############################### + +# A more useful default output mode for bazel query, which +# prints "ng_module rule //foo:bar" instead of just "//foo:bar". +query --output=label_kind + +# By default, failing tests don't print any output, it's logged to a +# file instead. +test --test_output=errors diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e647ab2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +node_modules/* +package*.json +dist/* +reports/* +lexer.log +parser.log +bazel-* +*.bazel.lock diff --git a/BUILD b/BUILD new file mode 100644 index 0000000..48632e3 --- /dev/null +++ b/BUILD @@ -0,0 +1,13 @@ +load("@gazelle//:def.bzl", "gazelle") + +gazelle(name = "gazelle") + +gazelle( + name = "gazelle-update-repos", + args = [ + "-from_file=go.mod", + "-to_macro=deps.bzl%go_dependencies", + "-prune", + ], + command = "update-repos", +) diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..b482f31 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,9 @@ +module( + name = "gomud", + repo_name = "code.ndumas.com_ndumas_gomud", +) + +bazel_dep(name = "gazelle", version = "0.32.0") + +go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") +go_deps.from_file(go_mod = "//:go.mod") diff --git a/cmd/BUILD.bazel b/cmd/BUILD.bazel new file mode 100644 index 0000000..23bc1f0 --- /dev/null +++ b/cmd/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "cmd_lib", + srcs = ["echo.go"], + importpath = "code.ndumas.com/ndumas/gomud/cmd", + visibility = ["//visibility:private"], +) + +go_binary( + name = "cmd", + embed = [":cmd_lib"], + visibility = ["//visibility:public"], +) diff --git a/protocol/BUILD.bazel b/protocol/BUILD.bazel new file mode 100644 index 0000000..7763f0e --- /dev/null +++ b/protocol/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "protocol", + srcs = ["telnet.go"], + importpath = "code.ndumas.com/ndumas/gomud/protocol", + visibility = ["//visibility:public"], +)