Skip to content
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

auto scan all under the command package's command class #1492

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kaixinbaba
Copy link

@kaixinbaba kaixinbaba commented Sep 11, 2020

初始化命令对象的时候 不再需要硬编码 只需要保证在command包下并且继承AnnotatedCommand就会自动添加,并且会排除已经标记@Deprecated的class
无论是main方法测试
还是打包成脚本测试都通过

如果有哪里不满意的请跟我说下~
我自己发现了一个问题就是 自动扫描的 命令顺序不可控 和 原来硬编码的不相同(如果有需要的话可以改成按照首字母排序,或者自定义的权重 或者 把命令归类 然后 每一个分类中 按字母排序)

@kaixinbaba
Copy link
Author

我整理了下代码,把扫描包下class的逻辑移动到了utils中

@hengyunabc
Copy link
Collaborator

  • 这个并非不知道可以扫描加载,现在的手动模式也挺好的
  • 排列顺序也是重要原因

@kaixinbaba
Copy link
Author

  • 这个并非不知道可以扫描加载,现在的手动模式也挺好的
  • 排列顺序也是重要原因

所以是让我关闭这个 PR吗?还是让我改进下 支持排序(分类后排序)?

@hengyunabc
Copy link
Collaborator

  • 这个并非不知道可以扫描加载,现在的手动模式也挺好的
  • 排列顺序也是重要原因

所以是让我关闭这个 PR吗?还是让我改进下 支持排序(分类后排序)?

可以保持打开,后面有需要再看。

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants