grpc-java-api-checker

An Error Prone plugin that checks for usages of grpc-java experimental or internal APIs.

License

License

Categories

Categories

Java Languages gRPC Net Networking
GroupId

GroupId

io.grpc
ArtifactId

ArtifactId

grpc-java-api-checker
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

grpc-java-api-checker
An Error Prone plugin that checks for usages of grpc-java experimental or internal APIs.
Project URL

Project URL

https://github.com/grpc/grpc-java-api-checker
Source Code Management

Source Code Management

https://github.com/grpc/grpc-java-api-checker

Download grpc-java-api-checker

How to add to project

<!-- https://jarcasting.com/artifacts/io.grpc/grpc-java-api-checker/ -->
<dependency>
    <groupId>io.grpc</groupId>
    <artifactId>grpc-java-api-checker</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.grpc/grpc-java-api-checker/
implementation 'io.grpc:grpc-java-api-checker:1.1.0'
// https://jarcasting.com/artifacts/io.grpc/grpc-java-api-checker/
implementation ("io.grpc:grpc-java-api-checker:1.1.0")
'io.grpc:grpc-java-api-checker:jar:1.1.0'
<dependency org="io.grpc" name="grpc-java-api-checker" rev="1.1.0">
  <artifact name="grpc-java-api-checker" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.grpc', module='grpc-java-api-checker', version='1.1.0')
)
libraryDependencies += "io.grpc" % "grpc-java-api-checker" % "1.1.0"
[io.grpc/grpc-java-api-checker "1.1.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.google.auto.service : auto-service Optional jar 1.0-rc3
com.google.guava : guava Optional jar 23.0

provided (1)

Group / Artifact Type Version
com.google.errorprone : error_prone_core jar 2.2.0

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
com.google.errorprone : error_prone_test_helpers jar 2.2.0

Project Modules

There are no modules declared in this project.

grpc-java-api-checker

Build Status

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.

Examples

Maven

The example is here

cd examples/
mvn compile

Gradle

The example is here

cd examples/
./gradlew compileJava

Bazel

The example is here

cd examples/
bazel build //...

Build and Test

# Compile
mvn compile

# Test
mvn test

# Build
mvn build

# Publish to Local
mvn install
io.grpc

grpc

A high performance, open source, general-purpose RPC framework

Versions

Version
1.1.0
1.0.0