|
1 | 1 | import org.hypertrace.gradle.publishing.License.APACHE_2_0; |
2 | 2 |
|
3 | 3 | plugins { |
4 | | - `java-library` |
5 | | - id("com.diffplug.spotless") version "5.2.0" apply false |
6 | | - id("org.hypertrace.publish-maven-central-plugin") version "1.0.4" apply false |
7 | | - id("org.hypertrace.ci-utils-plugin") version "0.3.0" |
8 | | - id("org.gradle.test-retry") version "1.2.0" apply false |
9 | | - id("org.owasp.dependencycheck") version "7.1.1" |
| 4 | + id("com.diffplug.spotless") version "5.2.0" apply false |
| 5 | + id("org.hypertrace.publish-maven-central-plugin") version "1.0.6" |
| 6 | + id("org.hypertrace.ci-utils-plugin") version "0.3.0" |
| 7 | + id("org.gradle.test-retry") version "1.2.0" apply false |
| 8 | + id("org.owasp.dependencycheck") version "7.1.1" |
10 | 9 | } |
11 | 10 |
|
12 | | -buildscript { |
13 | | - repositories { |
14 | | - mavenCentral() |
15 | | - } |
16 | | -} |
17 | | - |
18 | | -allprojects { |
19 | | - apply(plugin="java-library") |
20 | | - java { |
21 | | - sourceCompatibility = JavaVersion.VERSION_1_8 |
22 | | - targetCompatibility = JavaVersion.VERSION_1_8 |
| 11 | +subprojects { |
| 12 | + group = "org.hypertrace.agent" |
| 13 | + description = "Hypertrace OpenTelemetry Javaagent" |
| 14 | + |
| 15 | + apply(plugin = "java-library") |
| 16 | + apply(plugin = "com.diffplug.spotless") |
| 17 | + apply(from = "$rootDir/gradle/spotless.gradle") |
| 18 | + pluginManager.withPlugin("java-library") { |
| 19 | + configure<JavaPluginExtension> { |
| 20 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 21 | + targetCompatibility = JavaVersion.VERSION_1_8 |
23 | 22 | } |
24 | 23 |
|
25 | 24 | repositories { |
26 | | - mavenCentral() |
| 25 | + mavenCentral() |
| 26 | + maven { |
| 27 | + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") |
| 28 | + } |
27 | 29 | } |
28 | 30 |
|
29 | | - tasks.compileJava { |
30 | | - options.compilerArgs.add("-Werror") |
| 31 | + tasks.named<JavaCompile>("compileJava") { |
| 32 | + options.compilerArgs.add("-Werror") |
31 | 33 | } |
32 | 34 |
|
33 | | - |
34 | 35 | tasks.withType<JavaCompile> { |
35 | | - options.compilerArgs.add("-Xlint:unchecked") |
36 | | - options.isDeprecation = true |
37 | | - options.release.set(8) |
| 36 | + options.compilerArgs.add("-Xlint:unchecked") |
| 37 | + options.isDeprecation = true |
| 38 | + options.release.set(8) |
38 | 39 | } |
39 | | -} |
40 | | - |
41 | | -val testDependencies by configurations.creating { |
42 | | - extendsFrom(configurations.testImplementation.get()) |
43 | | - extendsFrom(configurations.testRuntimeOnly.get()) |
44 | | -} |
45 | | - |
46 | | -subprojects { |
47 | | - group = "org.hypertrace.agent" |
48 | | - description = "Hypertrace OpenTelemetry Javaagent" |
49 | 40 |
|
50 | | - extra.set("versions", mapOf( |
51 | | - // when updating these values, some values must also be updated in buildSrc as this map |
52 | | - // cannot be accessed there |
53 | | - "opentelemetry" to "1.24.0", |
54 | | - "opentelemetry_semconv" to "1.24.0-alpha", |
55 | | - "opentelemetry_proto" to "0.11.0-alpha", |
56 | | - "opentelemetry_java_agent" to "1.24.0-alpha", |
57 | | - "opentelemetry_java_agent_all" to "1.24.0", |
58 | | - "opentelemetry_java_agent-tooling" to "1.24.0-alpha", |
59 | | - |
60 | | - "opentelemetry_gradle_plugin" to "1.24.0-alpha", |
61 | | - "byte_buddy" to "1.12.10", |
62 | | - "slf4j" to "2.0.7" |
63 | | - )) |
64 | | - |
65 | | - apply<JavaPlugin>() |
66 | | - apply(plugin = "com.diffplug.spotless") |
67 | | - apply(from = "$rootDir/gradle/spotless.gradle") |
68 | | - |
69 | | - repositories { |
70 | | - mavenCentral() |
71 | | - jcenter() |
72 | | - maven { |
73 | | - url = uri("https://oss.sonatype.org/content/repositories/snapshots/") |
74 | | - } |
| 41 | + dependencies { |
| 42 | + add(JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME, "org.junit.jupiter:junit-jupiter-api:5.7.0") |
| 43 | + add(JavaPlugin.TEST_RUNTIME_ONLY_CONFIGURATION_NAME, "org.junit.jupiter:junit-jupiter-engine:5.7.0") |
| 44 | + add(JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME, "org.junit-pioneer:junit-pioneer:1.0.0") |
75 | 45 | } |
76 | 46 |
|
77 | | - pluginManager.withPlugin("org.hypertrace.publish-maven-central-plugin") { |
78 | | - configure<org.hypertrace.gradle.publishing.HypertracePublishMavenCentralExtension> { |
79 | | - repoName.set("javaagent") |
80 | | - license.set(APACHE_2_0) |
81 | | - } |
| 47 | + tasks.named<Test>("test") { |
| 48 | + useJUnitPlatform() |
| 49 | + reports { |
| 50 | + junitXml.isOutputPerTestCase = true |
| 51 | + } |
82 | 52 | } |
83 | 53 |
|
84 | | - dependencies { |
85 | | - testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0") |
86 | | - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0") |
87 | | - testImplementation("org.junit-pioneer:junit-pioneer:1.0.0") |
88 | | - } |
| 54 | + extra.set("versions", mapOf( |
| 55 | + // when updating these values, some values must also be updated in buildSrc as this map |
| 56 | + // cannot be accessed there |
| 57 | + "opentelemetry" to "1.24.0", |
| 58 | + "opentelemetry_semconv" to "1.24.0-alpha", |
| 59 | + "opentelemetry_proto" to "0.11.0-alpha", |
| 60 | + "opentelemetry_java_agent" to "1.24.0-alpha", |
| 61 | + "opentelemetry_java_agent_all" to "1.24.0", |
| 62 | + "opentelemetry_java_agent-tooling" to "1.24.0-alpha", |
| 63 | + |
| 64 | + "opentelemetry_gradle_plugin" to "1.24.0-alpha", |
| 65 | + "byte_buddy" to "1.12.10", |
| 66 | + "slf4j" to "2.0.7" |
| 67 | + )) |
| 68 | + } |
89 | 69 |
|
90 | | - tasks { |
91 | | - test { |
92 | | - useJUnitPlatform() |
93 | | - reports { |
94 | | - junitXml.isOutputPerTestCase = true |
95 | | - } |
96 | | - } |
| 70 | + pluginManager.withPlugin("org.hypertrace.publish-maven-central-plugin") { |
| 71 | + configure<org.hypertrace.gradle.publishing.HypertracePublishMavenCentralExtension> { |
| 72 | + repoName.set("javaagent") |
| 73 | + license.set(APACHE_2_0) |
97 | 74 | } |
| 75 | + } |
98 | 76 | } |
99 | 77 |
|
100 | 78 | dependencyCheck { |
101 | | - format = org.owasp.dependencycheck.reporting.ReportGenerator.Format.valueOf("ALL") |
| 79 | + format = org.owasp.dependencycheck.reporting.ReportGenerator.Format.valueOf("ALL") |
102 | 80 | // suppressionFile = "owasp-suppressions.xml" |
103 | | - scanConfigurations.add("runtimeClasspath") |
104 | | - failBuildOnCVSS = 7.0F |
| 81 | + scanConfigurations.add("runtimeClasspath") |
| 82 | + failBuildOnCVSS = 7.0F |
105 | 83 | } |
0 commit comments