Skip to content

Embryonic but functioning JSR223 support #5686

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

Merged
merged 1 commit into from
Jan 25, 2019
Merged

Conversation

rjolly
Copy link
Contributor

@rjolly rjolly commented Jan 8, 2019

This is mainly to obtain feedback. Once on track, I will consider remaining features like compiled scripts, variable bindings, classpath issues and so on, to be on par with the 2.12 implementation.

How to run:

jrunscript -J-Djava.class.path="C:\Program Files\Java\jdk1.8.0_191\lib\tools.jar;dotty-library_0.11-0.11.0-RC1.jar;scala-library-2.12.7.jar;scala-asm-6.0.0-scala-1.jar" -classpath dotty-compiler_2.12-0.12.0-bin-SNAPSHOT-nonbootstrapped.jar;dotty-interfaces-0.11.0-RC1.jar -l scala
scala> "hello world"
val res0: String = hello world

hello world
scala>

Copy link
Member

@dottybot dottybot left a comment

Choose a reason for hiding this comment

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

Hello, and thank you for opening this PR! 🎉

All contributors have signed the CLA, thank you! ❤️

Have an awesome day! ☀️

@rjolly rjolly force-pushed the scripting branch 3 times, most recently from dedb1ef to 62a4282 Compare January 8, 2019 15:04
@Blaisorblade
Copy link
Contributor

This doesn’t look very invasive but it needs tests, unless there’s an extremely good reason.

@rjolly rjolly force-pushed the scripting branch 2 times, most recently from 326090f to ace3584 Compare January 14, 2019 15:28
@Blaisorblade
Copy link
Contributor

@rjolly So, that looks cool!

As a follow-up: to also test what you asked, I asked @smarter. You can do that by creating an SBT project that depends on the compiler, and test it using sbt-scripted.
An existing such test is in sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/ — see in particular sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/build.sbt for our to load the compiler; commands to give to SBT appear in sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/test.

@Blaisorblade
Copy link
Contributor

@rjolly But I'd be already happy to merge this, honestly, if you can't get to that quickly. Let me know.

@rjolly rjolly force-pushed the scripting branch 2 times, most recently from 0de79e4 to 373f0e8 Compare January 15, 2019 10:31
@rjolly
Copy link
Contributor Author

rjolly commented Jan 15, 2019

@Blaisorblade The problem was with the classloader used by the new ScriptEngineManager() call. I fixed it. Then, by putting the test in run-with-compiler, everything works fine.
@smarter I removed the color. The best would be to switch off the output altogether but I do not know how to do that. I added some documentation.

@rjolly rjolly force-pushed the scripting branch 4 times, most recently from 5aedbf3 to 0cfc260 Compare January 16, 2019 10:20
@rjolly rjolly force-pushed the scripting branch 4 times, most recently from 48f70d4 to 2d14f14 Compare January 16, 2019 11:10
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

LGTM, any more comments @allanrenucci ?

@smarter smarter merged commit af9264d into scala:master Jan 25, 2019
@smarter smarter mentioned this pull request Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants