0

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?

t4nhpt
  • 5,264
  • 4
  • 34
  • 43
  • You might want to upgrade you RAM if they are 8GB :) It's not a joke! I almost faced the same issues on my mac pro, after upgrading RAM to 16GB I saw real change. Before couple of years, xcode was perfectly work, but for xcode 7 and higher, I had to make an upgrade – Ahmad F Oct 19 '16 at 06:32
  • My macbook is Macbook pro, mid 2015, corei7(2.2), 16GB Ram :D – t4nhpt Oct 19 '16 at 07:21
  • lol! so, you might want to check [this](http://stackoverflow.com/questions/1479085/how-to-decrease-build-times-speed-up-compile-time-in-xcode), [this](http://stackoverflow.com/questions/19064702/xcode-ios-project-taking-long-time-to-compile-and-run) and [this](https://spin.atomicobject.com/2016/04/26/swift-long-compile-time/) – Ahmad F Oct 19 '16 at 07:28

0 Answers0