-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xcode: query xcode parameters from provider based on attributes
Bazel 8 introduced new provider located in apple_common module, which is not available in cquery context, so the implementation was updated to just find a provider with required attributes to make implementation also work for bazel 7 and older fixes #6604
- Loading branch information
Showing
4 changed files
with
29 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
provider_attrs = ["xcode_version", "default_macos_sdk_version"] | ||
|
||
def all_items_are_true(items): | ||
for item in items: | ||
if item == False: | ||
return False | ||
|
||
return True | ||
|
||
def hasattrs(obj, attrs): | ||
return all_items_are_true([hasattr(obj, attr) for attr in attrs]) | ||
|
||
def format(target): | ||
all_providers = providers(target) | ||
for key in all_providers: | ||
provider = all_providers[key] | ||
|
||
if hasattrs(provider, provider_attrs): | ||
attrs = [getattr(provider, attr) for attr in provider_attrs] | ||
return "{} {}".format(attrs[0], attrs[1]) | ||
|
||
return "" |
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