[Editor] Install ProtocolBuffers

This commit is contained in:
2021-02-09 17:41:36 +01:00
parent cb820e3632
commit d37ed7eafe
2 changed files with 30 additions and 1 deletions

View File

@@ -5,3 +5,5 @@ jomlVersion=1.10.0
guavaVersion=29.0-jre guavaVersion=29.0-jre
tornadoFxVersion=2.0.0-SNAPSHOT tornadoFxVersion=2.0.0-SNAPSHOT
ikonliVersion=12.2.0 ikonliVersion=12.2.0
protobufPluginVersion=0.8.14
protobufVersion=3.14.0

View File

@@ -1,5 +1,6 @@
plugins { plugins {
id 'java-library' id 'java-library'
id "com.google.protobuf" version "$protobufPluginVersion"
} }
group 'com.bartlomiejpluta.base' group 'com.bartlomiejpluta.base'
@@ -10,9 +11,35 @@ repositories {
} }
dependencies { dependencies {
api "com.google.protobuf:protobuf-java:$protobufVersion"
} }
test { test {
useJUnitPlatform() useJUnitPlatform()
}
sourceSets {
main {
java {
srcDirs "$projectDir/build/proto/main/java"
}
}
}
protobuf {
// Fetch protoc compiler
protoc {
artifact = "com.google.protobuf:protoc:$protobufVersion"
}
generatedFilesBaseDir = "$projectDir/build/proto/"
// Enable compiling proto files to Java
generateProtoTasks {
all().each { task ->
task.builtins {
java { }
}
}
}
} }