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

Replace dependency(java.nio.file) of JDK8 with safs(Compatibility implementation) #2839

Closed
wants to merge 4 commits into from

Conversation

zhaodice
Copy link
Contributor

@zhaodice zhaodice commented Feb 18, 2024

这个JDK8的专有API依赖会导致console只能跑在JDK8上,但mirai core的安卓MIN SDK是24(有JDK 7 ),这并不合理。
试了很多次,补java.nio.file什么的,这个java.nio.file包名还是太恶心了,没法直接搞,只能把所有的java.nio.file改成替代品了。

java.nio.file的替代品作者:https://github.com/henrik-lindqvist/safs/

(有一说一,绑死JDK平台版本,并不是很符合kotlin的哲学?)

@zhaodice zhaodice changed the title Replace dependency of JDK8 (java.nio.file) Replace dependency(java.nio.file) of JDK8 with safs(Compatibility implementation) Feb 18, 2024
@zhaodice zhaodice marked this pull request as draft February 18, 2024 18:10
@zhaodice
Copy link
Contributor Author

单纯编译没什么问题,但是测试单元还没替换完,总之就是
把所有的 java.nio.file替换成com.llamalab.safs
把所有的kotlin.io.path替换成com.llamalab.safs.kotlin.io.path
这个方案我先自己用一段时间吧,先把想法放在这里(

@Him188
Copy link
Member

Him188 commented Feb 22, 2024

Kotlin 从 1.8 (或者某个更早的版本) 开始实际上就已经不支持 JDK 6 和 7 了, 其默认编译目标是 8. 过了这么多年, 安卓应该大家都到了能使用 Java 8 的版本. 或许我们应该把 mirai 的 Android target 改成 26

@zhaodice
Copy link
Contributor Author

Kotlin 从 1.8 (或者某个更早的版本) 开始实际上就已经不支持 JDK 6 和 7 了, 其默认编译目标是 8. 过了这么多年, 安卓应该大家都到了能使用 Java 8 的版本. 或许我们应该把 mirai 的 Android target 改成 26

嗯,那也确实可以不用支持了

@zhaodice zhaodice closed this Feb 22, 2024
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