scala-native / scala-native

Your favorite language gets closer to bare metal.
http://scala-native.org
Other
4.49k stars 364 forks source link

"NoSuchElementException: None.get" when there is no main method #301

Closed mkotsbak closed 8 years ago

mkotsbak commented 8 years ago

In previous versions of Scala Native, I successfully created a wrapper library without a main method, but now it fails with:

java.util.NoSuchElementException: None.get
        at scala.None$.get(Option.scala:313)
        at scala.None$.get(Option.scala:311)
        at scala.scalanative.sbtplugin.ScalaNativePluginInternal$$anonfun$projectSettings$10.apply(ScalaNativePluginInternal.scala:112)
        at scala.scalanative.sbtplugin.ScalaNativePluginInternal$$anonfun$projectSettings$10.apply(ScalaNativePluginInternal.scala:111)

.get should not be used here, but instead handle this case with an error message. But it should also be supported to be able to create libraries?

mkotsbak commented 8 years ago

Actually I'm still able to run "sbt package", but there should be an error message for "run".

Regarding the last question, I see there is a "nativeSharedLibrary" option, but I don't think I want to create a shared library for just a thin wrapper for another shared library?

mkotsbak commented 8 years ago

This seems to be solved in commit 88fdd446e54a297d48752c2ea99097bcff0fe886.