2022-03-11 12:13:00 -06:00
|
|
|
plugins {
|
|
|
|
id("com.palantir.git-version") apply false
|
|
|
|
}
|
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'jacoco'
|
|
|
|
|
|
|
|
afterEvaluate {
|
|
|
|
if (project.plugins.hasPlugin('java')) {
|
|
|
|
sourceCompatibility = 11
|
|
|
|
targetCompatibility = 11
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation project(':metadata-models')
|
|
|
|
implementation project(path: ':metadata-integration:java:datahub-client', configuration: 'shadow')
|
|
|
|
|
|
|
|
implementation externalDependency.protobuf
|
|
|
|
implementation externalDependency.jgrapht
|
2022-03-30 12:50:13 -05:00
|
|
|
implementation externalDependency.gson
|
|
|
|
|
2022-03-11 12:13:00 -06:00
|
|
|
compileOnly externalDependency.lombok
|
|
|
|
annotationProcessor externalDependency.lombok
|
|
|
|
testImplementation externalDependency.junitJupiterApi
|
|
|
|
testRuntimeOnly externalDependency.junitJupiterEngine
|
|
|
|
}
|
|
|
|
|
2022-03-30 12:50:13 -05:00
|
|
|
import java.nio.file.Paths
|
2022-03-11 12:13:00 -06:00
|
|
|
task compileProtobuf {
|
|
|
|
doLast {
|
2022-03-30 12:50:13 -05:00
|
|
|
def basePath = Paths.get("${projectDir}/src/test/resources")
|
2022-03-11 12:13:00 -06:00
|
|
|
[
|
|
|
|
fileTree("${projectDir}/src/test/resources/protobuf") { include "*.proto" },
|
|
|
|
fileTree("${projectDir}/src/test/resources/extended_protobuf") { include "*.proto" }
|
|
|
|
].collectMany { it.collect() }.each { f ->
|
2022-03-30 12:50:13 -05:00
|
|
|
def input = basePath.relativize(Paths.get(f.getAbsolutePath()))
|
2022-03-11 12:13:00 -06:00
|
|
|
println(input.toString() + " => " + input.toString().replace(".proto", ".protoc"))
|
|
|
|
exec {
|
|
|
|
workingDir "${projectDir}/src/test/resources"
|
|
|
|
commandLine 'protoc', '--proto_path=.', '--include_imports', '--include_source_info',
|
|
|
|
"--descriptor_set_out=${input.toString().replace(".proto", ".protoc")}",
|
|
|
|
input
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
jacocoTestReport {
|
|
|
|
dependsOn test // tests are required to run before generating the report
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnit()
|
|
|
|
finalizedBy jacocoTestReport
|
|
|
|
}
|