diff options
| author | ruki <[email protected]> | 2020-02-27 22:37:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-02-27 09:42:01 +0800 |
| commit | f26c0edb8b74cd48a27d833bc75a0cd0ecf6a0a1 (patch) | |
| tree | a181b445feda5a650e4ed79cb3aa02dd2b1132d3 | |
| parent | 8ff71e5b75987914e71fa446c0fad82868be6c50 (diff) | |
add dry-run command
| -rw-r--r-- | CHANGELOG.md | 10 | ||||
| -rw-r--r-- | xmake/actions/build/kinds/binary.lua | 4 | ||||
| -rw-r--r-- | xmake/actions/build/kinds/shared.lua | 4 | ||||
| -rw-r--r-- | xmake/actions/build/kinds/static.lua | 4 | ||||
| -rw-r--r-- | xmake/actions/build/xmake.lua | 1 | ||||
| -rw-r--r-- | xmake/modules/private/action/build/object.lua | 4 |
6 files changed, 23 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index aabf6b6c7..c7ac38c60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## master (unreleased) +### New features + +* Add powershell theme for powershell terminal +* Add `xmake --dry-run -v` to dry run building target and only show verbose build command. + ## v2.3.1 ### New features @@ -681,6 +686,11 @@ ## master (开发中) +### 新特性 + +* 添加powershell色彩主题用于powershell终端下背景色显示 +* 添加`xmake --dry-run -v`命令去空运行构建,仅仅为了查看详细的构建命令 + ## v2.3.1 ### 新特性 diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua index b6d3fa937..97e4d14e8 100644 --- a/xmake/actions/build/kinds/binary.lua +++ b/xmake/actions/build/kinds/binary.lua @@ -88,7 +88,9 @@ function _do_link_target(target, opt) io.flush() -- link it - assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags})) + if not option.get("dry-run") then + assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags})) + end -- update files and values to the dependent file dependinfo.files = depfiles diff --git a/xmake/actions/build/kinds/shared.lua b/xmake/actions/build/kinds/shared.lua index 7b93b580b..31f97a51a 100644 --- a/xmake/actions/build/kinds/shared.lua +++ b/xmake/actions/build/kinds/shared.lua @@ -101,7 +101,9 @@ function _do_link_target(target, opt) io.flush() -- link it - assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags})) + if not option.get("dry-run") then + assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags})) + end -- update files and values to the dependent file dependinfo.files = depfiles diff --git a/xmake/actions/build/kinds/static.lua b/xmake/actions/build/kinds/static.lua index 2c225a353..42481d3ec 100644 --- a/xmake/actions/build/kinds/static.lua +++ b/xmake/actions/build/kinds/static.lua @@ -97,7 +97,9 @@ function _do_link_target(target, opt) io.flush() -- link it - assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags})) + if not option.get("dry-run") then + assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags})) + end -- update files and values to the dependent file dependinfo.files = depfiles diff --git a/xmake/actions/build/xmake.lua b/xmake/actions/build/xmake.lua index eab28b41f..2dd6fbd8e 100644 --- a/xmake/actions/build/xmake.lua +++ b/xmake/actions/build/xmake.lua @@ -41,6 +41,7 @@ task("build") {'b', "build", "k", nil , "Build target. This is default building mode and optional." } , {'r', "rebuild", "k", nil , "Rebuild the target." } , {'a', "all", "k", nil , "Build all targets." } + , {nil, "dry-run", "k", nil , "Dry run to build target." } , {} , {'j', "jobs", "kv", tostring(math.ceil(os.cpuinfo().ncpu * 3 / 2)), diff --git a/xmake/modules/private/action/build/object.lua b/xmake/modules/private/action/build/object.lua index b2aec9c72..aaeef7725 100644 --- a/xmake/modules/private/action/build/object.lua +++ b/xmake/modules/private/action/build/object.lua @@ -76,7 +76,9 @@ function _do_build_file(target, sourcefile, opt) -- compile it dependinfo.files = {} - assert(compinst:compile(sourcefile, objectfile, {dependinfo = dependinfo, compflags = compflags})) + if not option.get("dry-run") then + assert(compinst:compile(sourcefile, objectfile, {dependinfo = dependinfo, compflags = compflags})) + end -- update files and values to the dependent file dependinfo.values = depvalues |
