Jintin / Swimat

An Xcode formatter plug-in to format your swift code.
https://jintin.github.io/Swimat/
MIT License
1.65k stars 89 forks source link

Xcode 12.2 & Big Sur cannot show extension in Editor #227

Closed keyhuihk01 closed 3 years ago

keyhuihk01 commented 3 years ago

https://developer.apple.com/forums/thread/666434?page=1#647663022

Source Editor extensions now need to link / embed & sign the XcodeKit framework.

Jintin commented 3 years ago

Thanks for raise this issue, I've merge one possible fix into master branch, would you like to build on your own mac to see if it help. But there are another issue not showing on MacOS Catalina 10.15.7 (19H15) and Xcode 12.2 (12B45b).

firetrap commented 3 years ago

Thanks for raise this issue, I've merge one possible fix into master branch, would you like to build on your own mac to see if it help. But there are another issue not showing on MacOS Catalina 10.15.7 (19H15) and Xcode 12.2 (12B45b).

I couldn't try in MacOS 10.15.7 because I did the upgrade. I tested in MacOS 11 with Xcode 11.7 and Xcode 12.2 and everything worked fine. I didn't realize this XcodeKit.framework update would be breaking previous MacOS versions doesn't make sense. I just build and replaced the app and tool (usr/local/bin) just in case. Create a new branch or tag for Big sur?

Jintin commented 3 years ago

Make sense, branch is here you guys can try to use it. https://github.com/Jintin/Swimat/tree/feature/bigsur ~I'll revert the change for master soon if we don't have a quick fix.~ The error seems to relate to this log just FYI:

2020-11-20 09:13:12.715773+0800 Xcode[41471:2058752]  IDEExtensionManager: Xcode Extension does not incorporate XcodeKit: com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension (file:///Applications/SwiftFormat%20for%20Xcode.app/Contents/PlugIns/SwiftFormat.appex/)
2020-11-20 09:13:12.720355+0800 Xcode[41471:2058752]  IDEExtensionManager: Xcode Extension does not incorporate XcodeKit: com.jintin.Swimat.Extension (file:///Applications/Swimat.app/Contents/PlugIns/Extension.appex/)
ijaureguialzo commented 3 years ago

I've just tested master branch on macOS 10.15.7 with Xcode 12.2 and it works.

As of Xcode 12 release notes the key seems to have it compiled it with Xcode 12:

For compatibility with new security features in macOS 11, Xcode extensions must be built using Xcode 12 and must embed XcodeKit.framework. An Xcode extension rebuilt with these tools remains compatible with older versions of Xcode and macOS. (51822755)

firetrap commented 3 years ago

I've just tested master branch on macOS 10.15.7 with Xcode 12.2 and it works.

As of Xcode 12 release notes the key seems to have it compiled it with Xcode 12:

For compatibility with new security features in macOS 11, Xcode extensions must be built using Xcode 12 and must embed XcodeKit.framework. An Xcode extension rebuilt with these tools remains compatible with older versions of Xcode and macOS. (51822755)

That explains a lot 😉

Jintin commented 3 years ago

Thanks @ijaureguialzo and @firetrap

Jintin commented 3 years ago

Create a pre-release version 1.7.0 here. https://github.com/Jintin/Swimat/releases/tag/1.7.0 Would you guys help to verify it works on new/old version of mac and xcode. mine is mac: 10.15.7 (19H15) xcode: 12.2 (12B45b)

ijaureguialzo commented 3 years ago

Tested on:

macOS 11.0.1 (20B29) + Xcode 12.2 (12B45b) -> Working macOS 10.15.7 (19H2) + Xcode 12.2 (12B45b) -> Working

Jintin commented 3 years ago

1.7.0 released, thanks everyone.

djiangnz commented 3 years ago

Upgrade to 1.7 with no luck.

Mac: 11.0.1 (20B29) Version 12.2 (12B45b)