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 support on macOS 11 #224

Closed hyperphonic0 closed 4 years ago

hyperphonic0 commented 4 years ago

What is the issue Extension does not work with Xcode 12, the Editor > Swimat menu item is not present.

Expected behaviour The Editor > Swimat entry does not appear

Desktop (please complete the following information):

Additional context XcodeKit.framework needs to be added to the extension target (Embed without signing), then the extension will function again in Xcode 12.

sourcelocation commented 4 years ago

Hi. Is there any workaround?

hyperphonic0 commented 4 years ago

Yes, it's merged already.

(So I guess this should be closed!)

hyperphonic0 commented 4 years ago

Resolved by #225 .

hyperphonic0 commented 4 years ago

Revised issue title... new macOS security features were preventing the extension from running.

From the Xcode 12 Beta 2 Release Notes:

Source Editor

Known Issues A new Xcode Source Editor Extension target does not automatically set up embedding XcodeKit.framework in the extension. (59274389) Workaround: Embed XcodeKit.framework in the extension manually.

An Xcode extension may cause Xcode to hang on launch, or upon enabling the extension. (61952790) Workaround: Disable the Xcode extension in the Extensions pane in System Preferences.

Deprecations 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)

St1ggy commented 4 years ago

I have not Swimat in Editor in Xcode 12 :(

Xcode 11 Screenshot 2020-08-27 at 21 51 12
Xcode 12 Screenshot 2020-08-27 at 21 51 23
hyperphonic0 commented 4 years ago

Did you build Swimat from source?

If you didn't then do that (I don't think the fix is in a built release yet).

Another possibility There are sometimes problems (with all extensions, not just swimat) if you have two installations of Xcode on your machine at once.

check the output of:

xcode-select -p

(will be something like: /Applications/Xcode.app/Contents/Developer)

Make sure this matches the Xcode 12 path.

Change if necessary with:

sudo xcode-select -s <NEW DEVELOPER FOLDER PATH>

For example:

sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

Then check all the usual things for extensions (e.g. that they are enabled, security, ...).

St1ggy commented 4 years ago

Did you build Swimat from source?

If you didn't then do that (I don't think the fix is in a built release yet).

Another possibility

There are sometimes problems (with all extensions, not just swimat) if you have two installations of Xcode on your machine at once.

check the output of:

xcode-select -p

(will be something like: /Applications/Xcode.app/Contents/Developer)

Make sure this matches the Xcode 12 path.

Change if necessary with:

sudo xcode-select -s <NEW DEVELOPER FOLDER PATH>

For example:

sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

Then check all the usual things for extensions (e.g. that they are enabled, security, ...).

Yeah, thank you! I've just built it with Xcode 12 and XcodeKit.framework and it works now!