Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

feat: let build.jbang auto-select sources#2248

Merged
quintesse merged 1 commit intojbangdev:mainfrom
quintesse:auto_sources
Oct 10, 2025
Merged

feat: let build.jbang auto-select sources#2248
quintesse merged 1 commit intojbangdev:mainfrom
quintesse:auto_sources

Conversation

@quintesse
Copy link
Copy Markdown
Contributor

When no sources are specified, we now look for common source locations.

When no sources are specified, we now look for common source locations.
@quintesse
Copy link
Copy Markdown
Contributor Author

quintesse commented Oct 10, 2025

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 //SOURCES src/*.java in remote scripts (but of course we need to be smart about it, we don't want to create a download request for each file in a folder with hundreds of files if someone tries to do this for a large project)

@quintesse quintesse merged commit ed4d927 into jbangdev:main Oct 10, 2025
10 checks passed
@quintesse
Copy link
Copy Markdown
Contributor Author

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) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it intentionally it will add all languages in bulk and not just one?

Copy link
Copy Markdown
Contributor Author

@quintesse quintesse Oct 11, 2025

Choose a reason for hiding this comment

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

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.

@quintesse quintesse deleted the auto_sources branch October 11, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants