Create an empty project:
sh
$ xmake create -l dlang -t console testEXPLORER
src
main.d
xmake.lua
Lua xmake.lua
12345
add_rules("mode.debug", "mode.release")
target("test")
set_kind("binary")
add_files("src/*.d")
Starting from the v2.3.6 version, xmake adds support for dub package management, which can quickly integrate third-party dependency packages of dlang:
EXPLORER
src
main.d
xmake.lua
Lua xmake.lua
123456789
add_rules("mode.debug", "mode.release")
add_requires("dub::log 0.4.3", {alias = "log"})
add_requires("dub::dateparser", {alias = "dateparser"})
target("test")
set_kind("binary")
add_files("src/*.d")
add_packages("log", "dateparser")
However, there are still some imperfections. For example, all cascading dependency packages must be manually configured at present, which will be a bit more cumbersome and needs to be improved in the future.
For more examples, see: Dlang Examples