Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus JBang project type #13004

Merged
merged 1 commit into from
Nov 10, 2020
Merged

Conversation

ia3andy
Copy link
Contributor

@ia3andy ia3andy commented Oct 28, 2020

command:

final QuarkusJBangCodestartProjectInput input = QuarkusJBangCodestartProjectInput.builder()
                .putData("quarkus.version", "999-SNAPSHOT")
                .build();
        final Path projectDir = testDirPath.resolve("default");
        getCatalog().createProject(input).generate(projectDir);

output:

 tree                                                                                                                                                                                                                                                                                                               130 jbang-project-type
.
├── src/ExampleResource.java
├── README.md
├── jbang
└── jbang.cmd

running:

 ./jbang src/ExampleResource.java                                                                                                                                                                                                                                                                                                    master!+?
[jbang] Resolving dependencies...
[jbang]     Resolving io.quarkus:quarkus-resteasy:999-SNAPSHOT...Done
[jbang] Dependencies resolved
[jbang] Building jar...
[jbang] Post build with io.quarkus.launcher.JBangIntegration
oct. 28, 2020 5:05:57 PM org.jboss.threads.Version <clinit>
INFO: JBoss Threads version 3.1.1.Final
oct. 28, 2020 5:05:57 PM io.quarkus.deployment.QuarkusAugmentor run
INFO: Quarkus augmentation completed in 787ms
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2020-10-28 17:05:58,886 INFO  [io.quarkus] (main) Quarkus 999-SNAPSHOT on JVM started in 0.786s. Listening on: http://0.0.0.0:8080
2020-10-28 17:05:58,905 INFO  [io.quarkus] (main) Profile prod activated. 
2020-10-28 17:05:58,905 INFO  [io.quarkus] (main) Installed features: [cdi, resteasy]

Todo in next PRs:

@maxandersen
Copy link
Member

nice.

  1. for a "enterprise" jbang app I would still put the java file in src/ not toplevel.
  2. I gues this does NOT play well together with existing codestarts; like they can do both --maven and --gradle but for --jbang most of them couldn't be shared due to less sharable code ?
    (actually - jbang would be able to build most of our example projects assuming they have //DEPS ..

What is really missing though is jbang doesn't support BOM resolution thus no notion of platform when using jbang. thus not sure if we want to include it in codestarts just yet.

@ia3andy
Copy link
Contributor Author

ia3andy commented Oct 29, 2020

nice.

  1. for a "enterprise" jbang app I would still put the java file in src/ not toplevel.

@maxandersen TBH I really like the flat structure that jbang provides, if we start to add src.. IMHO you already removed a big part of jbang simplicity, if you want to start a bigger project, you convert it to a maven or gradle project..

plus if you put it in src, then you might want to put it in src/main/java then you already have 3 dirs for nothing.... I like flat :)

  1. I gues this does NOT play well together with existing codestarts; like they can do both --maven and --gradle but for --jbang most of them couldn't be shared due to less sharable code ?
    (actually - jbang would be able to build most of our example projects assuming they have //DEPS ..

This is a new codestart project type completely separated from the quarkus project type, thus Maven and Gradle codestarts are not used for this.

What is really missing though is jbang doesn't support BOM resolution thus no notion of platform when using jbang. thus not sure if we want to include it in codestarts just yet.

I created this PR now because it was close to be done in my local branches and we needed an example of new codestart project type for #12522

For now, I am just adding the plain extension dependency with version, but yeah this would indeed be better with bom.

I was thinking about creating a different CLI entry point quarkus create-jbang or whatever, we could display a big splash warning in the console saying it's "Experimental"

Weird, it was supposed to be a draft PR, converting now..

@ia3andy ia3andy marked this pull request as draft October 29, 2020 08:16
@ia3andy ia3andy force-pushed the jbang-project-type branch 2 times, most recently from 78cf618 to 279754e Compare October 29, 2020 09:18
@maxandersen
Copy link
Member

@maxandersen TBH I really like the flat structure that jbang provides, if we start to add src.. IMHO you already removed a big part of jbang simplicity, if you want to start a bigger project, you convert it to a maven or gradle project..

not sure if you realize it but jbang can use multiple source files now, currently //SOURCE x.java but soon //SOURCE **/*.java will be allowed too.

that plus jbang eventually will have jbang edit support which does not require creating temporary project it will rely on detecting where src is.

Having .java side-by-side with jbang/jbang.jar is not great either.

Thus I think it fits perfectly quarkus codestarts will create a slight structure that is as simple as possible, but not simpler than that.

plus if you put it in src, then you might want to put it in src/main/java then you already have 3 dirs for nothing.... I like flat :)

No, I just said src :) Which is fit.

@ia3andy ia3andy force-pushed the jbang-project-type branch 2 times, most recently from 56bcb5e to ecfaa48 Compare November 9, 2020 12:24
@ia3andy ia3andy marked this pull request as ready for review November 9, 2020 15:32
@ia3andy ia3andy force-pushed the jbang-project-type branch from ecfaa48 to da91e0f Compare November 9, 2020 15:33
@ia3andy ia3andy requested a review from maxandersen November 9, 2020 15:34
@ia3andy
Copy link
Contributor Author

ia3andy commented Nov 9, 2020

@maxandersen I changed the location to ./src as requested. I have a few change from this PR needed for #12522, I think we can merge this without plugging it in the tooling yet. I will create issues for the next tasks which would be "good first issues"

Copy link
Member

@maxandersen maxandersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't hurt ;) LGTM.

how do i actually test/try this from the cli/command line ?

@ia3andy ia3andy merged commit 49d7d55 into quarkusio:master Nov 10, 2020
@ia3andy ia3andy deleted the jbang-project-type branch November 10, 2020 09:04
@gsmet gsmet added this to the 1.10 - master milestone Nov 10, 2020
@ghost ghost added area/codestarts area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/jbang Issues related to when using jbang.dev with Quarkus area/platform Issues related to definition and interaction with Quarkus Platform labels Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codestarts area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/jbang Issues related to when using jbang.dev with Quarkus area/platform Issues related to definition and interaction with Quarkus Platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants