Create multiproject build, add python grpc build support
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.google.protobuf'
|
||||
|
||||
plugins{
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
@@ -24,38 +26,19 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
protobuf {
|
||||
protoc { artifact = 'com.google.protobuf:protoc:3.10.0' }
|
||||
plugins {
|
||||
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
|
||||
grpc {
|
||||
artifact = 'io.grpc:protoc-gen-grpc-java:1.25.0'
|
||||
}
|
||||
}
|
||||
generateProtoTasks {
|
||||
all().each { task ->
|
||||
task.plugins {
|
||||
javalite {}
|
||||
grpc { // Options added to --grpc_out
|
||||
option 'lite'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':protobuf')
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.preference:preference:1.1.0'
|
||||
implementation 'androidx.preference:preference:1.1.1'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation 'io.grpc:grpc-okhttp:1.25.0'
|
||||
implementation 'io.grpc:grpc-protobuf-lite:1.25.0'
|
||||
implementation 'io.grpc:grpc-stub:1.25.0'
|
||||
implementation 'io.grpc:grpc-okhttp:1.28.1' // CURRENT_GRPC_VERSION
|
||||
implementation 'io.grpc:grpc-protobuf-lite:1.28.1' // CURRENT_GRPC_VERSION
|
||||
implementation 'io.grpc:grpc-stub:1.28.1' // CURRENT_GRPC_VERSION
|
||||
implementation 'javax.annotation:javax.annotation-api:1.2'
|
||||
implementation 'org.zeromq:jeromq:0.5.2'
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "org.vato.carcontroller";
|
||||
option java_outer_classname = "SlamControllerProto";
|
||||
|
||||
import "empty.proto";
|
||||
|
||||
message SlamDetails {
|
||||
int32 map_size_pixels = 1;
|
||||
int32 map_size_meters = 2;
|
||||
int32 port = 3;
|
||||
}
|
||||
|
||||
message SlamRow{
|
||||
repeated int32 points = 1;
|
||||
}
|
||||
|
||||
message SlamLocation{
|
||||
float x = 1;
|
||||
float y = 2;
|
||||
float theta = 3;
|
||||
}
|
||||
|
||||
message SlamScan{
|
||||
bytes map = 1;
|
||||
SlamLocation location = 2;
|
||||
}
|
||||
|
||||
service SlamControl {
|
||||
rpc start_map_streaming(SlamDetails) returns (Empty) {}
|
||||
|
||||
rpc stop_streaming(Empty) returns (Empty) {}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "org.vato.carcontroller";
|
||||
option java_outer_classname = "EmptyProto";
|
||||
|
||||
message Empty{
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package persontracking;
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "org.vato.carcontroller";
|
||||
option java_outer_classname = "PersonTrackingProto";
|
||||
|
||||
import "empty.proto";
|
||||
|
||||
message Int32Value{
|
||||
int32 value = 1;
|
||||
}
|
||||
|
||||
message Point{
|
||||
double angle = 1;
|
||||
int32 distance = 2;
|
||||
int32 group_number = 3;
|
||||
}
|
||||
|
||||
message PointScan{
|
||||
repeated Point points = 1;
|
||||
}
|
||||
|
||||
service PersonTracking{
|
||||
rpc set_tracking_group(Int32Value) returns (Empty) {}
|
||||
|
||||
rpc stop_tracking(Empty) returns (Empty) {}
|
||||
|
||||
rpc start_tracking(Int32Value) returns (Empty) {}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
|
||||
package MotorControl;
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "org.vato.carcontroller";
|
||||
option java_outer_classname = "MotorServiceProto";
|
||||
|
||||
message ThrottleRequest{
|
||||
float throttle = 1;
|
||||
}
|
||||
|
||||
message ThrottleResponse{
|
||||
bool throttleSet = 1;
|
||||
}
|
||||
|
||||
message SteeringRequest{
|
||||
float steering = 1;
|
||||
}
|
||||
|
||||
message SteeringResponse{
|
||||
bool steeringSet = 1;
|
||||
}
|
||||
|
||||
service CarControl{
|
||||
rpc SetThrottle(ThrottleRequest) returns (ThrottleResponse){}
|
||||
rpc SetSteering(SteeringRequest) returns (SteeringResponse){}
|
||||
}
|
||||
Reference in New Issue
Block a user