Skip to content

Commit

Permalink
Merge branch 'main' into inferred-spans-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKunz authored Aug 15, 2024
2 parents 577f4f2 + d39b0ed commit a874dbb
Show file tree
Hide file tree
Showing 26 changed files with 175 additions and 224 deletions.
15 changes: 0 additions & 15 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,3 @@ updates:
github-actions:
patterns:
- "*"

# Gradle
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
# upstream dependencies that need to be updated in sync and with manual control
- dependency-name: "io.opentelemetry.javaagent:*"
- dependency-name: "io.opentelemetry.instrumentation:*"
- dependency-name: "io.opentelemetry.contrib:*"
- dependency-name: "io.opentelemetry:*"
# Newer Mockito versions don't support java 8 anymore
- dependency-name: "org.mockito:mockito-core"
4 changes: 2 additions & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
username: ${{ github.actor }}
token: ${{ secrets.APM_TECH_USER_TOKEN }}
- name: Add community and triage lables
if: contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]'
if: contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]' && github.actor != 'elastic-renovate-prod[bot]'
uses: actions/github-script@v7
with:
script: |
Expand All @@ -41,7 +41,7 @@ jobs:
labels: ["community", "triage"]
})
- name: Add comment for community PR
if: contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]'
if: contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]' && github.actor != 'elastic-renovate-prod[bot]'
uses: wow-actions/auto-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion agent/entrypoint/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("java")
id("elastic-otel.java-conventions")
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion agentextension/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("java")
id("elastic-otel.java-conventions")
id("elastic-otel.sign-and-publish-conventions")
id("com.github.johnrengelman.shadow")
}
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
java
id("elastic-otel.java-conventions")
}

dependencies {
Expand Down
127 changes: 0 additions & 127 deletions build.gradle

This file was deleted.

54 changes: 54 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import java.io.FileInputStream
import java.nio.file.Paths
import java.nio.file.Files
import java.nio.file.StandardCopyOption

plugins {
alias(catalog.plugins.nexusPublish)
}

val versionProperties = java.util.Properties()
versionProperties.load(FileInputStream(file("version.properties")))

group = "co.elastic.otel"
version = versionProperties.get("version").toString()
description = "Elastic Distribution for OpenTelemetry Java"

defaultTasks("agent:assemble")

subprojects {
group = rootProject.group
version = rootProject.version
}

nexusPublishing {
repositories {
sonatype()
}
}

tasks {

register("currentVersion") {
doLast {
println(project.version)
}
}

register("setVersion") {
doLast {
val versionFile = file("version.properties")
versionFile.writeText("version=${project.property("newVersion")}\n")
}
}

register("setNextVersion") {
doLast {
val semVer = "\\d+\\.\\d+\\.\\d+".toRegex().find(version.toString())!!.value;
val nums = semVer.split('.');

val versionFile = file("version.properties")
versionFile.writeText("version=${nums[0]}.${nums[1]}.${nums[2].toInt() + 1}-SNAPSHOT\n")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.objectweb.asm.ClassWriter
import org.objectweb.asm.Opcodes

plugins {
id("java")
id("elastic-otel.java-conventions")
id("com.github.johnrengelman.shadow")
}

Expand Down
55 changes: 51 additions & 4 deletions buildSrc/src/main/kotlin/elastic-otel.java-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,59 @@
plugins {
id("java")
java
id("elastic-otel.spotless-conventions")
}

java {
withJavadocJar()
withSourcesJar()
}

repositories {
mavenLocal()
mavenCentral()
maven {
name = "mavenCentralSnapshots"
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
}

//https://github.com/gradle/gradle/issues/15383
val catalog = extensions.getByType<VersionCatalogsExtension>().named("catalog")
dependencies {

implementation(platform(catalog.findLibrary("opentelemetryInstrumentationAlphaBom").get()))

annotationProcessor(catalog.findLibrary("autoservice.processor").get())
compileOnly(catalog.findLibrary("autoservice.annotations").get())
compileOnly(catalog.findLibrary("findbugs.jsr305").get())

testAnnotationProcessor(catalog.findLibrary("autoservice.processor").get())
testCompileOnly(catalog.findLibrary("autoservice.annotations").get())
testCompileOnly(catalog.findLibrary("findbugs.jsr305").get())
testImplementation(catalog.findLibrary("assertj.core").get())
testImplementation(catalog.findLibrary("awaitility").get())
testImplementation(catalog.findLibrary("mockito").get())
testImplementation(enforcedPlatform(catalog.findLibrary("junitBom").get()))
testImplementation("org.junit.jupiter:junit-jupiter")
}

tasks {
test {
useJUnitPlatform()
}

compileJava {
options.release.set(8)
}
compileTestJava {
options.release.set(8)
}
}


interface JavaVersionTestingExtension {
/**
* By default the convention will publish the artifacts and pom as libraries.
* To override the behaviour provide the tasks producing the artifacts as this property.
* This should only be required when publishing fat-jars with custom packaging.
* This option can be set to false to disable testing with openj9 on this project
*/
val enableTestsOnOpenJ9: Property<Boolean>
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins {
id("com.diffplug.spotless")
}

spotless {
java {
target("src/**/*.java")
googleJavaFormat()

licenseHeaderFile(rootProject.file("buildscripts/spotless.license.java"), "(package|import|public)")
.named("default")

licenseHeaderFile(rootProject.file("buildscripts/spotless.reallogic.license.java"), "(package|import|public)")
.named("reallogic")
.onlyIfContentMatches("package co.elastic.otel.profiler.collections;")

}
}
7 changes: 0 additions & 7 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,19 @@ plugins {
description = "Elastic common utilities for OpenTelemetry Java"

dependencies {
annotationProcessor(libs.autoservice.processor)
api("com.blogspot.mydailyjava:weak-lock-free:0.18")
compileOnly(libs.autoservice.annotations)
compileOnly("io.opentelemetry:opentelemetry-sdk")
compileOnly(libs.findbugs.jsr305)
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi")
implementation(libs.bundles.semconv)

compileOnly(libs.contribSpanStacktrace)
testImplementation(libs.contribSpanStacktrace)

testAnnotationProcessor(libs.autoservice.processor)
testCompileOnly(libs.autoservice.annotations)
testCompileOnly(libs.findbugs.jsr305)
testImplementation("io.opentelemetry:opentelemetry-sdk")
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
testImplementation(project(":testing-common"))
testImplementation("io.opentelemetry:opentelemetry-exporter-otlp")
testImplementation("io.opentelemetry:opentelemetry-exporter-logging")
testImplementation("io.opentelemetry:opentelemetry-api-incubator")
testImplementation(libs.assertj.core)
}
7 changes: 0 additions & 7 deletions custom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ dependencies {
}
testImplementation(libs.contribSpanStacktrace)

annotationProcessor(libs.autoservice.processor)
compileOnly(libs.autoservice.annotations)

// needs to be added in order to allow access to AgentListener interface
// this is currently required because autoconfigure is currently not exposed to the extension API.
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
Expand All @@ -36,12 +33,8 @@ dependencies {
}
testImplementation(libs.bundles.semconv)

testAnnotationProcessor(libs.autoservice.processor)
testCompileOnly(libs.autoservice.annotations)

testImplementation("io.opentelemetry.javaagent:opentelemetry-testing-common")
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
testImplementation(libs.assertj.core)
testImplementation(libs.freemarker)
}
tasks.withType<Test> {
Expand Down
Loading

0 comments on commit a874dbb

Please sign in to comment.