Skip to content
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

add a bazel example #12

Merged
merged 3 commits into from
Mar 17, 2018
Merged

add a bazel example #12

merged 3 commits into from
Mar 17, 2018

Conversation

jyane
Copy link
Member

@jyane jyane commented Mar 7, 2018

Fixes #2

java_plugin(
name = "io_grpc_grpc_java_api_checker_plugin",
deps = [
"@com_google_guava_guava//jar",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think about guava version since this PR, but should we use guava:19.0 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah... This tool does not require the guava (It is an optional dependency), so the user could use any guava version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve noticed that some dependencies in pom may not be needed, I’ll dig into it.

@jyane jyane requested a review from ericgribkoff March 9, 2018 02:10
@ericgribkoff ericgribkoff self-assigned this Mar 14, 2018
@ericgribkoff
Copy link
Contributor

Can you add instructions for building with bazel to the readme too? Just doing bazel build doesn't seem to run the grpc-java-api-checker plugin; are any additional steps (like in https://github.com/google/guava-beta-checker#example) necessary?

@jyane
Copy link
Member Author

jyane commented Mar 17, 2018

Thanks!
I've added bazel section to README.md.

Just doing bazel build doesn't seem to run the grpc-java-api-checker plugin; are any additional steps (like in https://github.com/google/guava-beta-checker#example) necessary?

Nope, It works on my local machine, doesn't work on your local machine? If it doesn't work, it means we should add some tests.

$ bazel build //...
INFO: Analysed 2 targets (0 packages loaded).
INFO: Found 2 targets...
ERROR: /Users/jyane/workspace/repos/github.com/jyane/grpc-java-api-checker/examples/BUILD.bazel:1:1: Building libexample.jar (1 source file) failed (Exit 1)
src/main/java/com/example/App.java:3: error: [GrpcInternal] @Internal should not be used in application code
import io.grpc.InternalStatus;
              ^
    (see https://github.com/grpc/grpc-java)
src/main/java/com/example/App.java:8: 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:8: 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:9: 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")
INFO: Elapsed time: 0.272s, Critical Path: 0.14s
FAILED: Build did NOT complete successfully

edit: More information on my local machine

$ bazel version
...........
Build label: 0.11.1-homebrew
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Sun May 31 16:57:39 +50150 (1520426998659)
Build timestamp: 1520426998659
Build timestamp as int: 1520426998659

$ uname -a
Darwin rock.local 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64

Copy link
Contributor

@ericgribkoff ericgribkoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

The bazel example build works fine, it was just an error on my part earlier

@jyane
Copy link
Member Author

jyane commented Mar 17, 2018

Thank you for your review! Merging.

@jyane jyane merged commit b599be5 into grpc:master Mar 17, 2018
@jyane jyane deleted the add-bazel-example branch March 17, 2018 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants