mirror of https://github.com/grpc/grpc-java.git
60 lines
1.7 KiB
Groovy
60 lines
1.7 KiB
Groovy
apply plugin: 'com.android.application'
|
|
apply plugin: 'com.google.protobuf'
|
|
|
|
android {
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
compileSdkVersion 31
|
|
|
|
defaultConfig {
|
|
applicationId "io.grpc.helloworldexample"
|
|
minSdkVersion 19
|
|
targetSdkVersion 31
|
|
versionCode 1
|
|
versionName "1.0"
|
|
}
|
|
buildTypes {
|
|
debug { minifyEnabled false }
|
|
release {
|
|
minifyEnabled true
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
lintOptions {
|
|
disable 'GoogleAppIndexingWarning', 'HardcodedText', 'InvalidPackage'
|
|
textReport true
|
|
textOutput "stdout"
|
|
}
|
|
}
|
|
|
|
protobuf {
|
|
protoc { artifact = 'com.google.protobuf:protoc:3.22.3' }
|
|
plugins {
|
|
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
|
}
|
|
}
|
|
generateProtoTasks {
|
|
all().each { task ->
|
|
task.builtins {
|
|
java { option 'lite' }
|
|
}
|
|
task.plugins {
|
|
grpc { // Options added to --grpc_out
|
|
option 'lite' }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'com.android.support:appcompat-v7:27.0.2'
|
|
|
|
// You need to build grpc-java to obtain these libraries below.
|
|
implementation 'io.grpc:grpc-okhttp:1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
|
implementation 'io.grpc:grpc-protobuf-lite:1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
|
implementation 'io.grpc:grpc-stub:1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
|
|
implementation 'org.apache.tomcat:annotations-api:6.0.53'
|
|
}
|