2022-01-02 22:48:38 +05:30
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
2022-01-04 01:41:09 -08:00
|
|
|
apply plugin: 'jacoco'
|
2022-01-02 22:48:38 +05:30
|
|
|
|
2022-01-11 14:55:21 -08:00
|
|
|
jar.enabled = false // Since we only want to build shadow jars, disabling the regular jar creation
|
|
|
|
|
2022-01-02 22:48:38 +05:30
|
|
|
dependencies {
|
|
|
|
|
2022-01-11 14:55:21 -08:00
|
|
|
implementation project(':metadata-models')
|
|
|
|
shadow externalDependency.httpAsyncClient // we want our clients to provide this
|
|
|
|
implementation externalDependency.jacksonDataBind
|
2022-01-02 22:48:38 +05:30
|
|
|
compileOnly externalDependency.lombok
|
|
|
|
annotationProcessor externalDependency.lombok
|
2022-01-11 14:55:21 -08:00
|
|
|
testCompile externalDependency.httpAsyncClient // needed as shadow excludes it
|
2022-01-02 22:48:38 +05:30
|
|
|
testCompile externalDependency.mockito
|
|
|
|
testCompile externalDependency.mockServer
|
|
|
|
testCompile externalDependency.mockServerClient
|
|
|
|
}
|
|
|
|
|
2022-01-04 01:41:09 -08:00
|
|
|
jacocoTestReport {
|
|
|
|
dependsOn test // tests are required to run before generating the report
|
|
|
|
}
|
|
|
|
|
2022-01-02 22:48:38 +05:30
|
|
|
test {
|
|
|
|
useJUnit()
|
2022-01-04 01:41:09 -08:00
|
|
|
finalizedBy jacocoTestReport
|
2022-01-02 22:48:38 +05:30
|
|
|
}
|
|
|
|
|
2022-01-11 14:55:21 -08:00
|
|
|
task checkShadowJar(type: Exec) {
|
|
|
|
commandLine 'sh', '-c', 'scripts/check_jar.sh'
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-01-02 22:48:38 +05:30
|
|
|
shadowJar {
|
|
|
|
zip64=true
|
2022-01-11 14:55:21 -08:00
|
|
|
archiveClassifier = ''
|
|
|
|
dependencies {
|
|
|
|
exclude(dependency('org.apache.httpcomponents:httpasyncclient'))
|
|
|
|
}
|
|
|
|
mergeServiceFiles()
|
|
|
|
// we relocate namespaces manually, because we want to know exactly which libs we are exposing and why
|
|
|
|
// we can move to automatic relocation using ConfigureShadowRelocation after we get to a good place on these first
|
|
|
|
relocate 'com.fasterxml.jackson', 'datahub.shaded.jackson'
|
|
|
|
relocate 'net.jcip.annotations', 'datahub.shaded.annotations'
|
|
|
|
relocate 'javassist', 'datahub.shaded.javassist'
|
|
|
|
relocate 'edu.umd.cs.findbugs', 'datahub.shaded.findbugs'
|
|
|
|
relocate 'org.antlr', 'datahub.shaded.org.antlr'
|
|
|
|
relocate 'antlr', 'datahub.shaded.antlr'
|
|
|
|
relocate 'com.google.common', 'datahub.shaded.com.google.common'
|
|
|
|
relocate 'org.apache.commons', 'datahub.shaded.org.apache.commons'
|
|
|
|
relocate 'org.reflections', 'datahub.shaded.org.reflections'
|
|
|
|
relocate 'st4hidden', 'datahub.shaded.st4hidden'
|
|
|
|
relocate 'org.stringtemplate', 'datahub.shaded.org.stringtemplate'
|
|
|
|
relocate 'org.abego.treelayout', 'datahub.shaded.treelayout'
|
|
|
|
relocate 'org.slf4j', 'datahub.shaded.slf4j'
|
|
|
|
relocate 'javax.annotation', 'datahub.shaded.javax.annotation'
|
|
|
|
finalizedBy checkShadowJar
|
|
|
|
}
|
|
|
|
|
|
|
|
checkShadowJar {
|
|
|
|
dependsOn shadowJar
|
2022-01-02 22:48:38 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
assemble {
|
|
|
|
dependsOn shadowJar
|
|
|
|
}
|