-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Extract agent shadow configuration to conventions script. #3256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ca6b450
Extract agent shadow configuration to conventions script.
b094f7e
Remove redundant plugin version declaration
410a4d3
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
4847c51
Resource loader doesn't load from buildSrc
c3982a9
Comments about byte buddy version
0c5c4f9
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
eeccd56
Merge remote-tracking branch 'upstream/main' into shadow-conventions
trask b50a62c
Fix ReferenceCollectorTest
trask File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| plugins { | ||
| `java-gradle-plugin` | ||
| `kotlin-dsl` | ||
| id("com.diffplug.spotless") version "5.12.4" | ||
| } | ||
|
|
||
| spotless { | ||
| java { | ||
| googleJavaFormat("1.10.0") | ||
| licenseHeaderFile(rootProject.file("../gradle/enforcement/spotless.license.java"), "(package|import|public)") | ||
| target("src/**/*.java") | ||
| } | ||
| } | ||
|
|
||
| gradlePlugin { | ||
| plugins { | ||
| create("muzzle-plugin") { | ||
| id = "muzzle" | ||
| implementationClass = "io.opentelemetry.instrumentation.gradle.muzzle.MuzzlePlugin" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| gradlePluginPortal() | ||
| mavenLocal() | ||
| } | ||
|
|
||
| tasks.withType<Test>().configureEach { | ||
| useJUnitPlatform() | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(gradleApi()) | ||
| implementation(localGroovy()) | ||
|
|
||
| implementation("org.eclipse.aether:aether-connector-basic:1.1.0") | ||
| implementation("org.eclipse.aether:aether-transport-http:1.1.0") | ||
| implementation("org.apache.maven:maven-aether-provider:3.3.9") | ||
|
|
||
| implementation("com.google.guava:guava:30.1-jre") | ||
| implementation("gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0") | ||
| implementation("org.ow2.asm:asm:7.0-beta") | ||
| implementation("org.ow2.asm:asm-tree:7.0-beta") | ||
| implementation("org.apache.httpcomponents:httpclient:4.5.10") | ||
| // When updating, also update dependencyManagement/dependencyManagement.gradle.kts | ||
| implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.11.2") | ||
|
|
||
| testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1") | ||
| testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.1") | ||
| testImplementation("org.assertj:assertj-core:3.19.0") | ||
| } | ||
33 changes: 33 additions & 0 deletions
33
buildSrc/src/main/kotlin/otel.shadow-conventions.gradle.kts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar | ||
|
|
||
| plugins { | ||
| id("com.github.johnrengelman.shadow") | ||
| } | ||
|
|
||
| tasks.withType<ShadowJar>().configureEach { | ||
| mergeServiceFiles() | ||
|
|
||
| exclude("**/module-info.class") | ||
|
|
||
| // Prevents conflict with other SLF4J instances. Important for premain. | ||
| relocate("org.slf4j", "io.opentelemetry.javaagent.slf4j") | ||
| // rewrite dependencies calling Logger.getLogger | ||
| relocate("java.util.logging.Logger", "io.opentelemetry.javaagent.bootstrap.PatchLogger") | ||
|
|
||
| // prevents conflict with library instrumentation | ||
| relocate("io.opentelemetry.instrumentation", "io.opentelemetry.javaagent.shaded.instrumentation") | ||
|
|
||
| // relocate(OpenTelemetry API) | ||
| relocate("io.opentelemetry.api", "io.opentelemetry.javaagent.shaded.io.opentelemetry.api") | ||
| relocate("io.opentelemetry.semconv", "io.opentelemetry.javaagent.shaded.io.opentelemetry.semconv") | ||
| relocate("io.opentelemetry.context", "io.opentelemetry.javaagent.shaded.io.opentelemetry.context") | ||
|
|
||
| // relocate(the OpenTelemetry extensions that are used by instrumentation modules) | ||
| // these extensions live in the AgentClassLoader, and are injected into the user"s class loader | ||
| // by the instrumentation modules that use them | ||
| relocate("io.opentelemetry.extension.aws", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.aws") | ||
| relocate("io.opentelemetry.extension.kotlin", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.kotlin") | ||
|
|
||
| // this is for instrumentation on opentelemetry-api itself | ||
| relocate("application.io.opentelemetry", "io.opentelemetry") | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @iNikem I bundled in an update to the byte buddy gradle plugin into this PR (it didn't fix the problem I was seeing but was my first try :P)