1*e07d83d3SAndroid Build Coastguard Workerplugins { 2*e07d83d3SAndroid Build Coastguard Worker // ASSUMES GRADLE 5.6 OR HIGHER. Use plugin version 0.8.10 with earlier gradle versions 3*e07d83d3SAndroid Build Coastguard Worker id 'com.google.protobuf' version '0.8.17' 4*e07d83d3SAndroid Build Coastguard Worker // Generate IntelliJ IDEA's .idea & .iml project files 5*e07d83d3SAndroid Build Coastguard Worker id 'idea' 6*e07d83d3SAndroid Build Coastguard Worker id 'war' 7*e07d83d3SAndroid Build Coastguard Worker} 8*e07d83d3SAndroid Build Coastguard Worker 9*e07d83d3SAndroid Build Coastguard Workerrepositories { 10*e07d83d3SAndroid Build Coastguard Worker maven { // The google mirror is less flaky than mavenCentral() 11*e07d83d3SAndroid Build Coastguard Worker url "https://maven-central.storage-download.googleapis.com/maven2/" } 12*e07d83d3SAndroid Build Coastguard Worker mavenLocal() 13*e07d83d3SAndroid Build Coastguard Worker} 14*e07d83d3SAndroid Build Coastguard Worker 15*e07d83d3SAndroid Build Coastguard WorkersourceCompatibility = 1.8 16*e07d83d3SAndroid Build Coastguard WorkertargetCompatibility = 1.8 17*e07d83d3SAndroid Build Coastguard Worker 18*e07d83d3SAndroid Build Coastguard Workerdef grpcVersion = '1.56.1-SNAPSHOT' // CURRENT_GRPC_VERSION 19*e07d83d3SAndroid Build Coastguard Workerdef protocVersion = '3.22.3' 20*e07d83d3SAndroid Build Coastguard Worker 21*e07d83d3SAndroid Build Coastguard Workerdependencies { 22*e07d83d3SAndroid Build Coastguard Worker implementation "io.grpc:grpc-protobuf:${grpcVersion}", 23*e07d83d3SAndroid Build Coastguard Worker "io.grpc:grpc-servlet:${grpcVersion}", 24*e07d83d3SAndroid Build Coastguard Worker "io.grpc:grpc-stub:${grpcVersion}" 25*e07d83d3SAndroid Build Coastguard Worker 26*e07d83d3SAndroid Build Coastguard Worker compileOnly "javax.servlet:javax.servlet-api:4.0.1", 27*e07d83d3SAndroid Build Coastguard Worker "org.apache.tomcat:annotations-api:6.0.53" 28*e07d83d3SAndroid Build Coastguard Worker} 29*e07d83d3SAndroid Build Coastguard Worker 30*e07d83d3SAndroid Build Coastguard Workerprotobuf { 31*e07d83d3SAndroid Build Coastguard Worker protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" } 32*e07d83d3SAndroid Build Coastguard Worker plugins { grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" } } 33*e07d83d3SAndroid Build Coastguard Worker generateProtoTasks { 34*e07d83d3SAndroid Build Coastguard Worker all()*.plugins { grpc {} } 35*e07d83d3SAndroid Build Coastguard Worker } 36*e07d83d3SAndroid Build Coastguard Worker} 37*e07d83d3SAndroid Build Coastguard Worker 38*e07d83d3SAndroid Build Coastguard Worker// Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code. 39*e07d83d3SAndroid Build Coastguard WorkersourceSets { 40*e07d83d3SAndroid Build Coastguard Worker main { 41*e07d83d3SAndroid Build Coastguard Worker java { 42*e07d83d3SAndroid Build Coastguard Worker srcDirs 'build/generated/source/proto/main/grpc' 43*e07d83d3SAndroid Build Coastguard Worker srcDirs 'build/generated/source/proto/main/java' 44*e07d83d3SAndroid Build Coastguard Worker } 45*e07d83d3SAndroid Build Coastguard Worker } 46*e07d83d3SAndroid Build Coastguard Worker} 47