Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/closurejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ parent: Examples
~~~python
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
load("@rules_proto//proto:defs.bzl", "proto_library")

# "proto_rule" instantiates the proto_compile rule
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
Expand Down
1 change: 0 additions & 1 deletion docs/commonjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ parent: Examples
~~~python
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
load("@rules_proto//proto:defs.bzl", "proto_library")

# "proto_rule" instantiates the proto_compile rule
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
Expand Down
1 change: 0 additions & 1 deletion docs/cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ parent: Examples
~~~python
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
load("@rules_proto//proto:defs.bzl", "proto_library")

# "proto_rule" instantiates the proto_compile rule
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
Expand Down
1 change: 0 additions & 1 deletion docs/csharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ parent: Examples
~~~python
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
load("@rules_proto//proto:defs.bzl", "proto_library")

# "proto_rule" instantiates the proto_compile rule
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
Expand Down
78 changes: 78 additions & 0 deletions docs/go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
layout: default
title: go
permalink: examples/go
parent: Examples
---


# go example

`bazel test //example/golden:go_test`


## `BUILD.bazel` (after gazelle)

~~~python
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@build_stack_rules_proto//rules/go:proto_go_library.bzl", "proto_go_library")
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")

# gazelle:proto_plugin protoc-gen-go implementation golang:protobuf:protoc-gen-go
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
# gazelle:proto_rule proto_go_library implementation stackb:rules_proto:proto_go_library
# gazelle:proto_rule proto_go_library deps @org_golang_google_protobuf//reflect/protoreflect
# gazelle:proto_rule proto_go_library deps @org_golang_google_protobuf//runtime/protoimpl
# gazelle:proto_rule proto_go_library resolve google/protobuf/([a-z]+).proto @org_golang_google_protobuf//types/known/${1}pb
# gazelle:proto_rule proto_go_library visibility //visibility:public
# gazelle:proto_language go plugin protoc-gen-go
# gazelle:proto_language go rule proto_compile
# gazelle:proto_language go rule proto_go_library

proto_library(
name = "pb_proto",
srcs = ["example.proto"],
visibility = ["//visibility:public"],
)

proto_compile(
name = "pb_go_compile",
outputs = ["example.pb.go"],
plugins = ["@build_stack_rules_proto//plugin/golang/protobuf:protoc-gen-go"],
proto = "pb_proto",
)

proto_go_library(
name = "pb_go_proto",
srcs = ["example.pb.go"],
importpath = "./",
visibility = ["//visibility:public"],
deps = [
"@org_golang_google_protobuf//reflect/protoreflect",
"@org_golang_google_protobuf//runtime/protoimpl",
],
)
~~~


## `BUILD.bazel` (before gazelle)

~~~python
# gazelle:proto_plugin protoc-gen-go implementation golang:protobuf:protoc-gen-go
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
# gazelle:proto_rule proto_go_library implementation stackb:rules_proto:proto_go_library
# gazelle:proto_rule proto_go_library deps @org_golang_google_protobuf//reflect/protoreflect
# gazelle:proto_rule proto_go_library deps @org_golang_google_protobuf//runtime/protoimpl
# gazelle:proto_rule proto_go_library resolve google/protobuf/([a-z]+).proto @org_golang_google_protobuf//types/known/${1}pb
# gazelle:proto_rule proto_go_library visibility //visibility:public
# gazelle:proto_language go plugin protoc-gen-go
# gazelle:proto_language go rule proto_compile
# gazelle:proto_language go rule proto_go_library
~~~


## `WORKSPACE`

~~~python
~~~

30 changes: 30 additions & 0 deletions docs/goembed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
layout: default
title: goembed
permalink: examples/goembed
parent: Examples
---


# goembed example

`bazel test //example/golden:goembed_test`


## `BUILD.bazel` (after gazelle)

~~~python
~~~


## `BUILD.bazel` (before gazelle)

~~~python
~~~


## `WORKSPACE`

~~~python
~~~

1 change: 0 additions & 1 deletion docs/gogo.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ parent: Examples
~~~python
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
load("@rules_proto//proto:defs.bzl", "proto_library")

# "proto_rule" instantiates the proto_compile rule
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
Expand Down
54 changes: 54 additions & 0 deletions docs/gomerge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
layout: default
title: gomerge
permalink: examples/gomerge
parent: Examples
---


# gomerge example

`bazel test //example/golden:gomerge_test`


## `BUILD.bazel` (after gazelle)

~~~python
# gazelle:proto file

# gazelle:proto_plugin protoc-gen-go implementation golang:protobuf:protoc-gen-go
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
# gazelle:proto_rule proto_go_library implementation stackb:rules_proto:proto_go_library
# gazelle:proto_rule proto_go_library deps @org_golang_google_protobuf//reflect/protoreflect
# gazelle:proto_rule proto_go_library deps @org_golang_google_protobuf//runtime/protoimpl
# gazelle:proto_rule proto_go_library resolve google/protobuf/([a-z]+).proto @org_golang_google_protobuf//types/known/${1}pb
# gazelle:proto_rule proto_go_library visibility //visibility:public
# gazelle:proto_language go plugin protoc-gen-go
# gazelle:proto_language go rule proto_compile
# gazelle:proto_language go rule proto_go_library
~~~


## `BUILD.bazel` (before gazelle)

~~~python
# gazelle:proto file

# gazelle:proto_plugin protoc-gen-go implementation golang:protobuf:protoc-gen-go
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
# gazelle:proto_rule proto_go_library implementation stackb:rules_proto:proto_go_library
# gazelle:proto_rule proto_go_library deps @org_golang_google_protobuf//reflect/protoreflect
# gazelle:proto_rule proto_go_library deps @org_golang_google_protobuf//runtime/protoimpl
# gazelle:proto_rule proto_go_library resolve google/protobuf/([a-z]+).proto @org_golang_google_protobuf//types/known/${1}pb
# gazelle:proto_rule proto_go_library visibility //visibility:public
# gazelle:proto_language go plugin protoc-gen-go
# gazelle:proto_language go rule proto_compile
# gazelle:proto_language go rule proto_go_library
~~~


## `WORKSPACE`

~~~python
~~~

1 change: 0 additions & 1 deletion docs/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ parent: Examples
~~~python
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
load("@rules_proto//proto:defs.bzl", "proto_library")

# "proto_rule" instantiates the proto_compile rule
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
Expand Down
1 change: 0 additions & 1 deletion docs/objc.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ parent: Examples
~~~python
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
load("@rules_proto//proto:defs.bzl", "proto_library")

# "proto_rule" instantiates the proto_compile rule
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
Expand Down
99 changes: 99 additions & 0 deletions docs/proto_repository.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
layout: default
title: proto_repository
permalink: examples/proto_repository
parent: Examples
---


# proto_repository example

`bazel test //example/golden:proto_repository_test`


## `BUILD.bazel` (after gazelle)

~~~python
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@build_stack_rules_proto//rules/go:proto_go_library.bzl", "proto_go_library")
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")

proto_library(
name = "app_proto",
srcs = ["app.proto"],
visibility = ["//visibility:public"],
deps = [
"@googleapis//google/api:annotations_proto",
"@googleapis//google/api:field_behavior_proto",
],
)

proto_compile(
name = "app_go_compile",
output_mappings = [
"app.pb.go=github.com/example/app/app.pb.go",
"app_grpc.pb.go=github.com/example/app/app_grpc.pb.go",
],
outputs = [
"app.pb.go",
"app_grpc.pb.go",
],
plugins = [
"@build_stack_rules_proto//plugin/golang/protobuf:protoc-gen-go",
"@build_stack_rules_proto//plugin/grpc/grpc-go:protoc-gen-go-grpc",
],
proto = "app_proto",
visibility = ["//visibility:public"],
)

proto_go_library(
name = "app_go_proto",
srcs = [
"app.pb.go",
"app_grpc.pb.go",
],
importpath = "github.com/example/app",
visibility = ["//visibility:public"],
deps = [
"@googleapis//google/api:annotations_go_proto",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
"@org_golang_google_protobuf//reflect/protoreflect",
"@org_golang_google_protobuf//runtime/protoimpl",
],
)
~~~


## `BUILD.bazel` (before gazelle)

~~~python
~~~


## `WORKSPACE`

~~~python
# ----------------------------------------------------
# proto_repository
# ----------------------------------------------------

load("@build_stack_rules_proto//rules/proto:proto_repository.bzl", "proto_repository")

proto_repository(
name = "googleapis",
build_directives = [
"gazelle:proto_language go enabled true",
],
build_file_generation = "on",
build_file_proto_mode = "file",
cfgs = ["//:config.yaml"],
override_go_googleapis = True,
sha256 = "b9dbc65ebc738a486265ef7b708e9449bf361541890091983e946557ee0a4bfc",
strip_prefix = "googleapis-66759bdf6a5ebb898c2a51c8649aefd1ee0b7ffe",
type = "zip",
urls = ["https://codeload.github.com/googleapis/googleapis/zip/66759bdf6a5ebb898c2a51c8649aefd1ee0b7ffe"],
)
~~~

1 change: 0 additions & 1 deletion docs/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ parent: Examples
~~~python
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
load("@rules_proto//proto:defs.bzl", "proto_library")

# "proto_rule" instantiates the proto_compile rule
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
Expand Down
1 change: 0 additions & 1 deletion docs/ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ parent: Examples
~~~python
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile")
load("@rules_proto//proto:defs.bzl", "proto_library")

# "proto_rule" instantiates the proto_compile rule
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile
Expand Down
Loading