Skip to content

Instantly share code, notes, and snippets.

@gildor
Last active January 28, 2022 12:03
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save gildor/cf37ebb30cd8cf43b65cc70a055ec017 to your computer and use it in GitHub Desktop.
Save gildor/cf37ebb30cd8cf43b65cc70a055ec017 to your computer and use it in GitHub Desktop.
Protobuf Gradle Plugin + Kotlin DSL
import com.google.protobuf.gradle.protobuf
import com.google.protobuf.gradle.protoc
plugins {
java
idea
id("com.google.protobuf") version "0.8.7"
}
repositories {
mavenCentral()
}
val protobufVersion = "3.6.1"
dependencies {
compile("com.google.protobuf:protobuf-java:$protobufVersion")
if (JavaVersion.current().isJava9Compatible) {
implementation("javax.annotation:javax.annotation-api:+")
}
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protobufVersion"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment