I think I'm loading my go-deps here????

bazel
Nick Dumas 1 year ago
parent b72a259d3e
commit 9abebb2535

45
BUILD

@ -1,45 +0,0 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")
load("@gazelle//:def.bzl", "gazelle")
# gazelle:prefix code.ndumas.com/ndumas/obsidian-markdown
gazelle(name = "gazelle")
gazelle(
name = "gazelle-update-repos",
args = [
"-from_file=go.mod",
"-to_macro=deps.bzl%go_dependencies",
"-prune",
"-build_file_proto_mode=disable_global",
],
command = "update-repos",
)
go_library(
name = "obsidian-markdown",
srcs = [
"lexemetype_string.go",
"lexer.go",
"states.go",
"wikilink.go",
],
importpath = "code.ndumas.com/ndumas/obsidian-markdown",
visibility = ["//visibility:public"],
deps = [
"@org_uber_go_zap//:go_default_library",
"@org_uber_go_zap//zapcore:go_default_library",
],
)
go_test(
name = "obsidian-markdown_test",
srcs = [
"lexer_test.go",
"wikilink_test.go",
],
deps = [
":obsidian-markdown",
"@com_github_stretchr_testify//assert:go_default_library",
"@org_uber_go_zap//zapcore:go_default_library",
],
)

@ -6,3 +6,6 @@ module(
bazel_dep(name = "gazelle", version = "0.32.0") bazel_dep(name = "gazelle", version = "0.32.0")
bazel_dep(name = "rules_go", version = "0.41.0") bazel_dep(name = "rules_go", version = "0.41.0")
bazel_dep(name = "rules_oci", version = "1.2.0") bazel_dep(name = "rules_oci", version = "1.2.0")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")

@ -1,6 +1,6 @@
{ {
"lockFileVersion": 1, "lockFileVersion": 1,
"moduleFileHash": "632d10f357e09a25e581aec8f5534e5653cddc1af7910e85c1661d4bf3797328", "moduleFileHash": "584fb7092f82ede5c56c2e5afbc5553ce6d7e6aa4bbd47c41f4ef0e9bcc90aa1",
"flags": { "flags": {
"cmdRegistries": [ "cmdRegistries": [
"https://bcr.bazel.build/" "https://bcr.bazel.build/"
@ -23,7 +23,34 @@
"repoName": "code.ndumas.com_ndumas_obsidian-markdown", "repoName": "code.ndumas.com_ndumas_obsidian-markdown",
"executionPlatformsToRegister": [], "executionPlatformsToRegister": [],
"toolchainsToRegister": [], "toolchainsToRegister": [],
"extensionUsages": [], "extensionUsages": [
{
"extensionBzlFile": "@gazelle//:extensions.bzl",
"extensionName": "go_deps",
"usingModule": "<root>",
"location": {
"file": "@@//:MODULE.bazel",
"line": 10,
"column": 24
},
"imports": {},
"devImports": [],
"tags": [
{
"tagName": "from_file",
"attributeValues": {"go_mod":"--//:go.mod"},
"devDependency": false,
"location": {
"file": "@@//:MODULE.bazel",
"line": 11,
"column": 18
}
}
],
"hasDevUseExtension": false,
"hasNonDevUseExtension": true
}
],
"deps": { "deps": {
"bazel_tools": "bazel_tools@_", "bazel_tools": "bazel_tools@_",
"local_config_platform": "local_config_platform@_", "local_config_platform": "local_config_platform@_",

@ -0,0 +1,4 @@
load("//:deps.bzl", "go_dependencies")
# gazelle:repository_macro deps.bzl%go_dependencies
go_dependencies()
Loading…
Cancel
Save