diff --git a/benchmark-integration/benchmark-integration.gradle b/benchmark-integration/benchmark-integration.gradle index c61b87cafbc3..c486b1f8e394 100644 --- a/benchmark-integration/benchmark-integration.gradle +++ b/benchmark-integration/benchmark-integration.gradle @@ -17,4 +17,6 @@ targetCompatibility = 1.8 subprojects { sub -> sub.apply plugin: 'com.github.johnrengelman.shadow' sub.apply from: "$rootDir/gradle/java.gradle" + + javadoc.enabled = false } diff --git a/benchmark-integration/play-perftest/app/controllers/HomeController.scala b/benchmark-integration/play-perftest/app/controllers/HomeController.scala index f9038b120c5f..06a5fe8a2336 100644 --- a/benchmark-integration/play-perftest/app/controllers/HomeController.scala +++ b/benchmark-integration/play-perftest/app/controllers/HomeController.scala @@ -1,3 +1,19 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package controllers import io.opentelemetry.OpenTelemetry @@ -10,21 +26,24 @@ import play.api.mvc._ * This controller creates an `Action` to handle HTTP requests to the * application's work page which does busy wait to simulate some work */ -class HomeController @Inject()(cc: ControllerComponents) extends AbstractController(cc) { - val TRACER: Tracer = OpenTelemetry.getTracerProvider.get("io.opentelemetry.auto") +class HomeController @Inject()(cc: ControllerComponents) + extends AbstractController(cc) { + val TRACER: Tracer = + OpenTelemetry.getTracerProvider.get("io.opentelemetry.auto") /** * Create an Action to perform busy wait */ - def doGet(workTimeMS: Option[Long], error: Option[String]) = Action { implicit request: Request[AnyContent] => - error match { - case Some(x) => throw new RuntimeException("some sync error") - case None => { - var workTime = workTimeMS.getOrElse(0l) - scheduleWork(workTime) - Ok("Did " + workTime + "ms of work.") + def doGet(workTimeMS: Option[Long], error: Option[String]) = Action { + implicit request: Request[AnyContent] => + error match { + case Some(x) => throw new RuntimeException("some sync error") + case None => { + var workTime = workTimeMS.getOrElse(0L) + scheduleWork(workTime) + Ok("Did " + workTime + "ms of work.") + } } - } } diff --git a/benchmark-integration/play-perftest/app/controllers/Worker.scala b/benchmark-integration/play-perftest/app/controllers/Worker.scala index dff90716010d..e3ded6f7e2a5 100644 --- a/benchmark-integration/play-perftest/app/controllers/Worker.scala +++ b/benchmark-integration/play-perftest/app/controllers/Worker.scala @@ -1,3 +1,19 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package controllers import io.opentelemetry.OpenTelemetry @@ -5,7 +21,8 @@ import io.opentelemetry.trace.Tracer import java.util.concurrent.TimeUnit object Worker { - val TRACER: Tracer = OpenTelemetry.getTracerProvider.get("io.opentelemetry.auto") + val TRACER: Tracer = + OpenTelemetry.getTracerProvider.get("io.opentelemetry.auto") def doWork(workTimeMS: Long) = { val span = TRACER.spanBuilder("work").startSpan() @@ -16,8 +33,10 @@ object Worker { span.setAttribute("info", "interesting stuff") span.setAttribute("additionalInfo", "interesting stuff") } - val doneTimestamp = System.nanoTime + TimeUnit.MILLISECONDS.toNanos(workTimeMS) - while ( { + val doneTimestamp = System.nanoTime + TimeUnit.MILLISECONDS.toNanos( + workTimeMS + ) + while ({ System.nanoTime < doneTimestamp }) { // busy-wait to simulate work diff --git a/benchmark-integration/play-perftest/play-perftest.gradle b/benchmark-integration/play-perftest/play-perftest.gradle index 1c218c85824a..1f2a1401b0f3 100644 --- a/benchmark-integration/play-perftest/play-perftest.gradle +++ b/benchmark-integration/play-perftest/play-perftest.gradle @@ -1,27 +1,29 @@ plugins { - id 'play' - // id 'idea' + id "org.gradle.playframework" version "0.9" } -def playVersion = "2.6.20" -def scalaVersion = System.getProperty("scala.binary.version", /* default = */ "2.12") +ext { + minJavaVersionForTests = JavaVersion.VERSION_1_8 + playVersion = "2.6.20" + scalaVersion = System.getProperty("scala.binary.version", /* default = */ "2.12") +} -model { - components { - play { - platform play: playVersion, scala: scalaVersion, java: '1.8' - injectedRoutesGenerator = true - } +play { + platform { + playVersion = project.ext.playVersion + scalaVersion = project.ext.scalaVersion + javaVersion = JavaVersion.VERSION_1_8 } + injectedRoutesGenerator = true } dependencies { - play "com.typesafe.play:play-guice_$scalaVersion:$playVersion" - play "com.typesafe.play:play-logback_$scalaVersion:$playVersion" - play "com.typesafe.play:filters-helpers_$scalaVersion:$playVersion" + implementation "com.typesafe.play:play-guice_$scalaVersion:$playVersion" + implementation "com.typesafe.play:play-logback_$scalaVersion:$playVersion" + implementation "com.typesafe.play:filters-helpers_$scalaVersion:$playVersion" - play project(':auto-bootstrap') - play project(':benchmark-integration') + implementation project(':auto-bootstrap') + implementation project(':benchmark-integration') } repositories { diff --git a/build.gradle b/build.gradle index 13dd842380ef..e457ed90ea06 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id 'com.jfrog.bintray' version '1.8.5' apply false id "nebula.release" version "15.0.1" - id 'org.unbroken-dome.test-sets' version '2.2.1' + id 'org.unbroken-dome.test-sets' version '3.0.1' id 'com.github.ben-manes.versions' version '0.27.0' id 'com.dorongold.task-tree' version '1.5' diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index a1ab9081ec7a..e70b2e3007c3 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -20,7 +20,7 @@ repositories { } dependencies { - api(gradleApi()) + implementation(gradleApi()) implementation(localGroovy()) implementation("org.eclipse.aether", "aether-connector-basic", "1.1.0") diff --git a/gradle/java.gradle b/gradle/java.gradle index f20898d80528..b615ff3a7d4f 100644 --- a/gradle/java.gradle +++ b/gradle/java.gradle @@ -285,12 +285,4 @@ tasks.withType(Test).configureEach { // Disable all tests if current JVM doesn't match version requirements // Disable all tests if skipTests property was specified enabled = isJavaVersionAllowed(JavaVersion.current()) && !project.rootProject.hasProperty("skipTests") -} - -plugins.withType(BasePlugin) { - project.afterEvaluate { - def deleteTasks = tasks.withType(Delete) + project.tasks.findByPath('clean') - def otherTasks = tasks - deleteTasks - otherTasks*.mustRunAfter deleteTasks - } -} +} \ No newline at end of file diff --git a/gradle/spotless.gradle b/gradle/spotless.gradle index 84f723a52f13..f5f43a4b127d 100644 --- a/gradle/spotless.gradle +++ b/gradle/spotless.gradle @@ -12,6 +12,7 @@ spotless { scala { scalafmt() licenseHeaderFile rootProject.file('gradle/enforcement/spotless.license.java'), '(package|import|public)' + target 'src/**/*.scala' } kotlin { // ktfmt() // only supports 4 space indentation diff --git a/instrumentation/akka-http-10.0/akka-http-10.0.gradle b/instrumentation/akka-http-10.0/akka-http-10.0.gradle index 3e949be0d74c..a9c30f61a32c 100644 --- a/instrumentation/akka-http-10.0/akka-http-10.0.gradle +++ b/instrumentation/akka-http-10.0/akka-http-10.0.gradle @@ -80,13 +80,13 @@ dependencies { testImplementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0' testImplementation project(':instrumentation:annotations') - lagomTestCompile project(':instrumentation:akka-http-10.0') + lagomTestImplementation project(':instrumentation:akka-http-10.0') - lagomTestCompile group: 'com.lightbend.lagom', name: 'lagom-javadsl-testkit_2.11', version: '1.4.0' + lagomTestImplementation group: 'com.lightbend.lagom', name: 'lagom-javadsl-testkit_2.11', version: '1.4.0' // There are some internal API changes in 10.1 that we would like to test separately for - version101TestCompile group: 'com.typesafe.akka', name: 'akka-http_2.11', version: '10.1.0' - version101TestCompile group: 'com.typesafe.akka', name: 'akka-stream_2.11', version: '2.5.11' + version101TestImplementation group: 'com.typesafe.akka', name: 'akka-http_2.11', version: '10.1.0' + version101TestImplementation group: 'com.typesafe.akka', name: 'akka-stream_2.11', version: '2.5.11' latestDepTestImplementation group: 'com.typesafe.akka', name: 'akka-http_2.11', version: '+' latestDepTestImplementation group: 'com.typesafe.akka', name: 'akka-stream_2.11', version: '+' diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/aws-sdk-1.11.gradle b/instrumentation/aws-sdk/aws-sdk-1.11/aws-sdk-1.11.gradle index dc064e7a881c..b29c3bba0315 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/aws-sdk-1.11.gradle +++ b/instrumentation/aws-sdk/aws-sdk-1.11/aws-sdk-1.11.gradle @@ -33,6 +33,17 @@ testSets { } } +configurations { + test_before_1_11_106RuntimeClasspath { + resolutionStrategy.force 'com.amazonaws:aws-java-sdk-s3:1.11.0' + resolutionStrategy.force 'com.amazonaws:aws-java-sdk-rds:1.11.0' + resolutionStrategy.force 'com.amazonaws:aws-java-sdk-ec2:1.11.0' + resolutionStrategy.force 'com.amazonaws:aws-java-sdk-kinesis:1.11.0' + resolutionStrategy.force 'com.amazonaws:aws-java-sdk-sqs:1.11.0' + resolutionStrategy.force 'com.amazonaws:aws-java-sdk-dynamodb:1.11.0' + } +} + dependencies { compileOnly group: 'com.amazonaws', name: 'aws-java-sdk-core', version: '1.11.0' @@ -48,24 +59,12 @@ dependencies { // needed for kinesis: testImplementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: versions.jackson - test_before_1_11_106Compile(group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.11.0') { - force = true - } - test_before_1_11_106Compile(group: 'com.amazonaws', name: 'aws-java-sdk-rds', version: '1.11.0') { - force = true - } - test_before_1_11_106Compile(group: 'com.amazonaws', name: 'aws-java-sdk-ec2', version: '1.11.0') { - force = true - } - test_before_1_11_106Compile(group: 'com.amazonaws', name: 'aws-java-sdk-kinesis', version: '1.11.0') { - force = true - } - test_before_1_11_106Compile(group: 'com.amazonaws', name: 'aws-java-sdk-sqs', version: '1.11.0') { - force = true - } - test_before_1_11_106Compile(group: 'com.amazonaws', name: 'aws-java-sdk-dynamodb', version: '1.11.0') { - force = true - } + test_before_1_11_106Implementation(group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.11.0') + test_before_1_11_106Implementation(group: 'com.amazonaws', name: 'aws-java-sdk-rds', version: '1.11.0') + test_before_1_11_106Implementation(group: 'com.amazonaws', name: 'aws-java-sdk-ec2', version: '1.11.0') + test_before_1_11_106Implementation(group: 'com.amazonaws', name: 'aws-java-sdk-kinesis', version: '1.11.0') + test_before_1_11_106Implementation(group: 'com.amazonaws', name: 'aws-java-sdk-sqs', version: '1.11.0') + test_before_1_11_106Implementation(group: 'com.amazonaws', name: 'aws-java-sdk-dynamodb', version: '1.11.0') latestDepTestImplementation group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '+' latestDepTestImplementation group: 'com.amazonaws', name: 'aws-java-sdk-rds', version: '+' diff --git a/instrumentation/grpc-1.5/grpc-1.5.gradle b/instrumentation/grpc-1.5/grpc-1.5.gradle index 7e82fecd9c8b..8529bafeab9d 100644 --- a/instrumentation/grpc-1.5/grpc-1.5.gradle +++ b/instrumentation/grpc-1.5/grpc-1.5.gradle @@ -17,7 +17,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10' + classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12' } } diff --git a/instrumentation/java-concurrent/java-concurrent.gradle b/instrumentation/java-concurrent/java-concurrent.gradle index 46ba873d769d..dd5e32c8cf20 100644 --- a/instrumentation/java-concurrent/java-concurrent.gradle +++ b/instrumentation/java-concurrent/java-concurrent.gradle @@ -25,12 +25,12 @@ dependencies { testImplementation project(':instrumentation:annotations') - slickTestCompile project(':instrumentation:java-concurrent') - slickTestCompile project(':instrumentation:annotations') - slickTestCompile project(':instrumentation:jdbc') - slickTestCompile deps.scala - slickTestCompile group: 'com.typesafe.slick', name: 'slick_2.11', version: '3.2.0' - slickTestCompile group: 'com.h2database', name: 'h2', version: '1.4.197' + slickTestImplementation project(':instrumentation:java-concurrent') + slickTestImplementation project(':instrumentation:annotations') + slickTestImplementation project(':instrumentation:jdbc') + slickTestImplementation deps.scala + slickTestImplementation group: 'com.typesafe.slick', name: 'slick_2.11', version: '3.2.0' + slickTestImplementation group: 'com.h2database', name: 'h2', version: '1.4.197' } // Run Slick library tests along with the rest of unit tests diff --git a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0.gradle b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0.gradle index e120da7d9967..3db871dd4a64 100644 --- a/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0.gradle +++ b/instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0.gradle @@ -43,9 +43,7 @@ dependencies { // Resteasy testImplementation group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '3.0.0.Final' - resteasy31TestCompile(group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '3.1.0.Final') { - force = true - } + resteasy31TestImplementation(group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '3.1.0.Final') latestDepTestImplementation group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '+' } diff --git a/smoke-tests/play/app/controllers/HomeController.scala b/smoke-tests/play/app/controllers/HomeController.scala index d2136497114d..96aa07b554fb 100644 --- a/smoke-tests/play/app/controllers/HomeController.scala +++ b/smoke-tests/play/app/controllers/HomeController.scala @@ -1,3 +1,19 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package controllers import javax.inject.Inject @@ -8,7 +24,8 @@ import play.api.mvc._ * This controller creates an `Action` to handle HTTP requests to the * application's welcome greeting */ -class HomeController @Inject()(cc: ControllerComponents) extends AbstractController(cc) { +class HomeController @Inject()(cc: ControllerComponents) + extends AbstractController(cc) { /** * Create an Action to return a greeting diff --git a/smoke-tests/play/play.gradle b/smoke-tests/play/play.gradle index bd1493c140ea..01d0bec1597e 100644 --- a/smoke-tests/play/play.gradle +++ b/smoke-tests/play/play.gradle @@ -1,30 +1,20 @@ plugins { - id 'play' + id "org.gradle.playframework" version "0.9" } ext { minJavaVersionForTests = JavaVersion.VERSION_1_8 + playVersion = "2.6.20" + scalaVersion = System.getProperty("scala.binary.version", /* default = */ "2.12") } -def playVersion = "2.6.20" -def scalaVersion = System.getProperty("scala.binary.version", /* default = */ "2.12") - -model { - components { - play { - platform play: playVersion, scala: scalaVersion, java: '1.8' - injectedRoutesGenerator = true - } - } - distributions { - playBinary { - contents { - from("conf") { - into "conf" - } - } - } +play { + platform { + playVersion = project.ext.playVersion + scalaVersion = project.ext.scalaVersion + javaVersion = JavaVersion.VERSION_1_8 } + injectedRoutesGenerator = true } repositories { @@ -45,9 +35,9 @@ apply from: "$rootDir/gradle/java.gradle" description = 'Play Integration Tests.' dependencies { - play "com.typesafe.play:play-guice_$scalaVersion:$playVersion" - play "com.typesafe.play:play-logback_$scalaVersion:$playVersion" - play "com.typesafe.play:filters-helpers_$scalaVersion:$playVersion" + implementation "com.typesafe.play:play-guice_$scalaVersion:$playVersion" + implementation "com.typesafe.play:play-logback_$scalaVersion:$playVersion" + implementation "com.typesafe.play:filters-helpers_$scalaVersion:$playVersion" testImplementation project(':smoke-tests') } diff --git a/smoke-tests/play/src/test/groovy/io/opentelemetry/smoketest/PlaySmokeTest.groovy b/smoke-tests/play/src/test/groovy/io/opentelemetry/smoketest/PlaySmokeTest.groovy index b3ec7e950f10..4f8a4b0dfd03 100644 --- a/smoke-tests/play/src/test/groovy/io/opentelemetry/smoketest/PlaySmokeTest.groovy +++ b/smoke-tests/play/src/test/groovy/io/opentelemetry/smoketest/PlaySmokeTest.groovy @@ -24,13 +24,13 @@ class PlaySmokeTest extends AbstractServerSmokeTest { static final HTTP_REQUEST_SPAN = 'LOGGED_SPAN GET /welcome' @Shared - File playDirectory = new File("${buildDirectory}/stage/playBinary") + File playDirectory = new File("${buildDirectory}/stage/main") @Override ProcessBuilder createProcessBuilder() { String ext = System.getProperty("os.name").startsWith("Windows") ? ".bat" : "" ProcessBuilder processBuilder = - new ProcessBuilder("${playDirectory}/bin/playBinary" + ext) + new ProcessBuilder("${playDirectory}/bin/main" + ext) processBuilder.directory(playDirectory) processBuilder.environment().put("JAVA_OPTS", diff --git a/smoke-tests/smoke-tests.gradle b/smoke-tests/smoke-tests.gradle index 7fbcd49bec03..4015b887dd69 100644 --- a/smoke-tests/smoke-tests.gradle +++ b/smoke-tests/smoke-tests.gradle @@ -11,6 +11,7 @@ dependencies { } subprojects { subProject -> + subProject.tasks.withType(Javadoc).configureEach { enabled = false } subProject.tasks.withType(Test).configureEach { dependsOn = [':opentelemetry-javaagent:shadowJar', ':auto-exporters:opentelemetry-auto-exporter-logging:shadowJar']