-
Notifications
You must be signed in to change notification settings - Fork 228
Support for client core libraries #7955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6f6141c
Early work on introducing support for client core libraries into APIView
JonathanGiles 60566a1
Some cleanup
JonathanGiles c2378fd
Improved handling of different flavours of library
JonathanGiles c0cacc9
Remove redundant code
JonathanGiles dd1a210
Adding support for condensed annotation representation, and using thi…
JonathanGiles 5967534
Fix httpRetryOptions type in generic-core to be HttpRetryOptions
JonathanGiles 7db9dd3
Better flavor discovery
JonathanGiles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Improved handling of different flavours of library
- Loading branch information
commit c2378fda2791c061d26a4da6fd3488c20e70feaf
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
30 changes: 30 additions & 0 deletions
30
...ssor/src/main/java/com/azure/tools/apiview/processor/analysers/models/AnnotationRule.java
This file contains hidden or 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,30 @@ | ||
| package com.azure.tools.apiview.processor.analysers.models; | ||
|
|
||
| import java.util.Set; | ||
|
|
||
| public class AnnotationRule { | ||
|
|
||
| private boolean hideAnnotation = false; | ||
|
|
||
| private boolean hideAttributes = false; | ||
|
|
||
| private boolean showOnNewline = false; | ||
|
|
||
| public AnnotationRule setHidden(boolean hidden) { | ||
| this.hideAnnotation = hidden; | ||
| return this; | ||
| } | ||
|
|
||
| public boolean isHidden() { | ||
| return hideAnnotation; | ||
| } | ||
|
|
||
| public AnnotationRule setHideAttributes(boolean hidden) { | ||
| this.hideAttributes = hidden; | ||
| return this; | ||
| } | ||
|
|
||
| public boolean isHideAttributes() { | ||
| return hideAttributes; | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
48 changes: 48 additions & 0 deletions
48
.../apiview-java-processor/src/main/java/com/azure/tools/apiview/processor/model/Flavor.java
This file contains hidden or 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,48 @@ | ||
| package com.azure.tools.apiview.processor.model; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| public enum Flavor { | ||
| @JsonProperty("azure") | ||
| AZURE("com.azure"), | ||
|
|
||
| @JsonProperty("generic") | ||
| GENERIC("io.clientcore"), | ||
|
|
||
| UNKNOWN(null); | ||
|
|
||
| private final String packagePrefix; | ||
|
|
||
| private Flavor(String packagePrefix) { | ||
| this.packagePrefix = packagePrefix; | ||
| } | ||
|
|
||
| public String getPackagePrefix() { | ||
| return packagePrefix; | ||
| } | ||
|
|
||
| public static Flavor getFlavor(APIListing apiListing) { | ||
| Flavor flavor = apiListing.getApiViewProperties().getFlavor(); | ||
| if (flavor != null) { | ||
| return flavor; | ||
| } | ||
|
|
||
| // we are reviewing a library that does not have a flavor metadata in its apiview_properties.json file, | ||
| // so we will use alternate means to determine the flavor. | ||
|
|
||
| // Firstly, check the package name - does it start with one of the known package prefixes? | ||
| if (apiListing.getPackageName().startsWith(AZURE.packagePrefix)) { | ||
| return AZURE; | ||
| } else if (apiListing.getPackageName().startsWith(GENERIC.packagePrefix)) { | ||
| return GENERIC; | ||
| } | ||
|
|
||
| // TODO we still don't know the flavor, so the next thing we can do is look at the dependencies of the library | ||
| // to see if it brings in com.azure or io.clientcore libraries. | ||
|
|
||
| // we've failed - return the unknown flavor | ||
| return UNKNOWN; | ||
| } | ||
|
|
||
|
|
||
| } |
2 changes: 1 addition & 1 deletion
2
...ageAndDescriptionDiagnosticRuleTests.java → ...ageAndDescriptionDiagnosticRuleTests.java
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
...calesInJavadocUrlDiagnosticRuleTests.java → ...calesInJavadocUrlDiagnosticRuleTests.java
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.