From da5b55cbe343cf4056f0459a06cfeb43c71c219a Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Fri, 23 May 2025 12:50:59 +0530 Subject: [PATCH] Improve Gradle instructions in README.md This improves the "Getting started" section of README.md for Gradle users. Signed-off-by: Abhishek Singh --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e1e4c69..2b0b363 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Define a `.proto` service definition file `src/main/proto/hello.proto` with the syntax = "proto3"; option java_multiple_files = true; -option java_package = "org.springframework.grpc.sample.proto"; +option java_package = "org.springframework.grpc.sample.proto"; // !IMP: change the package name to the one you mentioned in spring initilizr option java_outer_classname = "HelloWorldProto"; // The greeting service definition. @@ -58,7 +58,9 @@ or ./gradlew build ``` -You’ll get two new folders in the `target` directory (or `build` for Gradle): `target/target/generated-sources/protobuf/grpc-java` and `target/target/generated-sources/protobuf/java`. You may need to instruct your IDE to mark them as source roots. In IntelliJ IDEA, you’d right click the folder, choose `Mark Directory As` -> `Generated Source Root`. Eclipse or VSCode will add them automatically for you. +You’ll get two new folders in the `target` directory: `target/target/generated-sources/protobuf/grpc-java` and `target/target/generated-sources/protobuf/java`. +(_For gradle_, refer the `build` directory: `build/generated/source/proto/main/grpc` & `build/generated/source/proto/main/java`) +You may need to instruct your IDE to mark them as source roots. In IntelliJ IDEA, you’d right-click the folder, choose `Mark Directory As` -> `Generated Source Root`. Eclipse or VSCode will add them automatically for you. Now you can implement a service based on the generated stubs: @@ -112,7 +114,7 @@ Run the program in the usual way: or ```shell -./gradle bootRun +./gradlew bootRun ``` You can try it out using a gRPC client like `grpcurl`: