Skip to content

Build changes: Add an Automatic Module Name to Runtime Attach library#2503

Merged
trask merged 9 commits into
microsoft:mainfrom
KrogerWalt:main
Sep 12, 2022
Merged

Build changes: Add an Automatic Module Name to Runtime Attach library#2503
trask merged 9 commits into
microsoft:mainfrom
KrogerWalt:main

Conversation

@KrogerWalt

Copy link
Copy Markdown
Contributor

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.

#1)

Build changes needed to add an Automatic Module Name so this library can be imported into modular java projects.
@ghost

ghost commented Sep 7, 2022

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@jeanbisutti

Copy link
Copy Markdown
Contributor

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 module-info.java file opening Application Insights package, see for example this paper.

@KrogerWalt

Copy link
Copy Markdown
Contributor Author

Ok, thanks for letting me know.

@KrogerWalt KrogerWalt closed this Sep 7, 2022
@trask

trask commented Sep 7, 2022

Copy link
Copy Markdown
Member

hi @KrogerWalt! I'm re-opening this, I think adding Automatic-Module-Name to the manifest is a probably good idea.

was there a reason you needed to bump the groovy test compilation target from 1.8 to 11?

@KrogerWalt

Copy link
Copy Markdown
Contributor Author

@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.

@trask trask reopened this Sep 7, 2022
@trask

trask commented Sep 7, 2022

Copy link
Copy Markdown
Member

(oops, forgot to actually hit the re-open button 😅)

Let me do some testing and I'll let you know if those changes are even necessary.

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

@KrogerWalt

Copy link
Copy Markdown
Contributor Author

@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.
Sorry I missed that. I was playing error whack-a-mole for so long when I got something that worked I quit while I was ahead. ;-)

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!

@trask trask mentioned this pull request Sep 8, 2022
Comment thread agent/runtime-attach/build.gradle.kts Outdated
Comment thread CHANGELOG.md Outdated
@KrogerWalt

Copy link
Copy Markdown
Contributor Author

Ok @trask the Readme is updated and everything should be ready to go. Thanks again!

@trask trask left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice, thx @KrogerWalt!

@KrogerWalt

Copy link
Copy Markdown
Contributor Author

@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!

@trask trask merged commit a27bff0 into microsoft:main Sep 12, 2022
Comment thread CHANGELOG.md
heyams pushed a commit that referenced this pull request Sep 16, 2022
…#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>
heyams pushed a commit that referenced this pull request Sep 16, 2022
…#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>
heyams pushed a commit that referenced this pull request Sep 16, 2022
…#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>
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.

4 participants