bad handling of //DEPS with no .jar prefix
chatgpt generated this:
//DEPS org.openjfx:javafx-controls:21.0.5:mac,linux,win
which breaks jbang:
[jbang] [0:315] Resolved resource ref as: tetris.java (/Users/manderse/code/jbangdev/jbang/tetris.java)
[jbang] [0:344] [ERROR] Cannot invoke "dev.jbang.resources.ResourceRef.getFile()" because "resourceRef" is null
java.lang.NullPointerException: Cannot invoke "dev.jbang.resources.ResourceRef.getFile()" because "resourceRef" is null
at dev.jbang.source.ProjectBuilder.build(ProjectBuilder.java:308)
at dev.jbang.source.ProjectBuilder.updateProject(ProjectBuilder.java:684)
at dev.jbang.source.ProjectBuilder.updateProjectMain(ProjectBuilder.java:633)
at dev.jbang.source.ProjectBuilder.createSourceProject(ProjectBuilder.java:403)
at dev.jbang.source.ProjectBuilder.build(ProjectBuilder.java:314)
at dev.jbang.source.ProjectBuilder.build(ProjectBuilder.java:263)
at dev.jbang.cli.Run.doCall(Run.java:72)
at dev.jbang.cli.BaseCommand.call(BaseCommand.java:149)
at dev.jbang.cli.BaseCommand.call(BaseCommand.java:24)
at picocli.CommandLine.executeUserObject(CommandLine.java:2031)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2469)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2461)
at dev.jbang.cli.JBang$3.handle(JBang.java:159)
at dev.jbang.cli.JBang$3.handle(JBang.java:154)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2425)
at picocli.CommandLine.execute(CommandLine.java:2174)
at dev.jbang.Main.main(Main.java:28)
we should not fail that hard :)
See! AI is already breaking everything!
Chaosmonkeys are indeed useful use of ai :)
tried fixing this but not sure how to apply the unresolvable resource notion to the source deps...because it doesn't seem to fit. throwing and error makes jbang info fail which isn't what we want either. @quintesse wdyt?
I haven't looked at it, but perhaps this doesn't have to do with resources, I might have to do with the GAV matcher not treating org.openjfx:javafx-controls:21.0.5:mac,linux,win as a valid GAV and then assuming it must be something else.