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

支持dub包管理 #581

Closed
Domain opened this issue Sep 30, 2019 · 2 comments
Closed

支持dub包管理 #581

Domain opened this issue Sep 30, 2019 · 2 comments

Comments

@Domain
Copy link
Contributor

Domain commented Sep 30, 2019

既然xmake支持d语言,那么应该考虑支持d语言的官方包管理工具dub。或者有没有详细的说明,我可以尝试一下

@waruqi
Copy link
Member

waruqi commented Sep 30, 2019

目前其他语言的支持力度还很弱,主要用于支持跟c/c++的混合编译,对于其他语言的包管理支持,暂时不是重点,因为实在是精力时间有限,目前没太多时间去分心做这些,只能先暂时把c/c++先完善好再说,等后面有时间了,才会考虑支持这些。。

不过这里可以先备着好了,最近的计划是先把分布式构建先做掉,之后搞完了,我可以研究下这块,反正一步一步来吧。

如果你要自己尝试整合包管理,可以参考下现有以及集成的包管理模块:https://github.com/xmake-io/xmake/tree/master/xmake/modules/package/manager 然后尝试写个提个pr也可以

不过文档还没有,而且现有的包管理都是针对c/c++的,针对其他语言是否会有其他结构上的改动,还不清楚,因为之前还没研究过其他的,如果你有兴趣也可以尝试下。

@waruqi waruqi added this to the todo milestone Sep 30, 2019
@waruqi
Copy link
Member

waruqi commented Jul 25, 2020

我初步支持了,完整例子可以参考:https://github.com/xmake-io/xmake/blob/dev/tests/projects/dlang/console_with_pkgs/xmake.lua

目前级联依赖还得手动外面展开才行,等后期有时间再完善,另外目前仅在macOS下测过,理论上win/linux应该也能支持。

add_rules("mode.debug", "mode.release")

add_requires("dub::log 0.4.3", {alias = "log"})
add_requires("dub::dateparser", {alias = "dateparser"})
add_requires("dub::emsi_containers", {alias = "emsi_containers"})
add_requires("dub::stdx-allocator", {alias = "stdx-allocator"})
add_requires("dub::mir-core", {alias = "mir-core"})

target("test")
    set_kind("binary")
    add_files("src/*.d")
    add_packages("log", "dateparser", "emsi_containers", "stdx-allocator", "mir-core")

@waruqi waruqi modified the milestones: todo, v2.3.6 Jul 25, 2020
@waruqi waruqi closed this as completed Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants