Replies: 1 comment 6 replies
-
正常,单独定义执行 task,就是个完整的插件,独立于工程的存在,即使没有任何工程,也可以执行 xmake xxx 的 独立task 而 get_config 仅仅只是工程相关的本地配置读取。。 而你在 after_build 调用 task,因为已经加载了工程配置,当然可以读到了。。 单独执行,要么用 task 定义自己的 options, 要么,import core.project.config 模块,然后先 config.load() 加载本地工程配置,这个时候 get_config 就能取到,但是这种有限制,首次执行 task,你肯定取不到,因为还没执行
rule 之间通过 rule 的 add_deps 保证执行顺序,否则就是同级的,并行执行,顺序不保证。 |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Xmake 版本
xmake v2.6.4+HEAD.9361ffcc1,
操作系统版本和架构
Windows 10
描述问题
我写了这样一个task,在编译阶段合并bin文件,要调用sdk
如果直接执行这个task,或者在另一个任务调用这个task,就无法获取sdk。
error: attempt to concatenate a nil value
只能在target里面调用这个task。
另外:这个功能我本来是写在rule里面。不同的rule的after_build为什么不能保证执行顺序?link-all依赖arm-gcc的结果。并且task下面的after_build和add_rules里面的after_build也无法保证顺序。。。
期待的结果
在任何地方都应该能get_config,不应该是nil。因为我在第二行就import了toolchian
工程配置
No response
附加信息和错误日志
Beta Was this translation helpful? Give feedback.
All reactions