-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bfd117
commit e01e6d2
Showing
2 changed files
with
18 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
def get_java_provider(target): | ||
"""Find a provider exposing java compilation/outputs data.""" | ||
|
||
# Check for kt providers before JavaInfo. e.g. kt targets have | ||
# JavaInfo, but their data lives in the "kt" provider and not JavaInfo. | ||
# See https://github.com/bazelbuild/intellij/pull/1202 | ||
if hasattr(target, "kt") and hasattr(target.kt, "outputs"): | ||
return target.kt | ||
if JavaInfo in target: | ||
return target[JavaInfo] | ||
if hasattr(java_common, "JavaPluginInfo") and java_common.JavaPluginInfo in target: | ||
return target[java_common.JavaPluginInfo] | ||
return 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