Repository navigation
feat(maven): 当前文件运行——按文件回答 main 类入口(buildProviders 1) - #31
Merged
Merged
Conversation
Refs 1lck/Lithe-IDEA#2104 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1lck
marked this pull request as ready for review
November 18, 2026 03:17
This was referenced Nov 18, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue
buildProviders1、lithe/build/runEntrypoints,已合入 d833d6a)改动
plugin.json:新增入口运行{"id": "main", "source": "provider", "entrypoints": true},requires.buildProviders升到 1。provider/.../RunEntrypoints.java(新增):回答lithe/build/runEntrypoints。只读这一个文件,不编译:pom.xml的目录(在构建根目录内);项目名取模块 POM 自己的artifactId(去掉<parent>和注释),没有时用目录名。static void main(String[] …)/String…/String x[],并且文件名对应的类、record、enum 或接口存在。src/test/)不算,因为运行用的运行时类路径不含测试类。{run: "main", name: <类名>, entrypoint: <全限定名>, project: {name, path}}。RunProvider.java:注册onRunEntrypoints;读取工作区目录的代码抽成workspace(),两个请求共用。RunPreparation.java:入口运行的prepareRun不带 target,进度和错误提示改用入口的类名。主类本来就优先取launchOptions.entrypoint。Backend.onRunEntrypoints、Protocol.BUILD_RUN_ENTRYPOINTS、按宿主提供的版本协商litheBuild),更新sdk.lock.json。scripts/compiler/backend-client.mjs像宿主一样提供litheBuild [0, 1];scripts/test.mjs新增入口查找(有 main 的类、没有 main 的类、测试源码)和不带 target 的入口运行(真实 Maven 编译后启动demo.app.Main),并检查清单声明。main一行和当前文件入口的说明。兼容性
需要支持
buildProviders1 的 Lithe 桌面端(1lck/Lithe-IDEA#2104 的宿主 PR)。旧桌面端不声明 1,不会安装这个版本,所以本插件的下一次发布要和包含该宿主改动的桌面版一起发。验证
node scripts/sdk/verify-sdk.mjsnode scripts/package.mjsnode scripts/test.mjs(JDK 21、本机 Maven):新增的 6 个入口检查全部通过。“profiles become choices of the Profiles option”在本机失败,是因为本机~/.m2/settings.xml额外定义了ali、nexus两个 profile,与本改动无关,CI 环境不受影响。TestRunOnCurrentFileStartsTheEntrypointAndSavesItsConfiguration。🤖 Generated with Claude Code