Add Gradle tasks to generate protobuf, update readme

This commit is contained in:
Alexander Udalov
2017-10-07 13:27:32 +02:00
parent 450bfca41f
commit 6d9e8c9414
2 changed files with 10 additions and 6 deletions
+8 -5
View File
@@ -62,10 +62,13 @@ projectTest {
workingDir = rootDir
}
val generateTests by task<JavaExec> {
fun generator(fqName: String) = task<JavaExec> {
classpath = the<JavaPluginConvention>().sourceSets["test"].runtimeClasspath
main = "org.jetbrains.kotlin.generators.tests.GenerateTestsKt"
main = fqName
workingDir = rootDir
}
}
val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateTestsKt")
val generateProtoBuf by generator("org.jetbrains.kotlin.generators.protobuf.GenerateProtoBufKt")
val generateProtoBufCompare by generator("org.jetbrains.kotlin.generators.protobuf.GenerateProtoBufCompare")
@@ -27,7 +27,8 @@ import java.util.regex.Pattern
//
// * Windows: download and unpack from here: https://code.google.com/p/protobuf/downloads/list
// * Ubuntu: install "protobuf-compiler" package
// * Mac OS: install "protobuf" package from Homebrew or "protobuf-cpp" from MacPorts
// * macOS:
// brew install https://raw.githubusercontent.com/udalov/protobuf261/master/protobuf261.rb
// * You can also download source and build it yourself (https://code.google.com/p/protobuf/downloads/list)
//
// You may need to provide custom path to protoc executable, just modify this constant: