diff --git a/client/android/Notifier/app/build.gradle b/client/android/Notifier/app/build.gradle index 292b1abe922a3699942ba60e87e50158bbf4fd93..53af7d24302fc79b6b5ae6ae4c0717e52f266b4c 100644 --- a/client/android/Notifier/app/build.gradle +++ b/client/android/Notifier/app/build.gradle @@ -1,5 +1,6 @@ plugins { id 'com.android.application' + id 'com.google.protobuf' version '0.8.17' } android { @@ -25,8 +26,38 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + + sourceSets { + main { + proto { + srcDirs "../../../../shared" + } + } + } +} + +protobuf { + protoc { + artifact = "com.google.protobuf:protoc:3.19.2" + } + plugins { + grpc { + artifact = 'io.grpc:protoc-gen-grpc-java:1.45.1' + } + } + generateProtoTasks { + all().each { task -> + task.builtins { + java { option 'lite' } + } + task.plugins { + grpc { option 'lite' } + } + } + } } + dependencies { implementation "androidx.core:core:1.7.0" @@ -36,4 +67,9 @@ dependencies { testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + + implementation 'io.grpc:grpc-okhttp:1.45.1' + implementation 'io.grpc:grpc-protobuf-lite:1.45.1' + implementation 'io.grpc:grpc-stub:1.45.1' + compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+ } \ No newline at end of file diff --git a/shared/netcode.proto b/shared/netcode.proto index efb2582317b2e6cbf17503327044089a4fb16a7b..542ada6e56528a4145178d8da2ec8d5ebeae4b4c 100644 --- a/shared/netcode.proto +++ b/shared/netcode.proto @@ -1,4 +1,10 @@ syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "io.grpc.notifier"; +option java_outer_classname = "NotifierComProto"; +option objc_class_prefix = "NC"; + package netcode; service NotifierCom {