|
1 | 1 | plugins {
|
2 |
| - id("java") |
| 2 | + java |
| 3 | + id("elastic-otel.spotless-conventions") |
3 | 4 | }
|
4 | 5 |
|
| 6 | +java { |
| 7 | + withJavadocJar() |
| 8 | + withSourcesJar() |
| 9 | +} |
| 10 | + |
| 11 | +repositories { |
| 12 | + mavenLocal() |
| 13 | + mavenCentral() |
| 14 | + maven { |
| 15 | + name = "mavenCentralSnapshots" |
| 16 | + url = uri("https://oss.sonatype.org/content/repositories/snapshots") |
| 17 | + } |
| 18 | +} |
| 19 | + |
| 20 | +//https://github.com/gradle/gradle/issues/15383 |
| 21 | +val catalog = extensions.getByType<VersionCatalogsExtension>().named("catalog") |
| 22 | +dependencies { |
| 23 | + |
| 24 | + implementation(platform(catalog.findLibrary("opentelemetryInstrumentationAlphaBom").get())) |
| 25 | + |
| 26 | + annotationProcessor(catalog.findLibrary("autoservice.processor").get()) |
| 27 | + compileOnly(catalog.findLibrary("autoservice.annotations").get()) |
| 28 | + compileOnly(catalog.findLibrary("findbugs.jsr305").get()) |
| 29 | + |
| 30 | + testAnnotationProcessor(catalog.findLibrary("autoservice.processor").get()) |
| 31 | + testCompileOnly(catalog.findLibrary("autoservice.annotations").get()) |
| 32 | + testCompileOnly(catalog.findLibrary("findbugs.jsr305").get()) |
| 33 | + testImplementation(catalog.findLibrary("assertj.core").get()) |
| 34 | + testImplementation(catalog.findLibrary("awaitility").get()) |
| 35 | + testImplementation(catalog.findLibrary("mockito").get()) |
| 36 | + testImplementation(enforcedPlatform(catalog.findLibrary("junitBom").get())) |
| 37 | + testImplementation("org.junit.jupiter:junit-jupiter") |
| 38 | +} |
| 39 | + |
| 40 | +tasks { |
| 41 | + test { |
| 42 | + useJUnitPlatform() |
| 43 | + } |
| 44 | + |
| 45 | + compileJava { |
| 46 | + options.release.set(8) |
| 47 | + } |
| 48 | + compileTestJava { |
| 49 | + options.release.set(8) |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | + |
5 | 54 | interface JavaVersionTestingExtension {
|
6 | 55 | /**
|
7 |
| - * By default the convention will publish the artifacts and pom as libraries. |
8 |
| - * To override the behaviour provide the tasks producing the artifacts as this property. |
9 |
| - * This should only be required when publishing fat-jars with custom packaging. |
| 56 | + * This option can be set to false to disable testing with openj9 on this project |
10 | 57 | */
|
11 | 58 | val enableTestsOnOpenJ9: Property<Boolean>
|
12 | 59 | }
|
|
0 commit comments