This plugin wraps the protop CLI for your Gradle project. For more information about the protop CLI, please refer to the website at protop.io.
Prerequisites:
- Latest version of protop
The current release is version 0.2.0. Import it as a buildscript dependency:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "io.protop:protop-gradle-plugin:0.2.0"
}
}
Apply the plugin, and customize the options:
apply plugin: "io.protop"
protop {
useLinks = true
refreshGitSources = true
}
Add the protop path to your sources. Without this plugin, you'd do the same but with the raw path. Here, the plugin provides that value as a variable:
sourceSets {
main {
proto {
srcDirs += protop.path
}
}
}
Finally, have the Protobuf plugin depend on the protopSync
task:
protobuf {
// ...
generateProtoTasks {
all().each { task ->
task.dependsOn { protopSync }
}
}
}