My project is using Amazon commercial service. It has a header file which is named CommonTypes.h
. This file imports about 130 other header files.
In the Bridging-Header.h
file of my app, I include the CommonTypes.h
beside the other libraries.
When the app is building, I see it takes too much time to build a swift file, about 5-7s. Assume my project contains 500 swift files, it takes about 50 minutes to rebuild.
The log I see when the project is building:
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:
I guess the builder take so much time because it imports those header files when build every file.
Does anyone know how to force those libraries just build one time only?