spa77k commented on code in PR #14884:
URL: https://github.com/apache/gravitino/pull/14884#discussion_r4550109381


##########
core/build.gradle.kts:
##########
@@ -109,12 +109,24 @@ val testJar by tasks.registering(Jar::class) {
   from(sourceSets["test"].output)
 }
 
+// Modules weave MethodMonitorAspect into their own @Monitored methods from 
this jar. The shaded
+// jar cannot be used as the aspect path: relocation rewrites the constant 
pool of woven classes and
+// breaks their AspectJ attributes, which makes ajc fail.
+val aspectJar by tasks.registering(Jar::class) {
+  archiveClassifier.set("aspects")
+  from(sourceSets["main"].output) {
+    include("org/apache/gravitino/metrics/MethodMonitorAspect.class")
+  }
+}

Review Comment:
   Thanks for catching this. In 9b6ce73bb I moved the `aspectJar` 
`destinationDirectory` to `layout.buildDirectory.dir("aspects")`, as you 
suggested, and added a code comment explaining why. Running `:core:aspectJar` 
locally now puts the jar only in `core/build/aspects/`, and `core/build/libs` 
has just `gravitino-core-2.0.0-SNAPSHOT.jar` and the `-tests.jar`. I haven't 
run `compileDistribution` locally.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to