Skip to content
Discussion options

You must be logged in to vote

目前就 on_build_xxx 相关的任务,是并行处理的,但是 before_build 里面你应该没法处理后续 add files ,滞后了。

而 on_config 目前没做并行,仅仅只是简单的做了串行执行。。要搞成并行也是可以,不过需要花点时间,可以提 feature request 到 issues ,等后面排期

目前配置阶段,在不改 config 的情况下想要并行,也能搞,就是麻烦些。

on_config 里面,走 import 直接统一调用独立的 config 模块

on_config("reflection_config")

然后当前 rule 目录下,搞个 reflection_config.lua ,里面对所有 target,仅仅执行一次,然后用 project.targets 取出所有 targets,走 runjobs 自己搞并行。

import("core.project.project")
import("private.async.runjobs")

function _generate_once()
       local targets = project.ordertargets()
       local task = function (index)
           -- 并行处理 targets
       end
       runjobs("build", task)
end

function main()
    if not _g.generated then
         _generate_once(…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@SaeruHikari
Comment options

Answer selected by SaeruHikari
Comment options

You must be logged in to vote
1 reply
@waruqi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants