quarkiverse / quarkus-bon-jova-rockstar

An implementation of Rockstar as a JVM language
https://codewithrockstar.com/
3 stars 2 forks source link

Extension throws error on launch if `src/main/rockstar` is missing #134

Closed holly-cummins closed 7 months ago

holly-cummins commented 7 months ago

If I create an app with quarkus create and then add the extension, the first launch fails with

Caused by: java.lang.RuntimeException: java.nio.file.NoSuchFileException: src/main/rockstar at io.quarkiverse.bonjova.deployment.BonJovaQuarkusExtensionProcessor.generateRockFiles(BonJovaQuarkusExtensionProcessor.java:148) at io.quarkiverse.bonjova.deployment.BonJovaQuarkusExtensionProcessor.pages(BonJovaQuarkusExtensionProcessor.java:120) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)

We should either tolerate the directory being missing, or create it.

holly-cummins commented 7 months ago

I implemented a quick fix where I put a check, but then I realised that the rock score calculator and rock file compiler are using different mechanisms to find the rock files; one the source paths reads from the pom, and the other hardcodes it. It means you can see an endpoint in the dev ui, and then get an error when you click on it.

Reading from the pom is 'correct' but adds an extra step to the demo, to specify the source paths.

I realised I could solve both the inconsistency and the extra step, while still honouring the pom, by using both a default and what was in the pom. That seems friendliest, so I've done that.