This page is no longer maintained — Please continue to the home page at www.scala-lang.org

scalac with print option in Eclipse

1 reply
guast
Joined: 2010-12-31,
User offline. Last seen 1 year 36 weeks ago.

Hi all

I have a project in Eclipse. I wanted to see the code being generated
and I added the -print option to the compiler, but the print output
didn't go to the console, it doesn't seem to be saved anywhere.

I tried to run the scalac command manually. But I can compile only
when a class is not importing classes or traits defined in
subdirectories. Even if I pack all the classes I generated with a
previous compilation to a jar file to add in the classpath and then I
specify all the subdirectories in the sourcepath the compilation
fails.

Any idea ?

V

guast
Joined: 2010-12-31,
User offline. Last seen 1 year 36 weeks ago.
Re: scalac with print option in Eclipse

I'll reply by myself in case someone has the same issue.
Scala compiler output goes on the standard output. I launched eclipse
from the console and I grabbed the output from the console.
Every generated class has on top the message:
// Scala source: ... .scala
So in the future I'll prepare a simple script to split the output in
different files

On Dec 27, 4:44 pm, guast wrote:
> Hi all
>
> I have a project in Eclipse.  I wanted to see the code being generated
> and I added the -print option to the compiler, but the print output
> didn't go to the console, it doesn't seem to be saved anywhere.
>
> I tried to run the scalac command manually. But I can compile only
> when a class is not importing classes or traits defined in
> subdirectories.  Even if I pack all the classes I generated with a
> previous compilation to a jar file to add in the classpath and then I
> specify all the subdirectories in the sourcepath the compilation
> fails.
>
> Any idea ?
>
> V

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland