RobertGummesson / BuildTimeAnalyzer-for-Xcode

Build Time Analyzer for Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot get the plugin to install correctly

plivesey opened this issue · comments

I installed via alcatraz:

$ ls ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins
Alcatraz.xcplugin       BuildTimeAnalyzer.xcplugin

I've restarted Xcode several times, but I do not see anything under the view menu and Ctrl+Shift+B does nothing. Do you have any recommendations on how to debug?

Btw, I'm using Xcode 7.2.1. Is that supported?

I have not added support for older Xcode versions. You could however download the project and add the support yourself if you want.

Do defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID in the terminal. Then add the UUID you get back to Info.plist under DVTPlugInCompatibilityUUIDs.

Thanks for the quick response. So currently, 7.3.1 (and above in the future) is supported?

Adding 7.2.1 support now btw.

The annoying bit with Xcode plugins is that the UUIDs has to be added manually every time Apple updates Xcode. Xcode 7.3 and 7.3.1 uses the same plugin compatibility UUID so those are the two versions supported as of right now. I'll try to be quick to add more UUIDs when new Xcode versions pop up.

I created a pull request:
#21

Do 7.2.1 and 7.2 have the same version? I can update the docs.

Yep, so with your PR, it will support Xcode 7.2 - 7.3.1.

Here's the new pull request: #22
Screwed up the first one.

Updating to 7.2 - 7.3.1

Updated

Thanks!

How does this get updated in Alcatraz?

Asking to see if I can avoid downloading 7.3 😛
Our project only builds on 7.2.1 right now.

Alcatraz updates right away and should be working for 7.2.1 already.

...alternatively you can build the plugin yourself.

I can't build because the code isn't compatible with 7.2.1. I could convert the code, or download 7.3.1, but I'm lazy. :)

Hmmm. Doesn't seem to be working installing from alcatraz. I tried reinstalling and rebooting Xcode. Ideas on how to debug?

It looks like everything in the plugin is empty:

plivesey-mn3:BuildTimeAnalyzer.xcplugin plivesey$ ls Contents/MacOS/
plivesey-mn3:BuildTimeAnalyzer.xcplugin plivesey$ ls Contents/Resources/

I'm not sure how plugins work. Does it run the code locally? If so, it may not work because the code can't compile on 7.2.1?

Yep. Fixed the code to work on 7.2.1 and it works locally now. I'm guessing that was the problem.
How do you feel about downgrading the code to be 7.2.1 friendly?

Changes:
#selector doesn't exist (need to use "selector:" instead)
need to add a NSObject.Type cast here: guard let windowController = NSClassFromString("IDEWorkspaceWindowController") as? NSObject.Type else { return nil }

Not too keen on downgrading since I am on Xcode 7.3.1 myself. I'm not sure if Xcode is to blame though. I think this is Swift 2.2 which came with Xcode 7.3. Wonder if there is a way to check at compile time similar to checking iOS version if #available(iOS 9.0, *).

I would have thought the "" selector syntax also works on 7.3.1? (Yeah totally agree that we shouldn't break 7.3.1. I was hoping to support both).

AFAIK, there is no way to detect swift compiler version...in the past for this, we've created precompile macros and changed them manually. This won't work here though.

Here's the pull request. Can you try it with 7.3 and see if it works?

I compiles but with warnings so I'd prefer to keep the more future proof Swift 2.2 selectors.

Got it.
In that case, I'd revert my commits. There is a #if swift(>=2.2) command, but that only works on Xcode 7.3 :(

So don't see anyway of getting this working. I can run locally though, so I'm unblocked :)

Ah, almost. :)

Thanks for your help. I wrote a really dumb script to do this, but this is way better :).
We're trying to upgrade to 7.3 soon, but the build machinery is way flakier than 7.2.1 (simulator is way less stable on CI machines).