MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    Unsolved 如何在载入插件之前加载第三方依赖

    开发交流
    3
    3
    402
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • freeze-dolphin
      freeze-dolphin last edited by

      打个比方,我要用 scala 开发插件
      那么运行时肯定得有 scala 运行库 —— 否则会报错

      很简单的方法就是给插件打包的时候带上 scala 运行库
      但是这样会导致 jar 体积过大(((

      我看到 mirai 主目录下有一个 libs 文件夹里面都是 mirai 的库,而且貌似可以通过 confing.json 那个配置来修改
      我在想能不能通过这个让他自动下载依赖然后就不需要打包插件的时候带上完整的运行库了

      不过自己改了发现貌似 8 太行
      1643942125405.png

      完整日志及 config.json 见 pastebin

      1 Reply Last reply Reply Quote 0
      • Topic has been marked as a question  freeze-dolphin freeze-dolphin 
      • tsudzuki
        tsudzuki 摸鱼 last edited by

        scala 开发插件还是第一次见(

        1 Reply Last reply Reply Quote 0
        • Karlatemp
          Karlatemp last edited by

          config.json直接写依赖,mcl会尝试去从 mirai-repo 获取版本信息,然而你的库在 mirai-repo 不存在,目前可用方法是直接把你的依赖直接扔进 plugins, 更好的依赖解决模式目前还未完成,见 https://github.com/mamoe/mirai/pull/1842

          Karlatemp created this issue in mamoe/mirai

          closed Redesign console plugin loading system #1842

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact