jbang icon indicating copy to clipboard operation
jbang copied to clipboard

Live Edit does not sync gradle dependencies when adding/removing // DEPS

Open mikomatic opened this issue 3 years ago • 0 comments

Describe the bug

As the title indicates, live editing a generated jbang script does not seem to sync dependencies declared in the script *.java and dependencies declared in the generated build.gradle.

To Reproduce Steps to reproduce the behavior:

  1. Run jbang init test.java
  2. Run jbang edit --live test.java
  3. Add a dependency in the file, after the jbang comment (e.g. //DEPS org.apache.commons:commons-lang3:3.12.0 )

While the console does show a [jbang] Regenerating project. the dependencies in the temp project are not updated in the generated build.gradle

To pickup the new dependencies, one needs to add the dependencies manually in the build.gradle, or re-run the command jbang edit

Expected behavior

The generated build.gradle should be automatically updated as when running the jbang edit command for the first time

JBang version

[jbang] jbang version 0.97.0
Cache: /home/dev/.jbang/cache
Config: /home/dev/.jbang
Repository:/home/dev/.m2/repository
0.97.0

Additional context

The bug seems to affect linux (ubuntu) & windows, both on JDK 17

➜ java -version                                                                             
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing)

P.S. amazing project by the way ❤️

mikomatic avatar Aug 21 '22 09:08 mikomatic