-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Vert.x compiling Scala examples for you #30
Comments
@raniejade accepted to take this on |
An interesting subtask here would be to able to detect changes in source code and reload Vert.x application, which would require coordinating with similar efforts within SBT plugin |
Currently the code for loading
|
@galderz You might be interested in my comment :) |
Let's restore the commented out section as per the discussion with @edgarchan in another issue, keep it simple with just one verticle per source file for now. If it works as expected let's just get it done and move on... |
Roger that @pidster :) |
Currently I'm having issue with compiler not able to see the classpath. Will read on it, so probably that is the reason in what was commented out in the first place. |
Okay, the problem is the scala interpreter is not able to scala-.jar libraries and as well as the class files for mod-lang-scala. Scala interpreter can use the java classpath, however the classpath does not contain the necessary jar files (scala-.jar, etc). As was able to make it work however I needed to hard code the paths to the jars needed. EDIT: I think I have an idea how to fix these, I'll let you know when it all works well :) |
sure. On 13 August 2013 15:24, Ranie Jade Ramiso notifications@github.com wrote:
|
@raniejade Deploying 1 instance is a good starting point. Do you have a branch and some instructions to play a bit with it? We can then compare it with how it's done for java and get a clearer idea. |
Will be pushing it later when I get home, thanks!. On Wed, Aug 14, 2013 at 4:24 PM, Galder Zamarreño
Ranie Jade Ramiso w: raniejaderamiso.com |
Thanks Ranie! I'll give it a go and let you know :) |
@raniejade Looks good, but doesn't fully work when trying to run it as a Vert.x example (https://github.com/vert-x/vertx-examples). I'm making some changes to your code to work here... I'll send you a pull req when ready. |
@raniejade I've added some code to detect all jars within lib/ directory and tried to run your code via a Vert.x example I've created, and this is what I see: https://gist.github.com/galderz/dbd5331e435fbac2a08b (it includes step to replicate). My branch in the mod-lang-scala repo is: Do you know what the problem might be? |
The HelloWorldServer class what package is it in? The directory structure On Fri, Aug 16, 2013 at 8:22 PM, Galder Zamarreño
Ranie Jade Ramiso w: raniejaderamiso.com |
@galderz Do you know the link for the documentation of scala compiler api? I can't seem to find it, it's hard to work blindly LOL. |
I've managed to get it working! Instead of executing:
Execute:
^ The latter option works as expected :) :) :) |
@raniejade I'll submit a pull request with our both commits and then another to the vertx example repository. |
Awesome :)
|
I've sent a pull req for the first Scala example too. The last thing missing is how steps 2. and 3. in these instructions need to happen automatically... |
Great! :) On Tue, Aug 27, 2013 at 8:42 PM, Galder Zamarreño
Ranie Jade Ramiso w: raniejaderamiso.com |
Vert.x Java examples can be compiled and run on the fly. The Scala modules should have a similar option that allows Scala examples to be compiled on the fly and run. This would provide parity with Vert.x Java examples.
It's unclear whether this is already supported in
ScalaVerticleFactory
, so the first thing to do here would be to verify whether this already works. This class already has hooks with the Scala interpreter, so it'd be good to come up with an example/test that verifies this works as expected. For example, take one of the examples and see if you can run it with similar instructions to these:vertx run MyApp.scala
If the code in the Scala verticle is not sufficient, one of the options to achieve this is to hook an SBT based Scala compiler, just like IntelliJ IDEA currently does.
The text was updated successfully, but these errors were encountered: