(fix) Prevent protos from being cleaned

This commit is contained in:
KingRainbow44
2023-11-25 23:03:24 -05:00
parent 7b3ad329b7
commit e5133841e7

View File

@@ -12,10 +12,10 @@ plugins {
// Apply the java plugin to add support for Java
id 'java'
// Protoc plugin
id 'com.google.protobuf' version '0.8.19'
id 'eclipse'
}
@@ -39,19 +39,23 @@ protobuf {
artifact = 'us.hebi.quickbuf:protoc-gen-quickbuf:1.3.1'
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
}
task.plugins {
quickbuf {
//option 'store_unknown_fields=true'
outputSubDir = ''
}
}
}
}
if (System.getenv("GENERATE_PROTO") == "true") {
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
}
task.plugins {
quickbuf {
//option 'store_unknown_fields=true'
outputSubDir = ''
}
}
}
}
}
generatedFilesBaseDir = "$projectDir/src/generated/"
}
@@ -64,24 +68,24 @@ dependencies {
implementation group: 'it.unimi.dsi', name: 'fastutil-core', version: '8.5.12'
implementation group: 'org.reflections', name: 'reflections', version: '0.10.2'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
implementation group: 'us.hebi.quickbuf', name: 'quickbuf-runtime', version: '1.3.1'
implementation group: 'io.javalin', name: 'javalin', version: '5.6.2'
implementation group: 'io.netty', name: 'netty-common', version: '4.1.98.Final'
implementation group: 'io.netty', name: 'netty-handler', version: '4.1.98.Final'
implementation group: 'io.netty', name: 'netty-transport-native-epoll', version: '4.1.98.Final'
implementation group: 'io.netty', name: 'netty-transport-native-kqueue', version: '4.1.98.Final'
implementation group: 'dev.morphia.morphia', name: 'morphia-core', version: '2.3.8'
implementation group: 'de.bwaldvogel', name: 'mongo-java-server', version: '1.44.0'
implementation group: 'de.bwaldvogel', name: 'mongo-java-server-h2-backend', version: '1.44.0'
implementation group: 'org.jline', name: 'jline', version: '3.23.0'
implementation group: 'org.jline', name: 'jline-terminal-jansi', version: '3.23.0'
protobuf files('proto/')
compileOnly 'org.projectlombok:lombok:1.18.30'
@@ -118,7 +122,7 @@ jar {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from('src/main/java') {
@@ -174,4 +178,4 @@ task updateProto {
processResources {
dependsOn 'generateProto'
}
}