-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add starlark rule "experimental_resolve_attr" feature (#329)
* Add starlark rule "experimental_resolve_attr" feature * Restore proto_repository_tools check * Fix errors due to hidden/swallowed starlark configuration problems! * Fix //example/golden:starlark_java_test
- Loading branch information
Showing
19 changed files
with
212 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
-proto_plugin=lib/plugins.star%java | ||
-proto_rule=lib/rules.star%java_library | ||
-proto_rule=lib/rules.star%java_wrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile | ||
# gazelle:proto_rule java_wrapper implementation lib/rules.star%java_wrapper | ||
# gazelle:proto_rule java_library implementation lib/rules.star%java_library | ||
# gazelle:proto_rule java_library deps @com_google_protobuf//:protobuf_java | ||
# gazelle:proto_rule java_library deps @com_google_protobuf//java/core | ||
# gazelle:proto_rule java_library visibility //visibility:public | ||
# gazelle:proto_plugin java implementation lib/plugins.star%java | ||
# gazelle:proto_language java rule proto_compile | ||
# gazelle:proto_language java rule java_library | ||
# gazelle:proto_language java rule java_wrapper | ||
# gazelle:proto_language java plugin java | ||
# gazelle:proto_language java enabled true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,12 @@ | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile") | ||
load("@rules_java//java:defs.bzl", "java_library") | ||
|
||
# gazelle:proto_rule proto_compile implementation stackb:rules_proto:proto_compile | ||
# gazelle:proto_rule java_wrapper implementation lib/rules.star%java_wrapper | ||
# gazelle:proto_rule java_library implementation lib/rules.star%java_library | ||
# gazelle:proto_rule java_library deps @com_google_protobuf//:protobuf_java | ||
# gazelle:proto_rule java_library deps @com_google_protobuf//java/core | ||
# gazelle:proto_rule java_library visibility //visibility:public | ||
# gazelle:proto_plugin java implementation lib/plugins.star%java | ||
# gazelle:proto_language java rule proto_compile | ||
# gazelle:proto_language java rule java_library | ||
# gazelle:proto_language java rule java_wrapper | ||
# gazelle:proto_language java plugin java | ||
|
||
proto_library( | ||
name = "example_proto", | ||
srcs = ["example.proto"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
java_library( | ||
name = "example_java_library", | ||
srcs = ["example.srcjar"], | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"@com_google_protobuf//:protobuf_java", | ||
"@com_google_protobuf//java/core", | ||
], | ||
) | ||
|
||
proto_compile( | ||
name = "example_java_compile", | ||
outs = {"@build_stack_rules_proto//plugin/builtin:java": "example.srcjar"}, | ||
outputs = ["example.srcjar"], | ||
plugins = ["@build_stack_rules_proto//plugin/builtin:java"], | ||
proto = "example_proto", | ||
) | ||
# gazelle:proto_language java enabled true |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
load("//:defs.bzl", "java_wrapper") | ||
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile") | ||
load("@rules_java//java:defs.bzl", "java_library") | ||
|
||
proto_library( | ||
name = "customer_proto", | ||
srcs = ["customer.proto"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
java_library( | ||
name = "customer_java_library", | ||
srcs = ["customer.srcjar"], | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"@com_google_protobuf//:protobuf_java", | ||
"@com_google_protobuf//java/core", | ||
], | ||
) | ||
|
||
java_wrapper( | ||
name = "customer_java_wrap", | ||
javalib = "customer_java_library", | ||
) | ||
|
||
proto_compile( | ||
name = "customer_java_compile", | ||
outs = {"@build_stack_rules_proto//plugin/builtin:java": "customer/customer.srcjar"}, | ||
outputs = ["customer.srcjar"], | ||
plugins = ["@build_stack_rules_proto//plugin/builtin:java"], | ||
proto = "customer_proto", | ||
) |
10 changes: 10 additions & 0 deletions
10
example/golden/testdata/starlark_java/customer/customer.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
syntax = "proto3"; | ||
|
||
package customer; | ||
|
||
option java_multiple_files = true; | ||
option java_package = "com.github.stackb.rules_proto.example.golden.testdata.starlark_java.customer"; | ||
|
||
message Customer { | ||
string name = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def java_wrapper(**_kwargs): | ||
pass |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
load("//:defs.bzl", "java_wrapper") | ||
load("@build_stack_rules_proto//rules:proto_compile.bzl", "proto_compile") | ||
load("@rules_java//java:defs.bzl", "java_library") | ||
|
||
proto_library( | ||
name = "order_proto", | ||
srcs = ["order.proto"], | ||
visibility = ["//visibility:public"], | ||
deps = ["//customer:customer_proto"], | ||
) | ||
|
||
java_library( | ||
name = "order_java_library", | ||
srcs = ["order.srcjar"], | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//customer:customer_java_library", | ||
"@com_google_protobuf//:protobuf_java", | ||
"@com_google_protobuf//java/core", | ||
], | ||
) | ||
|
||
java_wrapper( | ||
name = "order_java_wrap", | ||
javalib = "order_java_library", | ||
deps = ["//customer:customer_java_wrap"], | ||
) | ||
|
||
proto_compile( | ||
name = "order_java_compile", | ||
outs = {"@build_stack_rules_proto//plugin/builtin:java": "order/order.srcjar"}, | ||
outputs = ["order.srcjar"], | ||
plugins = ["@build_stack_rules_proto//plugin/builtin:java"], | ||
proto = "order_proto", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
syntax = "proto3"; | ||
|
||
package order; | ||
|
||
import "customer/customer.proto"; | ||
|
||
option java_multiple_files = true; | ||
option java_package = "com.github.stackb.rules_proto.example.golden.testdata.starlark_java.order"; | ||
|
||
message Order { | ||
customer.Customer customer = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.