Last active
September 10, 2023 17:03
-
-
Save dafinoer/32026c5108fdc58916598993a07e63c3 to your computer and use it in GitHub Desktop.
Setup gradle file protobuf Kotlin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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