0

我的项目正在使用亚马逊商业服务。它有一个名为CommonTypes.h. 该文件导入了大约 130 个其他头文件。在Bridging-Header.h我的应用程序的文件中,我CommonTypes.h在其他库旁边包含了。

在构建应用程序时,我发现构建一个 swift 文件需要花费太多时间,大约 5-7 秒。假设我的项目包含 500 个 swift 文件,重建大约需要 50 分钟。

我在项目构建时看到的日志:

CompileSwift normal armv7 /Users/admin/xxxx/ViewControllers/ModallyPresentedViewController/CustomModalPresentationController.swift
cd /Users/admin/xxxx

/Users/admin/xxxx/Bridging-Header.h:24:9: note: in file included from     /Users/admin/xxxx/Bridging-Header.h:24:
/Users/admin/xxxx/xxx/Libs/pico/awsecommerceservice/_2011_08_01/common/CommonTypes.h:90:9: note: in file included from /Users/admin/xxxx/Libs/pico/awsecommerceservice/_2011_08_01/common/CommonTypes.h:90:

CompileSwift normal armv7     /Users/admin/xxxx/ViewControllers/ModallyPresentedViewController/Wrapper.swift
cd /Users/admin/xxxx

/Users/admin/xxxx/Bridging-Header.h:24:9: note: in file included from     /Users/admin/xxxx/Bridging-Header.h:24:
/Users/admin/xxxx/xxx/Libs/pico/awsecommerceservice/_2011_08_01/common/CommonTypes.h:90:9: note: in file included from /Users/admin/xxxx/Libs/pico/awsecommerceservice/_2011_08_01/common/CommonTypes.h:90:

我猜构建器花费了很多时间,因为它在构建每个文件时都会导入这些头文件。

有谁知道如何强制这些库只构建一次?

4

0 回答 0