This is a temporal workflow that will evolve with codebase. The steps described below are temporary and better ones will be coming.
-
Clone this repo.
-
Copy the Git pre-commit hooks. This will automatically check the build, run tests, and perform linting before each commit.
cp .githooks/pre-commit .git/hooks/pre-commit
-
Clone googleapis and gapic-showcase and install protoc.
-
Copy the protos from Showcase into googleapis/google/showcase.
cp gapic-showcase/schema/google/showcase/v1beta1 googleapis/google/showcase/v1beta
-
Export tool paths.
PROTOC_INCLUDE_DIR=/usr/local/include/google/protobuf/ GOOGLEAPIS_DIR=/usr/local/google/home/$USER/dev/googleapis YOUR_PROTO_DIR=/usr/local/google/home/$USER/dev/googleapis/google/showcase/v1beta
-
Build this plugin.
bazel build :protoc-gen-java_gapic
-
Run the plugin. At this stage, it will not do anything except write hardcoded Java into two files.
protoc -I=${PROTOC_INCLUDE_DIR} -I=${GOOGLEAPIS_DIR} -I=${YOUR_PROTO_DIR} \ --plugin=bazel-bin/protoc-gen-java_gapic ~/dev/googleapis/google/showcase/v1test/*.proto \ --gapic-java_out=/tmp/test
-
Run linter checks without actually doing the formatting.
bazel build :google_java_format_verification
-
Format files.
bazel run :google_java_format