10000 Backport "Fix main class discovery for `KotlinModule`" by lihaoyi · Pull Request #4803 · com-lihaoyi/mill · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Backport "Fix main class discovery for KotlinModule" #4803

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

Merged
merged 3 commits into from
Mar 30, 2025

Conversation

lihaoyi
Copy link
Member
@lihaoyi lihaoyi commented Mar 28, 2025

Backports #4797

Fixes #4772

Previously it inherited the Zinc-based main class discovery via JavaModule, which overrode the generic classpath-scanning approach from RunModule. This PR adjusts the overrides such the KotlinModule uses the disk-based discovery API.

Removed all the now-unnecessary def mainClass annotations in the kotlinlib example tests, except for the one in example/kotlinlib/module/1-common-config that is useful for educational purposes.

@lefou lefou added this to the 0.12.10 milestone Mar 28, 2025
Copy link
Member
@lefou lefou left a comment

Choose a reason for hiding this comment

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

Do we really need to backport the allLocalMainClasses0 task?

@lihaoyi
Copy link
Member Author
lihaoyi commented Mar 28, 2025

We don't need to, the alternative would be to copy-paste the allLocalMainClasses implementation from RunModule into KotlinModule, which seemed like a messier way of doing things than extracting the allLocalMainClasses0 helper

@lefou
Copy link
Member
lefou commented Mar 28, 2025

We could, as you already suggested, just always use the classpath-based main class finder. I think it doesn't add much to the runtime.

@lihaoyi
Copy link
Member Author
lihaoyi commented Mar 28, 2025

Yeah I think that's probably the next step. But this is the just backport of the previous PR, so didn't want to get too creative here

@lefou
Copy link
Member
lefou commented Mar 28, 2025

I wanted to avoid the introduction of deprecated API. But if we do the next step before the release, it's fine too.

@lihaoyi lihaoyi force-pushed the backport-kotlin-main branch from d5facc7 to 837a078 Compare March 28, 2025 17:13
@lihaoyi lihaoyi merged commit d93af5c into com-lihaoyi:0.12.x Mar 30, 2025
31 of 33 checks passed
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
0