Migrate java.gradle to conventions plugin (#3289)

* Migrate java.gradle to convention plugin.

* Switch to java-conventions

* Remove old file

* Fix

* Fix merge

* Missing paragraph

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
This commit is contained in:
Anuraag Agrawal 2021-06-15 08:10:39 +09:00 committed by GitHub
parent 9f31a057b6
commit 224dc51e93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
67 changed files with 319 additions and 333 deletions

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
description = 'e2e benchmark'

View File

@ -2,7 +2,7 @@ plugins {
id "com.github.johnrengelman.shadow"
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
description = 'Integration Level Agent benchmarks.'
@ -11,7 +11,7 @@ targetCompatibility = 1.8
subprojects { sub ->
sub.apply plugin: 'com.github.johnrengelman.shadow'
sub.apply from: "$rootDir/gradle/java.gradle"
sub.apply plugin: "otel.java-conventions"
javadoc.enabled = false
}

View File

@ -3,7 +3,7 @@ plugins {
id "com.github.johnrengelman.shadow"
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
jmh platform(project(":dependencyManagement"))

View File

@ -44,8 +44,10 @@ dependencies {
implementation("org.ow2.asm:asm:7.0-beta")
implementation("org.ow2.asm:asm-tree:7.0-beta")
implementation("org.apache.httpcomponents:httpclient:4.5.10")
implementation("org.gradle:test-retry-gradle-plugin:1.2.1")
// When updating, also update dependencyManagement/dependencyManagement.gradle.kts
implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.11.2")
implementation("net.ltgt.gradle:gradle-errorprone-plugin:2.0.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.1")

View File

@ -0,0 +1,252 @@
import java.time.Duration
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
plugins {
`java-library`
groovy
id("org.gradle.test-retry")
id("net.ltgt.errorprone")
}
apply(from = "$rootDir/gradle/spotless.gradle")
apply(from = "$rootDir/gradle/codenarc.gradle")
apply(from = "$rootDir/gradle/checkstyle.gradle")
afterEvaluate {
if (findProperty("mavenGroupId") == "io.opentelemetry.javaagent.instrumentation") {
base.archivesBaseName = "opentelemetry-javaagent-${base.archivesBaseName}"
} else {
base.archivesBaseName = "opentelemetry-${base.archivesBaseName}"
}
}
// Version to use to compile code and run tests.
val DEFAULT_JAVA_VERSION = JavaVersion.VERSION_11
val applyCodeCoverage = !project.path.run {
startsWith(":smoke-tests") ||
startsWith(":benchmark") ||
startsWith(":instrumentation") ||
startsWith(":testing-common")
}
if (applyCodeCoverage) {
apply(from = "${rootDir}/gradle/jacoco.gradle")
}
val minJavaVersionSupported = project.findProperty("minJavaVersionSupported")?.let(JavaVersion::toVersion)
?: JavaVersion.VERSION_1_8
val maxJavaVersionForTests = project.findProperty("maxJavaVersionForTests")?.let(JavaVersion::toVersion)
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(
Math.max(minJavaVersionSupported.majorVersion.toInt(), DEFAULT_JAVA_VERSION.majorVersion.toInt())))
}
// See https://docs.gradle.org/current/userguide/upgrading_version_5.html, Automatic target JVM version
disableAutoTargetJvm()
withJavadocJar()
withSourcesJar()
}
tasks.withType<JavaCompile>().configureEach {
with(options) {
release.set(minJavaVersionSupported.majorVersion.toInt())
compilerArgs.add("-Werror")
}
}
// Groovy and Scala compilers don't actually understand --release option
tasks.withType<GroovyCompile>().configureEach {
sourceCompatibility = minJavaVersionSupported.majorVersion
targetCompatibility = minJavaVersionSupported.majorVersion
}
tasks.withType<ScalaCompile>().configureEach {
sourceCompatibility = minJavaVersionSupported.majorVersion
targetCompatibility = minJavaVersionSupported.majorVersion
}
evaluationDependsOn(":dependencyManagement")
val dependencyManagementConf = configurations.create("dependencyManagement") {
isCanBeConsumed = false
isCanBeResolved = false
isVisible = false
}
afterEvaluate {
configurations.configureEach {
if (isCanBeResolved && !isCanBeConsumed) {
extendsFrom(dependencyManagementConf)
}
}
}
// Force 4.0, or 4.1 to the highest version of that branch. Since 4.0 and 4.1 often have
// compatibility issues we can't just force to the highest version using normal BOM dependencies.
abstract class NettyAlignmentRule : ComponentMetadataRule {
override fun execute(ctx: ComponentMetadataContext) {
with(ctx.details) {
if (id.group == "io.netty" && id.name != "netty") {
if (id.version.startsWith("4.1.")) {
belongsTo("io.netty:netty-bom:4.1.65.Final", false)
} else if (id.version.startsWith("4.0.")) {
belongsTo("io.netty:netty-bom:4.0.56.Final", false)
}
}
}
}
}
dependencies {
add(dependencyManagementConf.name, platform(project(":dependencyManagement")))
components.all<NettyAlignmentRule>()
compileOnly("org.checkerframework:checker-qual")
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")
testImplementation("org.objenesis:objenesis")
testImplementation("org.spockframework:spock-core")
testImplementation("ch.qos.logback:logback-classic")
testImplementation("org.slf4j:log4j-over-slf4j")
testImplementation("org.slf4j:jcl-over-slf4j")
testImplementation("org.slf4j:jul-to-slf4j")
testImplementation("info.solidsoft.spock:spock-global-unroll")
testImplementation("com.github.stefanbirkner:system-rules")
}
tasks {
named<Jar>("jar") {
// By default Gradle Jar task can put multiple files with the same name
// into a Jar. This may lead to confusion. For example if auto-service
// annotation processing creates files with same name in `scala` and
// `java` directory this would result in Jar having two files with the
// same name in it. Which in turn would result in only one of those
// files being actually considered when that Jar is used leading to very
// confusing failures. Instead we should 'fail early' and avoid building such Jars.
duplicatesStrategy = DuplicatesStrategy.FAIL
manifest {
attributes(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
"Implementation-Vendor" to "OpenTelemetry",
"Implementation-URL" to "https://github.com/open-telemetry/opentelemetry-java-instrumentation"
)
}
}
named<Javadoc>("javadoc") {
with(options as StandardJavadocDocletOptions) {
source = "8"
encoding = "UTF-8"
docEncoding = "UTF-8"
charSet = "UTF-8"
breakIterator(true)
links("https://docs.oracle.com/javase/8/docs/api/")
addStringOption("Xdoclint:none", "-quiet")
// non-standard option to fail on warnings, see https://bugs.openjdk.java.net/browse/JDK-8200363
addStringOption("Xwerror", "-quiet")
}
}
withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
}
normalization {
runtimeClasspath {
metaInf {
ignoreAttribute("Implementation-Version")
}
}
}
fun isJavaVersionAllowed(version: JavaVersion): Boolean {
if (minJavaVersionSupported.compareTo(version) > 0) {
return false
}
if (maxJavaVersionForTests != null && maxJavaVersionForTests.compareTo(version) < 0) {
return false
}
return true
}
val testJavaVersion = rootProject.findProperty("testJavaVersion")?.let(JavaVersion::toVersion)
val resourceClassesCsv = listOf("Host", "Os", "Process", "ProcessRuntime").map { "io.opentelemetry.sdk.extension.resources.${it}ResourceProvider" }.joinToString(",")
tasks.withType<Test>().configureEach {
useJUnitPlatform()
// There's no real harm in setting this for all tests even if any happen to not be using context
// propagation.
jvmArgs("-Dio.opentelemetry.context.enableStrictContext=${rootProject.findProperty("enableStrictContext") ?: false}")
// TODO(anuraaga): Have agent map unshaded to shaded.
jvmArgs("-Dio.opentelemetry.javaagent.shaded.io.opentelemetry.context.enableStrictContext=${rootProject.findProperty("enableStrictContext") ?: false}")
// Disable default resource providers since they cause lots of output we don't need.
jvmArgs("-Dotel.java.disabled.resource.providers=${resourceClassesCsv}")
val trustStore = project(":testing-common").file("src/misc/testing-keystore.p12")
inputs.file(trustStore)
// Work around payara not working when this is set for some reason.
if (project.name != "jaxrs-2.0-payara-testing") {
jvmArgs("-Djavax.net.ssl.trustStore=${trustStore.absolutePath}")
jvmArgs("-Djavax.net.ssl.trustStorePassword=testing")
}
// All tests must complete within 15 minutes.
// This value is quite big because with lower values (3 mins) we were experiencing large number of false positives
timeout.set(Duration.ofMinutes(15))
retry {
// You can see tests that were retried by this mechanism in the collected test reports and build scans.
maxRetries.set(if (System.getenv("CI") != null) 5 else 0)
}
reports {
junitXml.isOutputPerTestCase = true
}
testLogging {
exceptionFormat = TestExceptionFormat.FULL
}
if (testJavaVersion != null) {
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(testJavaVersion.majorVersion))
})
isEnabled = isJavaVersionAllowed(testJavaVersion)
} else {
// We default to testing with Java 11 for most tests, but some tests don't support it, where we change
// the default test task's version so commands like `./gradlew check` can test all projects regardless
// of Java version.
if (!isJavaVersionAllowed(DEFAULT_JAVA_VERSION) && maxJavaVersionForTests != null) {
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(maxJavaVersionForTests.majorVersion))
})
}
}
}
afterEvaluate {
if (plugins.hasPlugin("org.unbroken-dome.test-sets") && configurations.findByName("latestDepTestRuntime") != null) {
tasks.withType<Test>().configureEach {
doFirst {
val testArtifacts = configurations.testRuntimeClasspath.get().resolvedConfiguration.resolvedArtifacts
val latestTestArtifacts = configurations.getByName("latestDepTestRuntimeClasspath").resolvedConfiguration.resolvedArtifacts
if (testArtifacts == latestTestArtifacts) {
throw IllegalStateException("latestDepTest dependencies are identical to test")
}
}
}
}
}

View File

@ -155,7 +155,7 @@ from instrumented server or library will be used.
Create a module called `compile-stub` and add `compile-stub.gradle` with following content
```
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
```
In javaagent module add compile only dependency with
```

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
apply from: "$rootDir/gradle/instrumentation-common.gradle"

View File

@ -10,7 +10,7 @@ ext {
noShadowPublish = true
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
if (project.ext.find("skipPublish") != true) {
apply from: "$rootDir/gradle/publish.gradle"
}

View File

@ -1,265 +0,0 @@
import java.time.Duration
apply plugin: 'java-library'
apply plugin: 'groovy'
apply plugin: 'org.gradle.test-retry'
apply plugin: 'net.ltgt.errorprone'
apply from: "$rootDir/gradle/spotless.gradle"
apply from: "$rootDir/gradle/codenarc.gradle"
apply from: "$rootDir/gradle/checkstyle.gradle"
afterEvaluate {
if (findProperty('mavenGroupId') == 'io.opentelemetry.javaagent.instrumentation') {
archivesBaseName = 'opentelemetry-javaagent-' + archivesBaseName
} else {
archivesBaseName = 'opentelemetry-' + archivesBaseName
}
}
// Version to use to compile code and run tests.
def DEFAULT_JAVA_VERSION = 11
def applyCodeCoverage = !(
project.path.startsWith(":smoke-tests") ||
//TODO why some tests fail on java 11 if jacoco is present?
project.path == ":javaagent" ||
project.path.startsWith(":benchmark") ||
project.path.startsWith(":instrumentation") ||
project.path.startsWith(":testing-common"))
if (applyCodeCoverage) {
apply from: "$rootDir/gradle/jacoco.gradle"
}
if (project.hasProperty("minJavaVersionSupported")) {
project.ext.release = project.getProperty("minJavaVersionSupported")
} else {
project.ext.release = JavaVersion.VERSION_1_8
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(Math.max(project.ext.release.majorVersion.toInteger(), DEFAULT_JAVA_VERSION))
}
// See https://docs.gradle.org/current/userguide/upgrading_version_5.html, Automatic target JVM version
disableAutoTargetJvm()
withJavadocJar()
withSourcesJar()
}
tasks.withType(JavaCompile).configureEach {
options.release.set(project.ext.release.majorVersion.toInteger())
options.compilerArgs.add("-Werror")
}
//Groovy and Scala compilers don't actually understand --release option
tasks.withType(GroovyCompile).configureEach {
sourceCompatibility = JavaVersion.toVersion(project.ext.release)
targetCompatibility = JavaVersion.toVersion(project.ext.release)
}
tasks.withType(ScalaCompile).configureEach {
sourceCompatibility = JavaVersion.toVersion(project.ext.release)
targetCompatibility = JavaVersion.toVersion(project.ext.release)
}
evaluationDependsOn(":dependencyManagement")
configurations {
dependencyManagement {
canBeConsumed = false
canBeResolved = false
visible = false
}
}
afterEvaluate {
configurations.configureEach {
if (canBeResolved && !canBeConsumed) {
extendsFrom(configurations.dependencyManagement)
}
}
}
// Force 4.0, or 4.1 to the highest version of that branch. Since 4.0 and 4.1 often have
// compatibility issues we can't just force to the highest version using normal BOM dependencies.
abstract class NettyAlignmentRule implements ComponentMetadataRule {
void execute(ComponentMetadataContext ctx) {
ctx.details.with {
if (id.group == "io.netty" && id.name != "netty") {
if (id.version.startsWith("4.1.")) {
belongsTo("io.netty:netty-bom:4.1.65.Final", false)
} else if (id.version.startsWith("4.0.")) {
belongsTo("io.netty:netty-bom:4.0.56.Final", false)
}
}
}
}
}
dependencies {
dependencyManagement platform(project(":dependencyManagement"))
components.all(NettyAlignmentRule)
compileOnly "org.checkerframework:checker-qual"
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.junit.jupiter:junit-jupiter-params"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine"
testImplementation "org.objenesis:objenesis"
testImplementation "org.spockframework:spock-core"
testImplementation "ch.qos.logback:logback-classic"
testImplementation "org.slf4j:log4j-over-slf4j"
testImplementation "org.slf4j:jcl-over-slf4j"
testImplementation "org.slf4j:jul-to-slf4j"
testImplementation "info.solidsoft.spock:spock-global-unroll"
testImplementation "com.github.stefanbirkner:system-rules"
}
tasks.named('jar').configure {
/*
Make Jar build fail on duplicate files
By default Gradle Jar task can put multiple files with the same name
into a Jar. This may lead to confusion. For example if auto-service
annotation processing creates files with same name in `scala` and
`java` directory this would result in Jar having two files with the
same name in it. Which in turn would result in only one of those
files being actually considered when that Jar is used leading to very
confusing failures.
Instead we should 'fail early' and avoid building such Jars.
*/
duplicatesStrategy = 'fail'
manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Implementation-Vendor": "OpenTelemetry",
"Implementation-URL": "https://github.com/open-telemetry/opentelemetry-java-instrumentation",
)
}
}
normalization {
runtimeClasspath {
metaInf {
ignoreAttribute("Implementation-Version")
}
}
}
tasks.named('javadoc').configure {
options.addStringOption('Xdoclint:none', '-quiet')
// non-standard option to fail on warnings, see https://bugs.openjdk.java.net/browse/JDK-8200363
options.addStringOption('Xwerror', '-quiet')
doFirst {
if (project.ext.has("apiLinks")) {
options.links(*project.apiLinks)
}
}
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
options {
encoding = "utf-8"
docEncoding = "utf-8"
charSet = "utf-8"
setMemberLevel JavadocMemberLevel.PUBLIC
setAuthor true
links "https://docs.oracle.com/javase/8/docs/api/"
source = 8
}
}
project.afterEvaluate {
if (project.plugins.hasPlugin('org.unbroken-dome.test-sets') && configurations.hasProperty("latestDepTestRuntime")) {
tasks.withType(Test).configureEach {
doFirst {
def testArtifacts = configurations.testRuntimeClasspath.resolvedConfiguration.resolvedArtifacts
def latestTestArtifacts = configurations.latestDepTestRuntimeClasspath.resolvedConfiguration.resolvedArtifacts
assert testArtifacts != latestTestArtifacts: "latestDepTest dependencies are identical to test"
}
}
}
}
def isJavaVersionAllowed(JavaVersion version) {
if (project.hasProperty('minJavaVersionSupported') && project.getProperty('minJavaVersionSupported').compareTo(version) > 0) {
return false
}
if (project.hasProperty('maxJavaVersionForTests') && project.getProperty('maxJavaVersionForTests').compareTo(version) < 0) {
return false
}
return true
}
def testJavaVersion = rootProject.findProperty('testJavaVersion')
if (testJavaVersion != null) {
def requestedJavaVersion = JavaVersion.toVersion(testJavaVersion)
tasks.withType(Test).configureEach {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(requestedJavaVersion.majorVersion)
}
enabled = isJavaVersionAllowed(requestedJavaVersion)
}
} else {
// We default to testing with Java 11 for most tests, but some tests don't support it, where we change
// the default test task's version so commands like `./gradlew check` can test all projects regardless
// of Java version.
if (!isJavaVersionAllowed(JavaVersion.toVersion(DEFAULT_JAVA_VERSION))) {
tasks.withType(Test).configureEach {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(project.getProperty('maxJavaVersionForTests').majorVersion)
}
}
}
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
// All tests must complete within 15 minutes.
// This value is quite big because with lower values (3 mins) we were experiencing large number of false positives
timeout = Duration.ofMinutes(15)
retry {
// You can see tests that were retried by this mechanism in the collected test reports and build scans.
maxRetries = System.getenv("CI") != null ? 5 : 0
}
reports {
junitXml.outputPerTestCase = true
}
testLogging {
exceptionFormat = 'full'
}
// There's no real harm in setting this for all tests even if any happen to not be using context
// propagation.
jvmArgs "-Dio.opentelemetry.context.enableStrictContext=${rootProject.findProperty('enableStrictContext') ?: false}"
// TODO(anuraaga): Have agent map unshaded to shaded.
jvmArgs "-Dio.opentelemetry.javaagent.shaded.io.opentelemetry.context.enableStrictContext=${rootProject.findProperty('enableStrictContext') ?: false}"
def trustStore = project(":testing-common").file("src/misc/testing-keystore.p12")
inputs.file(trustStore)
// Work around payara not working when this is set for some reason.
if (project.name != "jaxrs-2.0-payara-testing") {
jvmArgs "-Djavax.net.ssl.trustStore=${trustStore.absolutePath}"
jvmArgs "-Djavax.net.ssl.trustStorePassword=testing"
}
def resourceClassesCsv = ['Host', 'Os', 'Process', 'ProcessRuntime'].collect { "io.opentelemetry.sdk.extension.resources.${it}ResourceProvider" }.join(",")
jvmArgs "-Dotel.java.disabled.resource.providers=${resourceClassesCsv}"
}
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}

View File

@ -4,7 +4,7 @@ plugins {
group = 'io.opentelemetry.instrumentation'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
configurations {

View File

@ -4,7 +4,7 @@ plugins {
group = 'io.opentelemetry.instrumentation'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
def jflexTargetDir = file"${project.buildDir}/generated/jflex/sql"

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
testImplementation project(':instrumentation:apache-camel-2.20:javaagent')

View File

@ -2,7 +2,7 @@ plugins {
id "java-library"
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
def apacheDubboVersion = '2.7.5'

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
testImplementation "org.codehaus.groovy:groovy-all"

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
testImplementation project(':instrumentation-api')

View File

@ -3,7 +3,7 @@ plugins {
id "com.google.protobuf" version "0.8.16"
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
def grpcVersion = '1.6.0'

View File

@ -2,7 +2,7 @@
plugins {
id "otel.shadow-conventions"
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
Project instr_project = project
subprojects {

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
testImplementation project(':instrumentation:internal:internal-proxy:javaagent')

View File

@ -1,7 +1,7 @@
ext {
skipPublish = true
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
// add repo for org.gradle:gradle-tooling-api which org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-gradle-depchain depends on
repositories {

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -2,7 +2,7 @@ plugins {
id "org.unbroken-dome.xjc" version "2.0.0"
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
checkstyle {
// exclude generated web service classes

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
testImplementation project(':instrumentation:jdbc:javaagent')

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
testImplementation "javax.jms:jms-api:1.1-rev-1"

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api "ch.qos.logback:logback-classic"

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
testImplementation project(':instrumentation:kubernetes-client-7.0:javaagent')

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -3,7 +3,7 @@
ext.mavenGroupId = 'io.opentelemetry.javaagent.instrumentation'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
archivesBaseName = projectDir.parentFile.name

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
// liberty jars are not available as a maven dependency so we provide stripped
// down versions of liberty classes that we can use from integration code without

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
compileOnly project(":instrumentation:logback-1.0:library")

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':instrumentation:mongo:mongo-testing')

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api(project(':testing-common')) {

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
def scalaVersion = '2.12'

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -27,8 +27,8 @@ test.dependsOn rmic
// We also can't seem to use the toolchain without the "--release" option. So disable everything.
java {
sourceCompatibility = JavaVersion.toVersion(project.ext.release)
targetCompatibility = JavaVersion.toVersion(project.ext.release)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion = null
}

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
api project(':testing-common')

View File

@ -1,6 +1,6 @@
group = 'io.opentelemetry.instrumentation'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
sourceCompatibility = '8'

View File

@ -4,7 +4,7 @@ ext {
group = 'io.opentelemetry.instrumentation'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
sourceCompatibility = '8'

View File

@ -1,6 +1,6 @@
group = 'io.opentelemetry.instrumentation'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
sourceCompatibility = '8'

View File

@ -1,6 +1,6 @@
group = 'io.opentelemetry.instrumentation'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
sourceCompatibility = '8'

View File

@ -1,6 +1,6 @@
group = 'io.opentelemetry.instrumentation'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
sourceCompatibility = '8'

View File

@ -2,7 +2,7 @@ ext {
skipPublish = true
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
compileOnly 'com.vaadin:vaadin-spring-boot-starter:14.2.0'

View File

@ -1,6 +1,6 @@
group = 'io.opentelemetry.javaagent'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
project.ext.minimumBranchCoverage = 0.0

View File

@ -1,4 +1,4 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
// For testing javaagent-bootstrap's Caffeine patch, we need to compile against our cache API

View File

@ -1,6 +1,6 @@
group = 'io.opentelemetry.javaagent'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
// FIXME: Improve test coverage.

View File

@ -1,11 +1,10 @@
// Project to collect and shade exporter dependencies included in the agent's full distribution.
plugins {
id "otel.java-conventions"
id "otel.shadow-conventions"
}
apply from: "$rootDir/gradle/java.gradle"
dependencies {
implementation "io.opentelemetry:opentelemetry-exporter-jaeger"
implementation "io.opentelemetry:opentelemetry-exporter-otlp"

View File

@ -1,6 +1,6 @@
group = 'io.opentelemetry.javaagent'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
// TODO this is not the desired state, only reflects current reality

View File

@ -1,6 +1,6 @@
group = 'io.opentelemetry.javaagent'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
// TODO this is not the desired state, only reflects current reality

View File

@ -11,7 +11,7 @@ description = 'OpenTelemetry Javaagent'
group = 'io.opentelemetry.javaagent'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
configurations {

View File

@ -2,7 +2,7 @@ plugins {
id "com.github.johnrengelman.shadow"
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
implementation "io.opentelemetry:opentelemetry-api"

View File

@ -2,7 +2,7 @@ plugins {
id "com.github.johnrengelman.shadow"
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
implementation "io.opentelemetry:opentelemetry-extension-annotations"

View File

@ -4,12 +4,10 @@ pluginManagement {
id 'com.github.ben-manes.versions' version '0.27.0'
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
id "me.champeau.jmh" version "0.6.4"
id "net.ltgt.errorprone" version "1.3.0"
id "net.ltgt.nullaway" version "1.1.0"
id 'org.jetbrains.kotlin.jvm' version '1.5.10'
id 'org.unbroken-dome.test-sets' version '4.0.0'
id "nebula.release" version "15.3.0"
id 'org.gradle.test-retry' version '1.2.0'
}
}

View File

@ -8,7 +8,7 @@ ext {
maxJavaVersionForTests = JavaVersion.VERSION_11
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
description = 'smoke-tests'

View File

@ -1 +1 @@
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"

View File

@ -1,7 +1,7 @@
description = 'OpenTelemetry Javaagent testing commons'
group = 'io.opentelemetry.javaagent'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
dependencies {

View File

@ -2,7 +2,7 @@ plugins {
id "otel.shadow-conventions"
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
dependencies {
compileOnly("net.bytebuddy:byte-buddy")

View File

@ -5,7 +5,7 @@ plugins {
description = 'OpenTelemetry Javaagent for testing'
group = 'io.opentelemetry.javaagent'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
jar {

View File

@ -4,7 +4,7 @@ plugins {
group = 'io.opentelemetry.javaagent'
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "otel.java-conventions"
apply from: "$rootDir/gradle/publish.gradle"
dependencies {