Cat1237 / cocoapods-hmap

A Command Line Tool And CocoaPods plugin which can gen/read header map file.
MIT License
114 stars 39 forks source link

当workspace中包含多个`app_target`的情况下会出现stack level too deep #24

Open blastmann opened 2 years ago

blastmann commented 2 years ago

project_helper.rb中会对workspace.project进行递归遍历,如workspace中包含多个app_target时,将会导致递归无法正常退出,最终引起stack overflow。

demo工程待补充。

考虑一下在project_helper.rb里面增加以下逻辑:

if targets.any?(&:app_target?)
    workspace.projects.each do |pr|
        next if pr == self
        next if pr.targets.any?(&:app_target?) # app_target没有嵌套的可能

        hs.merge!(pr.project_headers) { |_, v1, _| v1 }
    end
end