Gradle + Java: Multiple executable within a single project

Need help with C, C++, perl, python, etc?

Gradle + Java: Multiple executable within a single project

Postby larienna » 2019-06-30 00:54

I know it is possible to have multiple projects within a single or distributed build.gradle file.

What I want to know is if it's possible to generate multiple executable jar with a single gradle project?

To put you in context, I am working on some sort of library/framework and I want to supply some samples/examples with the library to show how it is used.

I could probably place each example in a gradle project of it's own. But I fear that once I'll have over 20 example projects, it might be a pain to load into netbeans. I just have 3 projects and it takes easily 30-60 seconds to load.

So I thought I could make 1 project with multiple classes that each has a main() and generate a separate jar for each class. But I am not sure if such thing is actually possible with Gradle. The only thing I could find online is the multiple projects technique.

Else if I go with the 1 project per example route, is there a way to speed up the building process. Maybe by pre-generating stuff, or by preventing it from loading all the samples at start up, etc.
Posts: 62
Joined: 2014-09-27 20:54

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest