feat: let build.jbang auto-select sources#2248
Conversation
When no sources are specified, we now look for common source locations.
|
The code perhaps looks somewhat more complicated than necessary for this relatively minor feature, but that's because I've made a first setup of adding the ability to list children to ResourceRefs. For now this only works for file resources, but the idea is that we can implement this for remote resources as well (either limited to things like GitHub and GitLab where we can use their APIs or Git or perhaps by using WebDav-like techniques, we'll see) The idea is to enable the use of |
|
Merging because it's only used by a preview feature so shouldn't affect anything outside that. |
| if (resourceRef.resolve(MAIN_JAVA) != null) { | ||
| sources.add(MAIN_JAVA); | ||
| } else { | ||
| if (resourceRef.resolve("src/main/java") != null) { |
There was a problem hiding this comment.
Is it intentionally it will add all languages in bulk and not just one?
There was a problem hiding this comment.
Kotlin allows you to mix .java and .kt files, I don't know if Groovy allows the same, but I wouldn't be surprised. So I thought I'd just do it like this. It'll probably be a very uncommon situation anyway.
When no sources are specified, we now look for common source locations.