Skip to content

Commit

Permalink
How to regenerate protobuf files
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed Jul 16, 2023
1 parent 94eee3d commit 2a7199e
Show file tree
Hide file tree
Showing 8 changed files with 4,961 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: format get test publish deploy centrifugo-up centrifugo-down coverage analyze check pana
.PHONY: format get test publish deploy centrifugo-up centrifugo-down coverage analyze check pana generate

format:
@echo "Formatting the code"
Expand Down Expand Up @@ -40,4 +40,9 @@ check: analyze
@dart pub global activate pana
@pana --json --no-warning --line-length 80 > log.pana.json

pana: check
pana: check

generate:
@dart pub global activate protoc_plugin
@protoc --proto_path=lib/src/model/protobuf --dart_out=lib/src/model/protobuf lib/src/model/protobuf/client.proto
@dart format -l 80 lib/src/model/protobuf/
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
# Websocket client for [Centrifugo server](https://github.com/centrifugal/centrifugo) and [Centrifuge library](https://github.com/centrifugal/centrifuge).
# Centrifuge Dart

Websocket client for [Centrifugo server](https://github.com/centrifugal/centrifugo) and [Centrifuge library](https://github.com/centrifugal/centrifuge) based on [ws library](https://pub.dev/packages/ws).

## How to regenerate protobuf files

Windows:

```ps1
$ choco install protoc
$ dart pub global activate protoc_plugin
$ protoc --proto_path=lib/src/model/protobuf --dart_out=lib/src/model/protobuf lib/src/model/protobuf/client.proto
$ dart format -l 80 lib/src/model/protobuf/
```

Linux:

```bash
$ sudo apt update
$ sudo apt install -y protobuf-compiler dart
$ export PATH="$PATH":"$HOME/.pub-cache/bin"
$ dart pub global activate protoc_plugin
$ protoc --proto_path=lib/src/model/protobuf --dart_out=lib/src/model/protobuf lib/src/model/protobuf/client.proto
$ dart format -l 80 lib/src/model/protobuf/
```

macOS:

```zsh
$ brew update
$ brew install protobuf dart
$ export PATH="$PATH":"$HOME/.pub-cache/bin"
$ dart pub global activate protoc_plugin
$ protoc --proto_path=lib/src/model/protobuf --dart_out=lib/src/model/protobuf lib/src/model/protobuf/client.proto
$ dart format -l 80 lib/src/model/protobuf/
```
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ analyzer:
- "build/**"
# Codegen
- "lib/**.g.dart"
- "lib/src/proto/**"
- "lib/src/model/protobuf/*"
# Tests
- "test/**.mocks.dart"
- ".test_coverage.dart"
Expand Down
Loading

0 comments on commit 2a7199e

Please sign in to comment.