MobileNativeFoundation / XCLogParser

Tool to parse Xcode and xcodebuild logs stored in the xcactivitylog format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XCLogParser does not pick up deprecation warnings from xcodebuild

smmcdonald opened this issue · comments

I've noticed that the log parser does not include deprecation warnings from xcodebuild in the HTML reporter. Is there a way to include deprecations as warnings as it does when running from the Xcode IDE?

Here is the xcodebuild command I'm using:
xcodebuild "-workspace" "/Users/[REDACTED]/git/MyApp.xcworkspace" "-scheme" "MyApp" "-configuration" "QA" "-resolvePackageDependencies" "-resultBundlePath" "/Users/[REDACTED]/deploy/MyApp.xcresult" "OTHER_SWIFT_FLAGS=-Xfrontend -debug-time-function-bodies -Xfrontend -debug-time-expression-type-checking" "OTHER_LINKER_FLAGS=-Xlinker -print_statistics"

Which generates these warnings:

/Users/[REDACTED]/git/MyApp/Utilities/ErrorViewController.swift:86:18: Error no longer used can be removed
        #warning("Error no longer used can be removed")
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
⚠️  /Users/[REDACTED]/git/MyApp/ColorUtils.swift:24:42: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
        if let context = CGContext(data: UnsafeMutableRawPointer(&rgba), width: 1, height: 1, bitsPerComponent: 8, bytesPerRow: 4, space: colorSpace, bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue | CGBitmapInfo.byteOrder32Big.rawValue) {
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
⚠️  /Users/[REDACTED]/git/MyApp/Utilities.swift:35:10: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
    data.withUnsafeBytes {
                                                                 ^
⚠️  /Users/[REDACTED]/git/MyApp/Utilities.swift:582:24: 'withUnsafeMutableBytes' is deprecated: use `withUnsafeMutableBytes<R>(_: (UnsafeMutableRawBufferPointer) throws -> R) rethrows -> R` instead
        _ = digestData.withUnsafeMutableBytes { digestBytes in
         ^
⚠️  /Users/[REDACTED]/git/MyApp/Utilities.swift:583:25: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
            messageData.withUnsafeBytes { messageBytes in
                       ^
⚠️  /Users/[REDACTED]/git/MyApp/Utilities.swift:584:17: 'CC_MD5' was deprecated in iOS 13.0: This function is cryptographically broken and should not be used in security contexts. Clients should migrate to SHA256 (or stronger).
                CC_MD5(messageBytes, CC_LONG(messageData.count), digestBytes)
                        ^
⚠️  /Users/[REDACTED]/git/MyApp/CustomPizzaOptionsViewController.swift:65:57: 'archivedData(withRootObject:)' was deprecated in iOS 12.0: Use +archivedDataWithRootObject:requiringSecureCoding:error: instead
            let categoryLabelTemplate = NSKeyedArchiver.archivedData(withRootObject: categoryLabel as Any)
                ^
⚠️  /Users/[REDACTED]/git/MyApp/CustomPizzaOptionsViewController.swift:66:56: 'archivedData(withRootObject:)' was deprecated in iOS 12.0: Use +archivedDataWithRootObject:requiringSecureCoding:error: instead
            let optionButtonTemplate = NSKeyedArchiver.archivedData(withRootObject: optionButton as Any)
                                                        ^
⚠️  /Users/[REDACTED]/git/MyApp/CustomPizzaOptionsViewController.swift:77:64: 'unarchiveObject(with:)' was deprecated in iOS 12.0: Use +unarchivedObjectOfClass:fromData:error: instead
                guard let newCategoryLabel = NSKeyedUnarchiver.unarchiveObject(with: categoryLabelTemplate) as? UILabel else { return }
                                                       ^
⚠️  /Users/[REDACTED]/git/MyApp/CustomPizzaOptionsViewController.swift:83:67: 'unarchiveObject(with:)' was deprecated in iOS 12.0: Use +unarchivedObjectOfClass:fromData:error: instead
                    guard let newOptionButton = NSKeyedUnarchiver.unarchiveObject(with: optionButtonTemplate) as? UIButton else { return }
                                                               ^
⚠️  /Users/[REDACTED]/git/MyApp/DrawerViewController.swift:63:11: 'DrawerViewControllerDelegate' is deprecated
extension DrawerViewControllerDelegate {
                                                                  ^
⚠️  /Users/[REDACTED]/git/MyApp/ModalDrawerController.swift:15:73: 'DrawerViewControllerDelegate' is deprecated

Only the first two warnings (none of the deprecated ones) show up in the report:
Screen Shot 2022-06-16 at 11 03 41 AM