Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
96 lines (81 sloc) 2.57 KB
import com.google.protobuf.gradle.*
import org.jetbrains.kotlin.config.KotlinCompilerVersion
plugins {
id("com.android.application")
kotlin("android")
kotlin("android.extensions")
id("com.google.protobuf") version "0.8.8"
}
val grpcVersion = "1.18.0"
val protocVersion = "3.6.1"
android {
compileSdkVersion(28)
defaultConfig {
applicationId = "net.hatone.hello_grpc"
minSdkVersion(21)
targetSdkVersion(28)
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
getByName("debug") {
storeFile = rootProject.file("debug.keystore")
storePassword = "android"
keyAlias = "androiddebugkey"
keyPassword = "android"
}
}
buildTypes {
getByName("debug") {
isMinifyEnabled = false
signingConfig = signingConfigs.getByName("debug")
}
getByName("release") {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(kotlin("stdlib-jdk8", KotlinCompilerVersion.VERSION))
implementation("com.android.support:appcompat-v7:28.0.0")
implementation("com.android.support.constraint:constraint-layout:1.1.3")
// Test
testImplementation("junit:junit:4.12")
androidTestImplementation("com.android.support.test:runner:1.0.2")
androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.2")
// gRPC
implementation("io.grpc:grpc-okhttp:$grpcVersion")
implementation("io.grpc:grpc-protobuf-lite:$grpcVersion")
implementation("io.grpc:grpc-stub:$grpcVersion")
implementation("javax.annotation:javax.annotation-api:1.3.2")
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protocVersion"
}
plugins {
id("javalite") {
artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0"
}
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
}
}
generateProtoTasks {
all().forEach {
it.plugins {
id("javalite")
id("grpc") {
option("lite")
}
}
}
}
}
You can’t perform that action at this time.