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

Remove muzzle from gradleplugins #4183

Merged
merged 9 commits into from
Sep 24, 2021

Conversation

iNikem
Copy link
Contributor

@iNikem iNikem commented Sep 21, 2021

Several changes in this PR.

First, buildSrc was renamed to conventions and included into the main build as a composite.

This allows for the second change: include gradle-plugins into conventions as a composite build. This way we can substitute maven dependencies on gradle plugins artifacts with local project dependency and always use the latest version of it.

Third, all classes that actually depend on our main project were removed from gradle-plugins module and moved to muzzle. This completely breaks the cycle between main project and plugins and allows us always use the latest version of our code without intermediate publishing. The only interface between them is now a name of the class io.opentelemetry.javaagent.tooling.muzzle.generation.MuzzleCodeGenerationPlugin

generation phase. These classes become part of the code that plugin inspects and traverses during
references collection phase.
*/
add("codegen", "io.opentelemetry.javaagent:opentelemetry-javaagent-tooling")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering: we already have this in the javaagent-instrumentation plugin, why do we need to duplicate it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, testing-common:integration-tests applies otel.javaagent-testing convention (which applies this one), but does not apply javaagent-instrumentation convention

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, which I might not :P, I think we said that we don't want this artifact on the muzzle check's transformation classpath. Is that not an issue anymore, or is that not what happens with this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This" - you mean "tooling"? io.opentelemetry.instrumentation.javaagent-instrumentation.gradle.kts always included tooling to codegen conf. Or do I miss something?

Copy link
Contributor

@anuraaga anuraaga Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok - previously for javaagent-testing.gradle.kts it was picking it up through the build.gradle dependencies but now both of them use the configuration? Cool

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I don't fully understand, is if we need muzzle-generation plugin at all in io.opentelemetry.instrumentation.javaagent-testing.gradle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least one of our test projects includes a test instrumentation so it doesn't work without the codegen.

conventions/settings.gradle.kts Show resolved Hide resolved
generation phase. These classes become part of the code that plugin inspects and traverses during
references collection phase.
*/
add("codegen", "io.opentelemetry.javaagent:opentelemetry-javaagent-tooling")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, which I might not :P, I think we said that we don't want this artifact on the muzzle check's transformation classpath. Is that not an issue anymore, or is that not what happens with this change?

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx ❤️ I will cherish the memory of the one and only time time I did the gradle-plugins publishing dance 😂

settings.gradle.kts Outdated Show resolved Hide resolved
conventions/settings.gradle.kts Show resolved Hide resolved
@iNikem iNikem merged commit f788d84 into open-telemetry:main Sep 24, 2021
@iNikem iNikem deleted the remove-muzzle-from-gradleplugins branch September 24, 2021 12:59
github-actions bot pushed a commit that referenced this pull request Sep 29, 2021
* Include gradle-plugins as a composite build

* Make gradle-plugins project independent from the main one

* Delete old ClassRef and friends

* Fixes

* Polish

* Polish

* Simplify
trask added a commit that referenced this pull request Sep 29, 2021
trask added a commit that referenced this pull request Sep 29, 2021
trask added a commit that referenced this pull request Sep 29, 2021
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.

None yet

4 participants