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

Self containing jar #62

Closed
1fexd opened this issue Feb 24, 2021 · 5 comments
Closed

Self containing jar #62

1fexd opened this issue Feb 24, 2021 · 5 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@1fexd
Copy link

1fexd commented Feb 24, 2021

Hey,

I have just migrated my page from pebble to jte and I love it. Thank you very much for this great project!

When trying to compile a self containing a jar, I tried your approach, which did not properly work for some reason, and also fcked up my project since the build/ directory got added to the srcSet. So what I did instead, is quite simple, and seems to work very well:

I used the other approach, but kept the precompiled-loading from the other approach (TemplateEngine.createPrecompiled(ContentType.Html)). I then added this snippet to my gradle jar task:

from fileTree("jte-classes") {
    include "**/*.class"
}

Which copies the compile output to the jar. (I also had to add dependsOn precompileJte at the beginning of my jar task). Just wanted to let you know, maybe it is of some use to you or fellow users of this library.

@edward3h
Copy link
Contributor

I only have a small experimental project, but the documented approach is working fine for me https://github.com/edward3h/fcgi-with-graal/blob/main/test-javalin/build.gradle

@casid
Copy link
Owner

casid commented Feb 24, 2021

@gringofe thank you, that's amazing to hear!

Thanks for sharing your setup, that indeed sounds very good.

Do you think it makes sense to add this to the documentation, as a third way to setup gradle?

@casid
Copy link
Owner

casid commented Feb 24, 2021

@edward3h awesome, thanks for sharing!

@1fexd
Copy link
Author

1fexd commented Mar 5, 2021

@gringofe thank you, that's amazing to hear!

Thanks for sharing your setup, that indeed sounds very good.

Do you think it makes sense to add this to the documentation, as a third way to setup gradle?

I think it would make sense, even if it's just a "fallback" option
btw, when using binary output mode, you also need to add include "**/*.bin"

@casid
Copy link
Owner

casid commented Mar 6, 2021

I've updated the docs: 35000c4

Thanks for sharing!

Also, nice that you're using the binary templates! :-)

Closing this, feel free to reopen if I missed something.

@casid casid closed this as completed Mar 6, 2021
@casid casid self-assigned this Mar 6, 2021
@casid casid added the documentation Improvements or additions to documentation label Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants