opentelemetry-java/sdk/common/build.gradle

67 lines
1.5 KiB
Groovy

plugins {
id "java"
id "maven-publish"
id "ru.vyarus.animalsniffer"
}
description = 'OpenTelemetry SDK Common'
ext.moduleName = "io.opentelemetry.sdk.common"
ext.propertiesDir = "build/generated/properties/io/opentelemetry/sdk/common"
dependencies {
api project(':opentelemetry-api')
implementation libraries.guava
annotationProcessor libraries.auto_value
testAnnotationProcessor libraries.auto_value
testCompileOnly libraries.auto_value_annotation
testImplementation project(':opentelemetry-testing-internal')
testImplementation libraries.junit_pioneer,
libraries.awaitility
signature "org.codehaus.mojo.signature:java17:1.0@signature"
signature "net.sf.androidscents.signature:android-api-level-24:7.0_r2@signature"
}
sourceSets {
main {
output.dir("build/generated/properties", builtBy: 'generateVersionResource')
}
}
animalsniffer {
// Don't check sourceSets.jmh and sourceSets.test
sourceSets = [
sourceSets.main
]
}
configurations {
testClasses {
extendsFrom(testRuntime)
}
}
task testJar(type: Jar) {
archiveClassifier.set("test")
from sourceSets.test.output
}
// add the jar generated by the testJar task to the testClasses dependency
artifacts {
testClasses testJar
}
task generateVersionResource {
doLast {
def folder = file(propertiesDir)
folder.mkdirs()
def propertiesFile = new File(folder.getAbsolutePath(), "version.properties")
propertiesFile.write("sdk.version=${project.version}")
}
}