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

Add xmake show plugin to show some builtin configuration values and infos #798

Closed
9 of 13 tasks
waruqi opened this issue May 21, 2020 · 18 comments
Closed
9 of 13 tasks

Comments

@waruqi
Copy link
Member

waruqi commented May 21, 2020

  • --list=toolchains
  • --list=targets
  • --list=platforms
  • --list=buildmodes
  • --list=rules
  • --list=packages
  • --list=envs
  • --toolchain=clang
  • --plat=macosx
  • --target=xxx
  • --package=xxx
  • xmake show (basic info)
  • support json format output
$ xmake show --list=toolchains
$ xmake show --list=targets
$ xmake show --list=platforms
$ xmake show --list=packages

$ xmake show --toolchain=clang
$ xmake show --plat=macosx
$ xmake show -p macosx
$ xmake show --target=xxx
$ xmake show --package=xxx
@waruqi waruqi added this to the v2.3.4 milestone May 21, 2020
@waruqi
Copy link
Member Author

waruqi commented Jun 2, 2020

Show basic information xmake show

$ xmake show
The information of xmake:
    version: 2.3.3+202006011009
    host: macosx/x86_64
    programdir: /Users/ruki/.local/share/xmake
    programfile: /Users/ruki/.local/bin/xmake
    globaldir: /Users/ruki/.xmake
    tmpdir: /var/folders/32/w9cz0y_14hs19lkbs6v6_fm80000gn/T/.xmake501/200602
    workingdir: /Users/ruki/projects/personal/tbox
    packagedir: /Users/ruki/.xmake/packages
    packagedir(cache): /Users/ruki/.xmake/cache/packages/2006

The information of project: tbox
    version: 1.6.5
    configdir: /Users/ruki/projects/personal/tbox/.xmake/macosx/x86_64
    projectdir: /Users/ruki/projects/personal/tbox
    projectfile: /Users/ruki/projects/personal/tbox/xmake.lua

@waruqi
Copy link
Member Author

waruqi commented Jun 2, 2020

Show the given target infomation xmake show --target=tbox

$ xmake show --target=tbox
The information of target(tbox):
    kind: static
    targetfile: build/macosx/x86_64/release/libtbox.a
    rules: mode.release, mode.debug, mode.profile, mode.coverage
    options: info, float, wchar, exception, force-utf8, deprecated, xml, zip, hash, regex, coroutine, object, charset, database
    packages: mbedtls, polarssl, openssl, pcre2, pcre, zlib, mysql, sqlite3
    links: pthread
    syslinks: pthread, dl, m, c
    cxflags: -Wno-error=deprecated-declarations, -fno-strict-aliasing, -Wno-error=expansion-to-defined, -fno-stack-protector
    defines: __tb_small__, __tb_prefix__="tbox"
    mxflags: -Wno-error=deprecated-declarations, -fno-strict-aliasing, -Wno-error=expansion-to-defined
    headerfiles: src/(tbox/**.h)|**/impl/**.h, src/(tbox/prefix/**/prefix.S), src/(tbox/math/impl/*.h), src/(tbox/utils/impl/*.h), build/macosx/x86_64/release/tbox.config.h
    includedirs: src, build/macosx/x86_64/release
    at: /Users/ruki/projects/personal/tbox/src/tbox/xmake.lua
    sourcebatch(cc): with rule(c.build)
      -> src/tbox/string/static_string.c
         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/string/static_string.c.o
         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/string/static_string.c.o.d
      -> src/tbox/platform/sched.c
         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/platform/sched.c.o
         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/platform/sched.c.o.d
      -> src/tbox/stream/stream.c
         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/stream/stream.c.o
         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/stream/stream.c.o.d
      -> src/tbox/utils/base32.c
         -> build/.objs/tbox/macosx/x86_64/release/src/tbox/utils/base32.c.o
         -> build/.deps/tbox/macosx/x86_64/release/src/tbox/utils/base32.c.o.d

@waruqi
Copy link
Member Author

waruqi commented Jun 2, 2020

Show toolchains xmake show -l toolchains

$ xmake show -l toolchains
xcode         Xcode IDE
vs            VisualStudio IDE
yasm          The Yasm Modular Assembler
clang         A C language family frontend for LLVM
go            Go Programming Language Compiler
dlang         D Programming Language Compiler
sdcc          Small Device C Compiler
cuda          CUDA Toolkit
ndk           Android NDK
rust          Rust Programming Language Compiler
llvm          A collection of modular and reusable compiler and toolchain technologies
cross         Common cross compilation toolchain
nasm          NASM Assembler
gcc           GNU Compiler Collection
mingw         Minimalist GNU for Windows
gnu-rm        GNU Arm Embedded Toolchain
envs          Environment variables toolchain
fasm          Flat Assembler

@waruqi waruqi modified the milestones: v2.3.4, v2.3.5 Jun 4, 2020
@playgithub
Copy link

能不能加个类似xmake show --list=targetpath
这样的话vscode launch.json就可以引用,而且现在vscodium的插件库独立了,找不到xmake插件了。

@waruqi
Copy link
Member Author

waruqi commented Jun 18, 2020

能不能加个类似xmake show --list=targetpath
这样的话vscode launch.json就可以引用,而且现在vscodium的插件库独立了,找不到xmake插件了。

#836 (comment) 我之前说的方式 试过没有,我发现你也真纠结。。

https://github.com/xmake-io/xmake-vscode/blob/master/assets/targetpath.lua 这里又实现方式,你可以个pr进来。

@playgithub
Copy link

xmake show要改哪个文件?

@waruqi
Copy link
Member Author

waruqi commented Jun 18, 2020

https://github.com/xmake-io/xmake/tree/master/xmake/plugins/show

另外,命令改成 xmake show --targetpath=xxx

@playgithub
Copy link

显示可执行文件的路径,那xxx是什么?

@waruqi
Copy link
Member Author

waruqi commented Jun 18, 2020

显示可执行文件的路径,那xxx是什么?

targetname啊,不然一个工程多个target,你要显示那个target路径?

@playgithub
Copy link


就是--targetpath=xxx不是太直观,我考虑一下

@waruqi
Copy link
Member Author

waruqi commented Jun 18, 2020

这有什么好不直观的,--help里面描述清楚不就好了,我刚只是随手敲的

xmake show --targetpath=[targetname]

@playgithub
Copy link

playgithub commented Jun 18, 2020

$ xmake show --list=toolchains
$ xmake show --list=targets
$ xmake show --list=platforms
$ xmake show --list=packages

$ xmake show --toolchain=clang
$ xmake show --plat=macosx
$ xmake show -p macosx
$ xmake show --target=xxx
$ xmake show --package=xxx

我看了下,这些语义都通的
targetpath=targetname 不通啊

@playgithub
Copy link

加这反而不好,先算了

@waruqi
Copy link
Member Author

waruqi commented Jun 18, 2020

那你就自己本地搞个 get_targetname.lua 然后用 xmake lua xxxx.lua 直接调用获取么,不也很方便,https://github.com/xmake-io/xmake-vscode/blob/master/assets/targetpath.lua

@waruqi
Copy link
Member Author

waruqi commented Jun 22, 2020

$ xmake show -l envs
XMAKE_TMPDIR            Set the temporary directory.
                        /var/folders/32/w9cz0y_14hs19lkbs6v6_fm80000gn/T/.xmake501/200622
XMAKE_LOGFILE           Set the log output file path.
                        <empty>
XMAKE_ROOT              Allow xmake to run under root.
                        <empty>
XMAKE_RAMDIR            Set the ramdisk directory.
                        <empty>
XMAKE_CONFIGDIR         Set the local config directory of project.
                        /Users/ruki/projects/personal/tbox/.xmake/macosx/x86_64
XMAKE_COLORTERM         Set the color terminal environment.
                        <empty>
XMAKE_PROGRAM_DIR       Set the program scripts directory of xmake.
                        /Users/ruki/.local/share/xmake
XMAKE_GLOBALDIR         Set the global config directory of xmake.
                        /Users/ruki/.xmake

@waruqi waruqi modified the milestones: v2.3.5, v2.3.6 Jun 25, 2020
@OpportunityLiu
Copy link
Member

这个插件的预期用途是啥样的啊?只是打出来看看吗?

要和其他工具交互的话最好有个--format=json之类的玩意吧

@waruqi
Copy link
Member Author

waruqi commented Jun 30, 2020

暂时目的只是为了打出来看,当然支持输出json和其他程序交互也可以搞

@waruqi waruqi modified the milestones: v2.3.6, todo Jul 28, 2020
@waruqi
Copy link
Member Author

waruqi commented Oct 12, 2020

这个先这样吧,等回头有需求 按需改进扩展 显示各种信息。

@waruqi waruqi closed this as completed Oct 12, 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

3 participants