jbang icon indicating copy to clipboard operation
jbang copied to clipboard

have way to not delete generated files during build fail?

Open maxandersen opened this issue 1 year ago • 5 comments

take the code from #1596 and run jbang build and have it fail and it will delete the generated files leaving you without ability to to figure out what caused the issues.

should we have an option of keeping cache around?

maxandersen avatar Mar 20 '23 06:03 maxandersen

-Djbang.build.keepclasses=true 😉

quintesse avatar Mar 20 '23 11:03 quintesse

doesn't seem to work though :/

jbang -Djbang.build.keepclasses=true --verbose --fresh --build-dir jbout src/main/java/App.java 
...
[jbang] [1:428] Copying /Users/manderse/code/quarkusio/renotes/src/main/resources/templates/main.html to jbout/classes/templates
[jbang] [1:429] Deleting folder jbout/classes
[jbang] [1:431] Deleting folder jbout/generated
...

and jbout is empty.

maxandersen avatar Aug 13 '23 08:08 maxandersen

JAVA_TOOL_OPTIONS=-Djbang.build.keepclasses=true jbang

works though...something broken/changed?

maxandersen avatar Aug 13 '23 08:08 maxandersen

It might yes. I'm not sure, but thinking about it a bit I think we used to simply just copy all -D args to System.properties, but now that builds are completely separate steps (with builds being able to trigger sub-builds etc) I most likely removed any code that would have secondary effects.

So either we change the code that checks for that flag to also look in the JBang command line, not only System.properties, or we specifically re-add code to copy the -D flags that are passed on the command line to System.properties.

quintesse avatar Aug 13 '23 22:08 quintesse

We definitely need to have -D available. And -Dquarkus.dev is honored so atm we are being inconsistent.

Best would be we used our own properties

maxandersen avatar Aug 14 '23 06:08 maxandersen