Build changes: Add an Automatic Module Name to Runtime Attach library#2503
Conversation
#1) Build changes needed to add an Automatic Module Name so this library can be imported into modular java projects.
|
Hi @KrogerWalt, Thank you for having reported this issue and many thanks for the fix proposal! We have users with Java 8 code. So, the source code has to remain on 8 version. What about a |
|
Ok, thanks for letting me know. |
|
hi @KrogerWalt! I'm re-opening this, I think adding was there a reason you needed to bump the groovy test compilation target from 1.8 to 11? |
|
@trask I was trying several different things to get rid of some errors and warnings. At one point it was warning that something was 1.8 and everything else was 11 so I changed all the 1.8s. If it will compile with the those set to 1.8 and still insert the Automatic-Module-Name I think it should work. Let me do some testing and I'll let you know if those changes are even necessary. |
|
(oops, forgot to actually hit the re-open button 😅)
great, let me know, it's been on my todo list to convert the few groovy tests we have over to Java anyways if that becomes a blocker |
|
@trask Hey, it still works when I revert that. It complains a lot, but it still builds in my app and sends data to AppInsights. I've updated the main branch so you can merge in just the manifest change and the documentation change. Thanks for helping me get this sorted out! |
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
|
Ok @trask the Readme is updated and everything should be ready to go. Thanks again! |
|
@trask pipeline failed because of a space at the end of a line in the Changelog. I ran the command it indicated to fix it. Please reapprove. Thanks! |
…#2503) * Build changes needed to add an Automatic Module Name to Runtime Attach (#1) Build changes needed to add an Automatic Module Name so this library can be imported into modular java projects. * I'll build with 17 since that's what we're using for the modular app that needs this. * going back to 8 since the groovy warnings don't matter. * changelog updates from PR review. * Update agent/runtime-attach/build.gradle.kts Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com> * changelog updates to give new name. * ran ./gradlew :spotlessApply as per pipeline failure message Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
…#2503) * Build changes needed to add an Automatic Module Name to Runtime Attach (#1) Build changes needed to add an Automatic Module Name so this library can be imported into modular java projects. * I'll build with 17 since that's what we're using for the modular app that needs this. * going back to 8 since the groovy warnings don't matter. * changelog updates from PR review. * Update agent/runtime-attach/build.gradle.kts Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com> * changelog updates to give new name. * ran ./gradlew :spotlessApply as per pipeline failure message Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
…#2503) * Build changes needed to add an Automatic Module Name to Runtime Attach (#1) Build changes needed to add an Automatic Module Name so this library can be imported into modular java projects. * I'll build with 17 since that's what we're using for the modular app that needs this. * going back to 8 since the groovy warnings don't matter. * changelog updates from PR review. * Update agent/runtime-attach/build.gradle.kts Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com> * changelog updates to give new name. * ran ./gradlew :spotlessApply as per pipeline failure message Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
This is the minimum amount of work needed so that the Runtime Attach library can be imported into modular java projects.
This should not cause any problems for anyone using Java 11 or higher, as it just inserts a line into the Jar Manifest. The build chain required Java 11, but targetCompatibility and sourceCompatibility were still set to 1.8. To get rid of multiple warnings about reflection, the targetCompatibility and sourceCompatibility had to be increased to 11. If the warnings are inconsequential, then changes to the Java Conventions file can be omitted.