This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[maintenance] generating separate .proto files per extension | #BAZEL…
…-531 Done Merge-request: BAZEL-MR-408 Merged-by: Katarzyna Mielnik <katarzyna.anna.mielnik@jetbrains.com>
- Loading branch information
1 parent
6a8a7ac
commit 3b4e1f7
Showing
8 changed files
with
215 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
load("//aspects:utils/utils.bzl", "create_struct") | ||
load("//aspects:utils/utils.bzl", "create_proto", "create_struct") | ||
|
||
def extract_cpp_info(target, ctx): | ||
def extract_cpp_info(target, ctx, **kwargs): | ||
if CcInfo not in target: | ||
return None | ||
return None, None | ||
|
||
return create_struct( | ||
result = create_struct( | ||
copts = getattr(ctx.rule.attr, "copts", []), | ||
defines = getattr(ctx.rule.attr, "defines", []), | ||
link_opts = getattr(ctx.rule.attr, "linkopts", []), | ||
link_shared = getattr(ctx.rule.attr, "linkshared", False), | ||
) | ||
|
||
return create_proto(target, ctx, result, "cpp_target_info"), None |
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,15 +1,17 @@ | ||
load("//aspects:utils/utils.bzl", "create_struct", "file_location") | ||
load("//aspects:utils/utils.bzl", "create_proto", "create_struct", "file_location") | ||
|
||
def extract_python_info(target, ctx): | ||
def extract_python_info(target, ctx, **kwargs): | ||
if PyInfo not in target: | ||
return None | ||
return None, None | ||
|
||
if PyRuntimeInfo in target: | ||
provider = target[PyRuntimeInfo] | ||
else: | ||
provider = None | ||
provider = None, None | ||
|
||
return create_struct( | ||
python_target_info = create_struct( | ||
interpreter = file_location(getattr(provider, "interpreter", None)), | ||
version = getattr(provider, "python_version", None), | ||
) | ||
|
||
return create_proto(target, ctx, python_target_info, "python_target_info"), None |
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.