Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Development Workflow

This is a temporal workflow that will evolve with codebase. The steps described
below are temporary and better ones will be coming.

## Running the Plugin

1. Clone [googleapis](https://github.com/googleapis/googleapis) and
[gapic-showcase](https://github.com/googleapis/gapic-showcase/) and install
protoc.
2. Copy the protos from Showcase into googleapis/google/showcase.

```sh
cp gapic-showcase/schema/google/showcase/v1beta1 googleapis/google/showcase/v1beta
```

3. Export tool paths.

```sh
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
```

4. Build this plugin.

```sh
bazel build :protoc-gen-gapic-java
```

5. 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-gapic-java ~/dev/googleapis/google/showcase/v1test/*.proto \
--gapic-java_out=/tmp/test
```

## Code Formatting

- Run linter checks without actually doing the formatting.

```sh
bazel build :google_java_format_verification
```

- Format files.

```sh
bazel run :google_java_format
```