Skip to content
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

Scala cmdl compiler #30

Merged
merged 7 commits into from Mar 27, 2017
Merged

Scala cmdl compiler #30

merged 7 commits into from Mar 27, 2017

Conversation

codepitbull
Copy link
Contributor

Resolves #11

def main(args: Array[String]): Unit = {
val compiler = new OnTheFlyCompiler(None)
val clazz = compiler
.tryToCompileClass("/Users/jochen/Development/8_vertx/vertx-lang-scala/vertx-lang-scala-on-the-fly/src/test/resources/SourceClass.scala")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that a problem ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holy cow, overlooked that one.
PR ftw :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Luckily that was a class I only used for my first test. I deleted it.

@tsegismont
Copy link
Contributor

Looks good to me. Only one minor comment, when reading the class name:

className.split(System.getProperty("file.separator")).last.replace(".scala","")

Wouldn't it be safer to do this with Java's Path or a Scala equivalent, in case the path mixes e.g Win and Unix paths separators?

Also, it might not be a problem in Scala but what happens if the verticle is in a package? The test case is for a verticle placed in the root of the classpath.

@codepitbull
Copy link
Contributor Author

Thanks for pointing that out. I will take a closer look at how the other langs handle that case.
I have the feeling I missed a few cases.

@codepitbull
Copy link
Contributor Author

Thanks for the recommendation. I switched to using Paths and added the capability to build Scala-Files from the classpath.

@tsegismont
Copy link
Contributor

👍

@codepitbull codepitbull merged commit 8695286 into master Mar 27, 2017
@vietj vietj removed the to review label Mar 27, 2017
@codepitbull codepitbull deleted the SCALA_CMDL_COMPILER branch June 14, 2017 20:32
willisjtc added a commit to willisjtc/vertx-lang-scala that referenced this pull request Jun 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants