giginet / xcprofiler

:chart_with_upwards_trend: CLI to profile compilation time of Swift project
MIT License
332 stars 13 forks source link

Support Xcode 9 #21

Closed giginet closed 7 years ago

guidomb commented 7 years ago

What do you need to do to add support for Xcode 9? Can I help?

I'm getting the following error

'-Xfrontend -debug-time-function-bodies' flag is not enabled

while running xcprofiler Portal after building my framework using the following command

OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies" xcodebuild clean build -project Portal.xcodeproj -scheme Portal

Am I doing something wrong or is it an Xcode 9 compatibility problem?

guidomb commented 7 years ago

I have changed the build command to

xcodebuild clean build -project Portal.xcodeproj -scheme Portal -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' -derivedDataPath './output' OTHER_SWIFT_FLAGS='-Xfrontend -debug-time-function-bodies'

The standard output shows build time like the following

2.20ms  /Users/guidomb/Documents/projects/guidomb/PortalApplication/Portal/View/UIKit/Renderers/ProgressRenderer.swift:22:10    func render(with layoutEngine: LayoutEngine, isDebugModeEnabled: Bool) -> Render<ActionType>
1.84ms  /Users/guidomb/Documents/projects/guidomb/PortalApplication/Portal/View/UIKit/Renderers/ProgressRenderer.swift:37:22    fileprivate func apply(style: ProgressStyleSheet)
0.14ms  <invalid loc>   init?(rawValue: UInt)
0.07ms  <invalid loc>   get {}
1.86ms  <invalid loc>   get {}
0.13ms  <invalid loc>   init(_ rawValue: String)
0.11ms  <invalid loc>   init(rawValue: String)
0.04ms  <invalid loc>   get {}
0.03ms  <invalid loc>   get {}
0.03ms  <invalid loc>   get {}
0.43ms  <invalid loc>   init()
0.70ms  <invalid loc>   init()
0.29ms  <invalid loc>   init()
0.34ms  <invalid loc>   init()
0.08ms  <invalid loc>   init()
0.11ms  <invalid loc>   init?(rawValue: Int)

but when I run xcprofiler output/Logs/Build/9A581451-11F3-4568-89AE-FA4C7B20AE41.xcactivitylog I still get

'-Xfrontend -debug-time-function-bodies' flag is not enabled

I'm using xcodebuild with Xcode 9.

giginet commented 7 years ago

@guidomb Hi, Sorry for my late reply. I tried several projects on Xcode beta 5. xcprofiler works well. So this problem is not caused by compatible.

Could you check your environment?

I'll close this issue because there are no problems on Xcode 9. If you can not solve this problem. Could you make an another issue?