Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

AppCode plugin and Xcode version #44

Open
grav opened this issue Oct 22, 2014 · 15 comments
Open

AppCode plugin and Xcode version #44

grav opened this issue Oct 22, 2014 · 15 comments

Comments

@grav
Copy link
Contributor

grav commented Oct 22, 2014

AppCode 3 does not rely on xcode-select, instead you choose the desired Xcode version in the Preferences.

But I believe the dyci plugin still relies on xcode-select. Is it possible to make the AppCode version of the plugin aware of the AppCode setting instead of using code-select?

@PaulTaykalo
Copy link
Member

Hm. Need to see what's going one there, but when I saw it last time, there's was not a lot API we can use related to AppCode settings.

@grav
Copy link
Contributor Author

grav commented Oct 23, 2014

Parsing ~/Library/Preferences/appcode30/options/other.xml works:

$ xpath ~/Library/Preferences/appCode30/options/other.xml "/application/component[@name='XcodeSettings']/option[@name='selectedXcode']/@value"

Found 1 nodes:
-- NODE --
 value="/Applications/Xcode511.app/Contents/Developer"

I might be able to do a patch though I'm not sure how to integrate with the plugin and all that

@PaulTaykalo
Copy link
Member

@grav Nice one. 👍
Don't think that I'll be able to get to it till Saturday.
So I'll write my thoughts about this:

  • Update dyci_recompile.py to handle additional parameter for xcode location
  • Update AppCode plugin for passing "additional parameter" to dyci_recompile.py

@grav
Copy link
Contributor Author

grav commented Oct 23, 2014

Just got my Java on and recreated the simple bash one-liner above in Java for the plugin:

https://gist.github.com/grav/d8f44d1a2ad527e764dc

(XPathFactory, sheesh ...)

@grav
Copy link
Contributor Author

grav commented Oct 23, 2014

Alright, I did a pull request with your suggestions, with the big disclaimer that I didn't test it, since I haven't tried compiling the plugin for AppCode yet!

#45

@grav
Copy link
Contributor Author

grav commented Nov 7, 2014

Okay, now I found out how to link to the correct jars to get the script to compile. I'm still not sure how to build the plugin jar so that I can test it in AppCode. Can you help me out there?

Edit: just for my own reference, this is how I compile:

javac -cp /Applications/AppCode.app/Contents/lib/*:. Support/AppCode/Dyci/src/com/stanfy/dyci/DyciRecompileAndInjectAction.java 

@PaulTaykalo
Copy link
Member

Well. The plugin was made long time ago
It was created by InteliJ IDEA
http://confluence.jetbrains.com/display/IDEADEV/PluginDevelopment
Read docs there. The plugin version can be outdated
I think you'll be able to do it :)
I'll look to this one on Saturday - a bit busy here.

Also - just to mention - use fallback, to old logic of searching xcode-select, in case if something will be different in AppCode configuration

@PaulTaykalo
Copy link
Member

It's may be even faster by using this example:
http://bjorn.tipling.com/how-to-make-an-intellij-idea-plugin-in-30-minutes

@grav
Copy link
Contributor Author

grav commented Nov 7, 2014

Thanks for the pointers, I'll look into it!

@PaulTaykalo
Copy link
Member

@grav How it's going? need a help? Will have some time to check this out :) Should I wait for you to finish?

@grav
Copy link
Contributor Author

grav commented Nov 8, 2014

@PaulTaykalo Didn't get down to looking at the tutorials yet. I did do a pull request with code that now actually compiles, but it is still untested.

It would be great if you could test out the PR. I won't have the time before next week.

@grav
Copy link
Contributor Author

grav commented Nov 10, 2014

Okay, I managed to set everything up and build the plugin in IntelliJ 13.
I had to download and build with JDK 1.6 from https://developer.apple.com/downloads/index.action in order to get AppCode to accept the plugin (since it's running on JRE 1.6).

However, I get a weird exception in AppCode when it starts up (or maybe it's when I do Ctrl+x the first time only, in any case, the reaction comes quite late):

Null child action in group Run () of class class com.intellij.openapi.actionSystem.DefaultActionGroup, id=com.stanfy.dyci.DyciRecompileAndInjectAction
java.lang.Throwable
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:113)
    at com.intellij.openapi.actionSystem.DefaultActionGroup.unStub(DefaultActionGroup.java:347)
    at com.intellij.openapi.actionSystem.DefaultActionGroup.getChildren(DefaultActionGroup.java:303)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$5.compute(ActionManagerImpl.java:1261)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$5.compute(ActionManagerImpl.java:1254)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.preloadActionGroup(ActionManagerImpl.java:1254)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.preloadActionGroup(ActionManagerImpl.java:1269)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.preloadActionGroup(ActionManagerImpl.java:1248)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.doPreloadActions(ActionManagerImpl.java:1239)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.access$200(ActionManagerImpl.java:73)
    at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$4.run(ActionManagerImpl.java:1220)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)

I've updated the pull request with the updated .iml and changelog: #63

Maybe I'll look into it again later this week, but ping me if you have any clues :-)

Edit: when I build the plugin, I get a 100 MB big plugin with all the AppCode libs for some reason, so I haven't pushed the updated plugin.

@PaulTaykalo
Copy link
Member

Well, 100 MB plugin is quite a lot :)
I'll look into your pull request later today thank you for your effort :)

@PaulTaykalo
Copy link
Member

Thank you @grav
Closed with #63 / #64
Wasn't sure how to do it correctly, but it seems, that it worked )

@PaulTaykalo
Copy link
Member

Well, we also need to handle 3.1 and later installations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants