application-services/build-scripts/protobuf-common.gradle

39 строки
882 B
Groovy

// This script defines common setup logic for our components that use protocol buffers.
// Absent some special need for customization, we expect each project under `/components`
// that uses protocol buffers to apply this script to their build process via:
//
// ```
// apply from: "$rootDir/build-scripts/protobuf-common.gradle"
// ```
apply plugin: 'com.google.protobuf'
android {
sourceSets {
main {
proto {
srcDir '../src'
}
}
}
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protobuf_version"
}
generateProtoTasks {
all().each { task ->
task.builtins {
java {
option "lite"
}
}
}
}
}
dependencies {
implementation "com.google.protobuf:protobuf-javalite:$protobuf_version"
}