diff options
-rw-r--r-- | etc/import/TARGETS.bazel_remote_apis | 2 | ||||
-rw-r--r-- | etc/import/TARGETS.google_apis | 2 | ||||
-rw-r--r-- | rules/CC/IDE/RULES | 97 | ||||
-rw-r--r-- | rules/CC/proto/IDE/RULES | 63 |
4 files changed, 99 insertions, 65 deletions
diff --git a/etc/import/TARGETS.bazel_remote_apis b/etc/import/TARGETS.bazel_remote_apis index 09bd04bd..e5a9a9a0 100644 --- a/etc/import/TARGETS.bazel_remote_apis +++ b/etc/import/TARGETS.bazel_remote_apis @@ -17,7 +17,7 @@ ] } , "remote_execution_cc_headers": - { "type": ["@", "rules", "CC/proto/IDE", "headers"] + { "type": ["@", "rules", "CC/IDE", "headers"] , "proto": [["./", "", "remote_execution_proto"]] } } diff --git a/etc/import/TARGETS.google_apis b/etc/import/TARGETS.google_apis index e089b85b..616b732a 100644 --- a/etc/import/TARGETS.google_apis +++ b/etc/import/TARGETS.google_apis @@ -37,7 +37,7 @@ ] } , "google_apis_cc_headers": - { "type": ["@", "rules", "CC/proto/IDE", "headers"] + { "type": ["@", "rules", "CC/IDE", "headers"] , "proto": [ "google_api_http_proto" , "google_api_annotations_proto" diff --git a/rules/CC/IDE/RULES b/rules/CC/IDE/RULES new file mode 100644 index 00000000..31da688e --- /dev/null +++ b/rules/CC/IDE/RULES @@ -0,0 +1,97 @@ +{ "headers": + { "doc": ["Transitive public headers of C++ target"] + , "target_fields": ["proto", "deps"] + , "string_fields": ["stage"] + , "field_doc": + { "proto": ["The proto source files for creating cc bindings."] + , "deps": ["The targets to obtain the headers from."] + , "stage": + [ "The logical location of the header files. Individual directory" + , "components are joined with \"/\"." + ] + } + , "anonymous": + { "proto-deps": + { "target": "proto" + , "provider": "proto" + , "rule_map": + { "library": ["./", "../proto", "library"] + , "service library": ["./", "../proto", "service library"] + } + } + } + , "imports": {"runfiles": ["./", "../..", "field_runfiles"]} + , "expression": + { "type": "let*" + , "bindings": + [ [ "stage" + , { "type": "join" + , "separator": "/" + , "$1": {"type": "FIELD", "name": "stage"} + } + ] + , [ "artifacts" + , { "type": "to_subdir" + , "subdir": {"type": "var", "name": "stage"} + , "$1": + { "type": "map_union" + , "$1": + [ { "type": "let*" + , "bindings": [["fieldname", "proto-deps"]] + , "body": {"type": "CALL_EXPRESSION", "name": "runfiles"} + } + , { "type": "map_union" + , "$1": + { "type": "foreach" + , "var": "x" + , "range": {"type": "FIELD", "name": "proto-deps"} + , "body": + { "type": "DEP_PROVIDES" + , "provider": "compile-deps" + , "dep": {"type": "var", "name": "x"} + , "default": + { "type": "fail" + , "msg": + [ "Expected a library target, but got:" + , {"type": "var", "name": "x"} + ] + } + } + } + } + , { "type": "let*" + , "bindings": [["fieldname", "deps"]] + , "body": {"type": "CALL_EXPRESSION", "name": "runfiles"} + } + , { "type": "map_union" + , "$1": + { "type": "foreach" + , "var": "x" + , "range": {"type": "FIELD", "name": "deps"} + , "body": + { "type": "DEP_PROVIDES" + , "provider": "compile-deps" + , "dep": {"type": "var", "name": "x"} + , "default": + { "type": "fail" + , "msg": + [ "Expected a library target, but got:" + , {"type": "var", "name": "x"} + ] + } + } + } + } + ] + } + } + ] + ] + , "body": + { "type": "RESULT" + , "artifacts": {"type": "var", "name": "artifacts"} + , "runfiles": {"type": "var", "name": "artifacts"} + } + } + } +} diff --git a/rules/CC/proto/IDE/RULES b/rules/CC/proto/IDE/RULES deleted file mode 100644 index 558e494b..00000000 --- a/rules/CC/proto/IDE/RULES +++ /dev/null @@ -1,63 +0,0 @@ -{ "headers": - { "doc": ["Headers of C++ proto binding"] - , "target_fields": ["proto"] - , "string_fields": ["stage"] - , "field_doc": - { "proto": ["The proto source files to create the binding from."] - , "stage": - [ "The logical location of the header files. Individual directory" - , "components are joined with \"/\"." - ] - } - , "anonymous": - { "proto-deps": - { "target": "proto" - , "provider": "proto" - , "rule_map": - { "library": ["./", "..", "library"] - , "service library": ["./", "..", "service library"] - } - } - } - , "imports": {"runfiles": ["./", "../../..", "field_runfiles"]} - , "expression": - { "type": "let*" - , "bindings": - [ [ "stage" - , { "type": "join" - , "separator": "/" - , "$1": {"type": "FIELD", "name": "stage"} - } - ] - ] - , "body": - { "type": "RESULT" - , "artifacts": - { "type": "to_subdir" - , "subdir": {"type": "var", "name": "stage"} - , "$1": - { "type": "map_union" - , "$1": - [ { "type": "let*" - , "bindings": [["fieldname", "proto-deps"]] - , "body": {"type": "CALL_EXPRESSION", "name": "runfiles"} - } - , { "type": "map_union" - , "$1": - { "type": "foreach" - , "var": "x" - , "range": {"type": "FIELD", "name": "proto-deps"} - , "body": - { "type": "DEP_PROVIDES" - , "provider": "compile-deps" - , "dep": {"type": "var", "name": "x"} - } - } - } - ] - } - } - } - } - } -} |