Skip to content
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

Make muzzle task depend on instrumentation project runtimeclasspath #1408

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

pavolloffay
Copy link
Member

Signed-off-by: Pavol Loffay p.loffay@gmail.com

This is related to #1225. See the hacks what I did in regards to runtime classpath of the plugin. Maybe the plugin could expose a setting to configure javaagent-tooling and javaagent-bootstrap classpath (a similar what bytebuddy plugin does

classPath = project(':javaagent-tooling').configurations.instrumentationMuzzle + configurations.runtimeClasspath + sourceSets.main.output
)

I am using muzzle plugin in my custom OTEL agent build. There are a couple of hacks that I had to make:

  • copy buildSrc to my project (obvious and ugly!)
  • define javaagent-tooling and javaagent-bootstrap subprojects that pull in appropriate OTEL artifacts
  • move my instrumentation classes to io.opentelemetry.instrumentation. Make muzzle reference creation package(s) configurable #1395
  • set correctly classpath in bytebuddy plugin (instrumentationMuzzle)

With all this I was able to run muzzle task and properly generate instrumentationMuzzle. However the build was passing only after ./gradlew assemble. Running ./gradlew clean muzzle was always failing. The following fixed the build on a clean project.

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
@iNikem
Copy link
Contributor

iNikem commented Oct 19, 2020

Maybe the plugin could expose a setting to configure javaagent-tooling and javaagent-bootstrap classpath

This is the great idea! If we set required classpaths externally, then we can easily do #1225

@iNikem iNikem merged commit 137df96 into open-telemetry:master Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants