Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 8 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
PLATFORM=$(shell uname -s | tr '[:upper:]' '[:lower:]')

ifeq ($(PLATFORM),darwin)
GRPC_JAVA="https://repo1.maven.org/maven2/io/grpc/protoc-gen-grpc-java/1.39.0/protoc-gen-grpc-java-1.39.0-osx-x86_64.exe"
GRPC_JAVA="https://repo1.maven.org/maven2/io/grpc/protoc-gen-grpc-java/1.51.1/protoc-gen-grpc-java-1.51.1-osx-x86_64.exe"
else ifeq ($(PLATFORM),linux)
GRPC_JAVA="https://repo1.maven.org/maven2/io/grpc/protoc-gen-grpc-java/1.39.0/protoc-gen-grpc-java-1.39.0-linux-x86_64.exe"
GRPC_JAVA="https://repo1.maven.org/maven2/io/grpc/protoc-gen-grpc-java/1.51.1/protoc-gen-grpc-java-1.51.1-linux-x86_64.exe"
else
$(error unknown platform $(PLATFORM))
endif

THIS_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

check-%:
@: $(if $(value $*),,$(error $* is undefined))

buf: check-RDK
buf:
rm -rf core/sdk/src/main/gen
cd $(RDK) && buf generate --template $(THIS_DIR)buf.gen.yaml
cd $(RDK) && buf generate --template $(THIS_DIR)buf.gen.yaml buf.build/viamrobotics/goutils
cd $(RDK) && buf generate --template $(THIS_DIR)buf.gen.yaml buf.build/erdaniels/gostream
buf generate --template buf.gen.yaml buf.build/viamrobotics/api
buf generate --template buf.gen.yaml buf.build/viamrobotics/goutils
buf generate --template buf.gen.yaml buf.build/erdaniels/gostream

setup:
sudo curl -o /usr/local/bin/protoc-gen-grpc-java -L ${GRPC_JAVA}
sudo chmod +x /usr/local/bin/protoc-gen-grpc-java

run_client:
./gradlew runClient --args="localhost:8080"
./gradlew runExample1Client --args="localhost:8080"
Copy link
Contributor

Choose a reason for hiding this comment

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

ty


run_server:
./gradlew runServer --args="8080"
./gradlew runExample1Server --args="8080"
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
## Dependencies

* JDK 11+
* RDK
* Run `RDK=path_to_rdk make setup buf`
* Run `make setup buf`

## Pure Java SDK

### Server
* `cd java/examples`
* `make run_example_server`
* `make run_server`

### Client
* `cd java/examples`
* `make run_example_client`
* `make run_client`

## Android SDK

Expand Down
8 changes: 4 additions & 4 deletions core/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'java-library'
ext.pomDisplayName = "Viam Core SDK"

dependencies {
api 'io.grpc:grpc-protobuf:1.46.0'
api 'io.grpc:grpc-stub:1.46.0'
api 'io.grpc:grpc-protobuf:1.51.1'
api 'io.grpc:grpc-stub:1.51.1'
api 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'org.json:json:20220320'
implementation 'com.google.api.grpc:proto-google-common-protos:2.8.3'
implementation 'org.json:json:20220924'
implementation 'com.google.api.grpc:proto-google-common-protos:2.11.0'
}

sourceSets {
Expand Down
Loading