This plugin is a Gradle plugin that allows you to use the Protolock in gradle.
You can check more examples in the repository
- Add Protolock in your
PATH(you can download it from here) - Add the plugin to your
build.gradlefile
plugins {
id 'io.github.rost5000.gradle.protolock'
}You can configure the directory of proto by:
protolock {
location{
defaultLocation {
setProtorootDir("$projectDir/src/main/proto")
lockDir = "$projectDir/src/main/proto"
}
}
}You can configure many locations by:
protolock {
location {
defaultLocation {
setProtorootDir("$projectDir/src/main/proto")
lockDir = "$projectDir/src/main/proto"
}
location {
setProtorootDir("$projectDir/src/main/proto2")
lockDir = "$projectDir/src/main/proto2"
}
}
}Plugin tries run protolock from your PATH environment.
You can specify the location of protolock by:
protolock {
protolock {
path = "path-to-protolock/protolock"
}
}You can specify the dependency of protolock by for maven central repository:
protolock {
protolock {
artifact = "io.github.rost5000.protolock:protolock-binaries:0.17.0"
}
}if you want do not fail your build if protolock found some errors, you can configure the plugin by:
protolock {
firstLocation {
setProtorootDir("$projectDir/src/main/proto")
lockDir = "$projectDir/src/main/proto"
throwOnError = fasle
}
}You can use protobuf gradle plugin, then dirrectory src/main/proto
in your project will be added automatically.
gradle protolockInit-- initialize your directories with fileproto.lock. Analog toprotolock initgradle protolockStatus-- check backwards compatibility. Analog toprotolock status. This command will be executed automatically when you rungradle test.gradle protolockCommit-- commit your changes. Analogprotolock commit
- plugin directory contains plugin source code.
- samples directory contains samples for usage plugin.
- protolock-publisher directory for publishing binaries to Maven Central repository