Skip to content

Commit

Permalink
Feature/update bazel config (#833)
Browse files Browse the repository at this point in the history
  • Loading branch information
frank30941 authored Aug 29, 2024
1 parent 10bf84f commit ba50857
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
18 changes: 12 additions & 6 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

# gazelle:prefix github.com/go-resty/resty/v2
# gazelle:go_naming_convention import_alias
Expand All @@ -17,17 +17,19 @@ go_library(
"resty.go",
"retry.go",
"trace.go",
"transport_js.go",
"transport_other.go",
"transport.go",
"transport112.go",
"transport_js.go",
"transport_other.go",
"util.go",
"util_curl.go",
"shellescape/shellescape.go"
],
importpath = "github.com/go-resty/resty/v2",
visibility = ["//visibility:public"],
deps = ["@org_golang_x_net//publicsuffix:go_default_library"],
deps = [
"//shellescape",
"@org_golang_x_net//publicsuffix",
],
)

go_test(
Expand All @@ -36,14 +38,18 @@ go_test(
"client_test.go",
"context_test.go",
"example_test.go",
"middleware_test.go",
"request_test.go",
"resty_test.go",
"retry_test.go",
"util_test.go",
],
data = glob([".testdata/*"]),
embed = [":resty"],
deps = ["@org_golang_x_net//proxy:go_default_library"],
deps = [
"@org_golang_x_net//proxy",
"@org_golang_x_time//rate",
],
)

alias(
Expand Down
10 changes: 10 additions & 0 deletions examples/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
name = "examples_test",
srcs = [
"debug_curl_test.go",
"server_test.go",
],
deps = ["//:resty"],
)
14 changes: 14 additions & 0 deletions shellescape/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "shellescape",
srcs = ["shellescape.go"],
importpath = "github.com/go-resty/resty/v2/shellescape",
visibility = ["//visibility:public"],
)

alias(
name = "go_default_library",
actual = ":shellescape",
visibility = ["//visibility:public"],
)

0 comments on commit ba50857

Please sign in to comment.