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

Ensure Gradle project reacts to build configuration changes. #3349

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Dec 29, 2024

@rgrunber rgrunber added this to the End January 2025 milestone Jan 6, 2025
Copy link
Contributor

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

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

  • This fixes the issue, but I noticed a small bug this introduces.

If I set the "java.configuration.updateBuildConfiguration": "interactive" (this is where the issue occurs) and make a change in the build file, this updates the build before I answer the prompt. This is described at redhat-developer/vscode-java#3893 (comment) . It existed even before.

Screencast.From.2025-01-06.12-06-16.mp4
  • I wasn't sure why you touched any logic in the automatic case because for me the issue is only reproducible when the build configuration is set to interactive. I did however notice that when going from interactive -> automatic it didn't seem to respect/update the build. Is that what you're trying to fix as well ?

@snjeza
Copy link
Contributor Author

snjeza commented Jan 6, 2025

I wasn't sure why you touched any logic in the automatic case because for me the issue is only reproducible when the build configuration is set to interactive.

The issue is reproducible when you set

auto.sync=false

to <project>/.settings/org.eclipse.buildship.core.prefs regardless of whether java.configuration.updateBuildConfiguration is interactive or automatic.

If I set the "java.configuration.updateBuildConfiguration": "interactive" (this is where the issue occurs) and make a change in the build file, this updates the build before I answer the prompt.

checking...
I can't reproduce this issue
3349

@snjeza
Copy link
Contributor Author

snjeza commented Jan 6, 2025

my vscode-java-import/app/.settings/org.eclipse.buildship.core.prefs

arguments=--init-script /home/snpe/projects/eclipse.jdt.ls/org.eclipse.jdt.ls.core/gradle/init/init.gradle --init-script /home/snpe/projects/eclipse.jdt.ls/org.eclipse.jdt.ls.core/gradle/protobuf/init.gradle
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.9))
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/usr/lib/jvm/java-17-openjdk
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true

@rgrunber
Copy link
Contributor

rgrunber commented Jan 6, 2025

Maybe I didn't describe it correctly. I think the PR fixes things, but it makes the case more clear that when you import the sample project as automatic, then change to interactive, you can change the build file, and save, but the build gets updated before responding to the interactive popup.

In my original video, I didn't show the project first loaded as automatic, and then switching to interactive.

@snjeza
Copy link
Contributor Author

snjeza commented Jan 7, 2025

Maybe I didn't describe it correctly. I think the PR fixes things, but it makes the case more clear that when you import the sample project as automatic, then change to interactive, you can change the build file, and save, but the build gets updated before responding to the interactive popup.
In my original video, I didn't show the project first loaded as automatic, and then switching to interactive.

@rgrunber I have fixed this issue. Could you, please, check it again?

Copy link
Contributor

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

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

Looks pretty good to me. Just some minor things to confirm.

@rgrunber rgrunber merged commit 86e3011 into eclipse-jdtls:master Jan 7, 2025
7 checks passed
@rgrunber rgrunber changed the title There is no way to refresh classpath after adding a library Ensure Gradle project reacts to build configuration changes. Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There is no way to refresh the classpath after adding a library to gradle
2 participants