krzysztofzablocki / LifetimeTracker

Find retain cycles / memory leaks sooner.

Home Page:http://merowing.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swift Package Manager Support for iOS

ReneLindhorst opened this issue · comments

Is far as I can see it is currently not possible to integrate the LifetimeTracker using the Swift Package Manager into an iOS application. The Package.swift tries to only include the iOS specific UI using the #if os(iOS) ... #else ... #endif but as the manifest is compiled for the host platform (see here), this doesn't work as expected.

As the CocoaPods integration currently doesn't support macOS and there is no macOS "dashboard" #18, I would suggest to remove the #if os(iOS) condition and make the SwiftPM integration at least work for iOS.

hey, any chance you could make a pr with that change? happy to merge it

@krzysztofzablocki Definitely. I just wanted to wait for your reactions ;-)

@ReneLindhorst if you can, the best way would be to tweak podspec so that only iOS target imports files under iOS folder, then MacOS still works just without dashboard (you can still log leaks on mac os)

@krzysztofzablocki Currently the podspec is only configured for iOS and not at all for macOS:
https://github.com/krzysztofzablocki/LifetimeTracker/blob/master/LifetimeTracker.podspec#L12
It would be possible to tweak the podspec to support both but I don't think that this is currently possible with the Package.swift DSL (maybe with 2 different library definitions, but I'm not sure).

I think you can leave the swiftpm to only support iOS but just tweak podspec to support both iOS and Mac ?

That's "fixed". Thanks @krzysztofzablocki