build.gradle.kts 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("org.grails")
  7. module.set("grails-web-url-mappings")
  8. versions.set("[3.0,)")
  9. // version 3.1.15 depends on org.grails:grails-datastore-core:5.0.13.BUILD-SNAPSHOT
  10. // which (obviously) does not exist
  11. // version 3.3.6 depends on org.grails:grails-datastore-core:6.1.10.BUILD-SNAPSHOT
  12. // which (also obviously) does not exist
  13. skip("3.1.15", "3.3.6")
  14. // these versions pass if you add the grails maven repository (https://repo.grails.org/artifactory/core)
  15. skip("3.2.0", "3.3.0", "3.3.1", "3.3.2", "3.3.3", "3.3.10", "3.3.13", "3.3.14", "3.3.15", "3.3.16", "3.3.17", "3.3.18", "4.0.0", "4.0.1", "4.0.5", "4.0.6", "4.0.7", "4.0.8", "4.0.9", "4.0.10", "4.0.11", "4.0.12", "4.0.13")
  16. assertInverse.set(true)
  17. }
  18. }
  19. otelJava {
  20. maxJavaVersionSupported.set(JavaVersion.VERSION_17)
  21. }
  22. val grailsVersion = "3.0.6" // first version that the tests pass on
  23. val springBootVersion = "1.2.5.RELEASE"
  24. dependencies {
  25. bootstrap(project(":instrumentation:servlet:servlet-common:bootstrap"))
  26. library("org.grails:grails-plugin-url-mappings:$grailsVersion")
  27. testInstrumentation(project(":instrumentation:servlet:servlet-3.0:javaagent"))
  28. testInstrumentation(project(":instrumentation:servlet:servlet-javax-common:javaagent"))
  29. testInstrumentation(project(":instrumentation:tomcat:tomcat-7.0:javaagent"))
  30. testInstrumentation(project(":instrumentation:spring:spring-webmvc:spring-webmvc-3.1:javaagent"))
  31. testLibrary("org.springframework.boot:spring-boot-autoconfigure:$springBootVersion")
  32. testLibrary("org.springframework.boot:spring-boot-starter-tomcat:$springBootVersion")
  33. latestDepTestLibrary("org.springframework.boot:spring-boot-autoconfigure:2.+")
  34. latestDepTestLibrary("org.springframework.boot:spring-boot-starter-tomcat:2.+")
  35. }
  36. // testing-common pulls in groovy 4 and spock as dependencies, exclude them
  37. configurations.configureEach {
  38. exclude("org.apache.groovy", "groovy")
  39. exclude("org.apache.groovy", "groovy-json")
  40. exclude("org.spockframework", "spock-core")
  41. }
  42. val latestDepTest = findProperty("testLatestDeps") as Boolean
  43. if (!latestDepTest) {
  44. configurations.configureEach {
  45. if (!name.contains("muzzle")) {
  46. resolutionStrategy {
  47. eachDependency {
  48. if (requested.group == "org.codehaus.groovy") {
  49. useVersion("3.0.9")
  50. }
  51. }
  52. }
  53. }
  54. }
  55. }
  56. configurations.testRuntimeClasspath {
  57. resolutionStrategy {
  58. // requires old logback (and therefore also old slf4j)
  59. force("ch.qos.logback:logback-classic:1.2.11")
  60. force("org.slf4j:slf4j-api:1.7.36")
  61. }
  62. }
  63. tasks {
  64. withType<Test>().configureEach {
  65. systemProperty("testLatestDeps", latestDepTest)
  66. // required on jdk17
  67. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  68. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  69. jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
  70. }
  71. }