mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-06 16:28:16 +00:00
53 lines
1.7 KiB
Groovy
53 lines
1.7 KiB
Groovy
![]() |
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
|
||
|
compileOnly externalDependency.lombok
|
||
|
annotationProcessor externalDependency.lombok
|
||
|
testImplementation externalDependency.junitJupiterApi
|
||
|
testRuntimeOnly externalDependency.junitJupiterEngine
|
||
|
}
|
||
|
|
||
|
import java.nio.file.Path
|
||
|
task compileProtobuf {
|
||
|
doLast {
|
||
|
def basePath = Path.of("${projectDir}/src/test/resources")
|
||
|
[
|
||
|
fileTree("${projectDir}/src/test/resources/protobuf") { include "*.proto" },
|
||
|
fileTree("${projectDir}/src/test/resources/extended_protobuf") { include "*.proto" }
|
||
|
].collectMany { it.collect() }.each { f ->
|
||
|
def input = basePath.relativize(Path.of(f.getAbsolutePath()))
|
||
|
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
|
||
|
}
|