Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Generalize support for scalac settings #83

Closed
dragos opened this Issue Jan 20, 2012 · 8 comments

Comments

Projects
None yet
2 participants
Contributor

dragos commented Jan 20, 2012

I exported a project (xsbt) and the project file settings have a broken entry:

#Generated by sbteclipse
#Fri Jan 20 15:44:15 CET 2012
Xelide-below=true
0=true
scala.compiler.useProjectSettings=true

Xelide-below takes an int value. The second line also looks wrong (0 = true).

Contributor

hseeberger commented Jan 20, 2012

Thanks for reporting. Would you please let us know the exact version of sbt and sbteclipse?

Contributor

dragos commented Jan 20, 2012

Sorry, of course: sbteclipse 2.0.0-M3 and Sbt 0.11.2

Contributor

hseeberger commented Jan 25, 2012

Do you remember when I called the scalac settings a can of worms? Now look at the output of scalac or scalac -X. There are just too many ways to define a setting: Some are key and value, others just an option. Some use a colon as separator, some a blank ...

In this particular case the scalac setting -Xelide-below 0 is given as Seq("-Xelide-below", "0") which is treated by sbteclipse as two settings. I don't think this could ever be handled properly by sbteclipse. Unfortunately even Seq("-Xelide-below 0") does not work, because sticking to the simple rule that only a colon is used as separator (like suggested by someone on another issue) leads to interpreting the whole string including the blank as one option, not a key and a value.

Any ideas?

Contributor

hseeberger commented Jan 25, 2012

I applied a simple fix allowing for either a colon or a blank to be used as separator. Please test in anger.

Contributor

dragos commented Jan 25, 2012

Thanks Heiko!

I agree with you now that scalac settings are hard to handle, and there's no way to treat them generically if you only see the sequence of tokens.

Contributor

hseeberger commented Jan 25, 2012

Could you please check out the latest snapshot version and try to make it work using Seq("-Xelide-below 0") instead of Seq("-Xelide-below", "0")?

@hseeberger hseeberger reopened this Jan 25, 2012

Contributor

hseeberger commented Jan 25, 2012

Unfortunately Seq("-Xelide-below 0") does not work for sbt (compiler interface does not like it)!

Contributor

hseeberger commented Jan 26, 2012

Looks like I have found a way to close the can of worms again, i.e. handle the scalac settings ;-)

A setting always starts with a dash and is either

  • a simple setting (without value)
  • a setting with a value that is separated by a colon
  • a setting with a value that is separated by a whitespace

Additionally one must know that in sbt the latter are given as two entries in the sequence of scalac settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment