clojure-android / lein-droid

A Leiningen plugin for building Clojure/Android projects
Eclipse Public License 1.0
645 stars 56 forks source link

Document that nREPL functionality requires using defactivity or calling neko.init/init #69

Closed mccaffrey-jonathan closed 10 years ago

mccaffrey-jonathan commented 10 years ago

I had some difficulty getting the nREPL functionality to work in my project (I was repeatedly getting "SocketException: The transport's socket appears to have lost its connection to the nREPL server" ).

The reason was that I was using an activity created via gen-class, rather than defactivity, and that avoids calling neko.init/init, which starts the nREPL server. This is unlikely to happen when using lein droid new, but it's easy enough when using an existing project via lein droid init. As far as I can tell, this requirement to enable the nREPL server is not documented anywhere, it might be good to add a note to the wiki.

Thanks for the tools!

alexander-yakushev commented 10 years ago

Yes, I see that. Previously it was a job of defapplication to call that init, now after the splash stuff defapplication was dropped, and init moved to defactivity... meh.

Do you have an idea where this will be best put? There is a place here https://github.com/alexander-yakushev/neko/wiki/Namespaces#nekoinit (docs are outdated for this particular namespace... init doesn't happen after splash, but once at activity's onCreate). But I don't know if everyone will read that deeply.

It might help if you tell why you decided to gen-class activities manually. Is there anything defactivity seriously lacks? I mean, if we suppose that a user has very special needs to gen-class manually, then we can suppose he reads through namespaces docs. I just don't want to drift off the novices with mentioning gen-classing and manual initialization if they won't need it right away.

So what do you think? Should we place this information into the Tutorial, or hide it somewhere more deep?

mccaffrey-jonathan commented 10 years ago

In my limited experience, this came up when using lein droid init with an existing project rather than lein droid new; for me it was that I already had an activity written with gen-class from an existing project.

I could also imagine that a user might want to experiment with a Clojure repl in an existing java project.

So perhaps put this documentation as a caveat in lein droid init, which is off the Quick-Start beaten path anyways?

On Sat, Nov 2, 2013 at 6:38 AM, Alexander Yakushev <notifications@github.com

wrote:

Yes, I see that. Previously it was a job of defapplication to call that init, now after the splash stuff defapplication was dropped, and init moved to defactivity... meh.

Do you have an idea where this will be best put? There is a place here https://github.com/alexander-yakushev/neko/wiki/Namespaces#nekoinit (docs are outdated for this particular namespace... init doesn't happen after splash, but once at activity's onCreate). But I don't know if everyone will read that deeply.

It might help if you tell why you decided to gen-class activities manually. Is there anything defactivity seriously lacks? I mean, if we suppose that a user has very special needs to gen-class manually, then we can suppose he reads through namespaces docs. I just don't want to drift off the novices with mentioning gen-classing and manual initialization if they won't need it right away.

So what do you think? Should we place this information into the Tutorial, or hide it somewhere more deep?

— Reply to this email directly or view it on GitHubhttps://github.com/clojure-android/lein-droid/issues/69#issuecomment-27622108 .

alexander-yakushev commented 10 years ago

Right, initialization in an existing project.

I guess I should make a section in the tutorial about lein droid init and mention the necessity of calling neko.init/init there. And also update neko's namespaces wikipage.

I will close this issue as soon as I do that. Thank you!

alexander-yakushev commented 10 years ago

OK, I added the information about neko.init/init to the tutorial: https://github.com/clojure-android/lein-droid/wiki/Tutorial#cant-connect-to-the-remote-repl . I've mad this a part of Troubleshooting section, but it is visible enough to be found.

Thank you for helping me with this one! I'm closing the issue now.

mccaffrey-jonathan commented 10 years ago

LGTM. The only quibble I have would be including the actual Exception message you receive if a used does this so that it's more likely to show up in Google searches.

On Fri, Nov 8, 2013 at 4:13 PM, Alexander Yakushev <notifications@github.com

wrote:

OK, I added the information about neko.init/init to the tutorial: https://github.com/clojure-android/lein-droid/wiki/Tutorial#cant-connect-to-the-remote-repl. I've mad this a part of Troubleshooting section, but it is visible enough to be found.

Thank you for helping me with this one! I'm closing the issue now.

? Reply to this email directly or view it on GitHubhttps://github.com/clojure-android/lein-droid/issues/69#issuecomment-28108747 .

alexander-yakushev commented 10 years ago

Sounds reasonable. When exactly do you get the exception if no init is called, is it as the application loads?