quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.82k stars 2.69k forks source link

qs build / devmode should use .jbang marker file (when present) #16087

Open maxandersen opened 3 years ago

maxandersen commented 3 years ago

Description

qs dev / build supports maven and gradle.

didnt add jbang support yet as no clean way to detect it.

now jbang has notion of default "app" which we could utilize and thus make it so if "main.java" is present assume it is a jbang project and call out to jbang build, jbang run -Dquarkus.dev, etc.

quarkus-bot[bot] commented 3 years ago

/cc @ebullient, @gsmet, @quarkusio/devtools

ebullient commented 3 years ago

Precedence order? does this only happen if/when pom.xml or gradle.build are not found?

maxandersen commented 3 years ago

Btw. Since this issue was created jbang ended up using main.java as default fallback. So if we do this it should be looking for main.java not app.java.

maxandersen commented 3 years ago

And yes suggestion is to do this if nothing else present.

ebullient commented 3 years ago

Partial support for create/build was added in #16407

  1. It detects a jbang project based on absence of pom.xml and build.gradle, and (either presence of the jbang wrapper or a java file immediately under src/) -- This is in QuarkusProjectHelper in devtools-common
  2. When build or dev are called on a jbang project, It will use src/main.java (or the first *.java file it finds in the src directory) as the target for jbang -- defined in JBangRunner in devtools/cli

As a first pass, it works, given the codestart is still producing src/GreetingResource.java, but we should clarify what we need to have happen. The following is loosely based on conversation w/ Max, the other half of which is here: https://github.com/jbangdev/jbang/issues/890

I am a big fan of a predictable marker file for jbang projects.

@maxandersen .. can you update the description of this issue w/ whatever from the above is relevant so goals of this issue are clear/accurate?