diff options
| author | ruki <[email protected]> | 2023-02-03 00:44:07 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-02-03 00:44:07 +0800 |
| commit | fe1fafe91a26b0572de3ebe42f685219877465c2 (patch) | |
| tree | c176dbfe8f1d677d2bfd43d622e9ccae3d622262 | |
| parent | 7a41af778106504c68b5fe436d2fbb84b9595bb1 (diff) | |
improve to show target info
| -rw-r--r-- | xmake/plugins/show/info/target.lua | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/xmake/plugins/show/info/target.lua b/xmake/plugins/show/info/target.lua index 7d86329ef..d33e21daf 100644 --- a/xmake/plugins/show/info/target.lua +++ b/xmake/plugins/show/info/target.lua @@ -33,6 +33,7 @@ function main(name) -- show target information print("The information of target(%s):", name) + cprint(" ${color.dump.string}at${clear}: %s", path.join(target:scriptdir(), "xmake.lua")) cprint(" ${color.dump.string}kind${clear}: %s", target:kind()) cprint(" ${color.dump.string}targetfile${clear}: %s", target:targetfile()) local deps = target:get("deps") @@ -67,17 +68,11 @@ function main(name) end end end - cprint(" ${color.dump.string}at${clear}: %s", path.join(target:scriptdir(), "xmake.lua")) - for _, sourcebatch in pairs(target:sourcebatches()) do - cprint(" ${color.dump.string}sourcebatch${clear}(%s): with rule(%s)", sourcebatch.sourcekind, sourcebatch.rulename) - for idx, sourcefile in ipairs(sourcebatch.sourcefiles) do - cprint(" -> %s", sourcefile) - if sourcebatch.objectfiles then - cprint(" ${dim}-> %s", sourcebatch.objectfiles[idx]) - end - if sourcebatch.dependfiles then - cprint(" ${dim}-> %s", sourcebatch.dependfiles[idx]) - end + local files = target:get("files") + if files then + cprint(" ${color.dump.string}files${clear}:") + for _, file in ipairs(files) do + cprint(" -> %s", file) end end end |
