Skip to content

Instantly share code, notes, and snippets.

@dafinoer
Last active September 10, 2023 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dafinoer/32026c5108fdc58916598993a07e63c3 to your computer and use it in GitHub Desktop.
Save dafinoer/32026c5108fdc58916598993a07e63c3 to your computer and use it in GitHub Desktop.
Setup gradle file protobuf Kotlin
android {
sourceSets {
main {
proto {
// Directory Default Proto
srcDir 'src/main/proto'
}
}
}
}
dependencies {
...
implementation("com.google.protobuf:protobuf-lite:3.0.0")
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.7.0'
}
plugins {
javalite {
artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
}
task.plugins {
javalite { }
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment