https://github.com/grpc/grpc-java-api-checker
https://github.com/grpc/grpc-java-api-checker
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/grpc/grpc-java-api-checker
- Owner: grpc
- License: apache-2.0
- Created: 2018-01-31T21:34:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-07T05:06:58.000Z (over 2 years ago)
- Last Synced: 2025-01-29T14:23:15.626Z (over 1 year ago)
- Language: Java
- Size: 87.9 KB
- Stars: 30
- Watchers: 13
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# grpc-java-api-checker
[](https://github.com/grpc/grpc-java-api-checker/actions/workflows/testing.yml?branch=master)
An Error Prone plugin that checks for usages of grpc-java APIs that are annotated with `@ExperimentalApi` or `@Internal`.
**NOTE: grpc-java-api-checker works with grpc-java version 1.10.0 or greater.**
The error examples:
```
src/main/java/com/example/App.java:10: error: [GrpcInternal] @Internal should not be used in application code
System.out.println(InternalStatus.MESSAGE_KEY);
^
(see https://github.com/grpc/grpc-java)
src/main/java/com/example/App.java:11: error: [GrpcExperimentalApi] @ExperimentalApi should not be used in application code
System.out.println(Grpc.TRANSPORT_ATTR_REMOTE_ADDR);
^
(see "https://github.com/grpc/grpc-java/issues/1710")
```
## Usage
Using the grpc-java-api-checker requires configuring your project to build with the Error Prone Java compiler.
You can see the Error Prone documents [here](http://errorprone.info/).
### Examples
#### Maven
The example is [here](examples/pom.xml)
``` sh
cd examples/
mvn compile
```
#### Gradle
The example is [here](examples/build.gradle)
``` sh
cd examples/
./gradlew compileJava
```
#### Bazel
The example is [here](examples/BUILD.bazel)
``` sh
cd examples/
bazel build //...
```
## Build and Test
``` sh
# Compile
mvn compile
# Test
mvn test
# Build
mvn build
# Publish to Local
mvn install
```