Skip to content

Instantly share code, notes, and snippets.

@densh
Created October 24, 2018 14:44
Show Gist options
  • Save densh/3799ef55de1ff0d4cf138751a78e8049 to your computer and use it in GitHub Desktop.
Save densh/3799ef55de1ff0d4cf138751a78e8049 to your computer and use it in GitHub Desktop.
Spec Sharing
# cat src/main/scala/Hello.scala
object Foo {
val a: Int = a
val b: Boolean = b
val c: Char = c
val d: String = d
}
object Test extends App {
println(Foo.a)
println(Foo.b)
println(Foo.c.toInt)
println(Foo.d)
}
# cat build.sbt
scalaVersion := "2.11.12"
// Set to false or remove if you want to show stubs as linking errors
nativeLinkStubs := true
enablePlugins(ScalaNativePlugin)
# cat project/plugins.sbt
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.8")
# sbt run
[info] Loading project definition from /Users/denys/tmp/scala-native-seed-project/project
[info] Updating {file:/Users/denys/tmp/scala-native-seed-project/project/}scala-native-seed-project-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to scala-native-seed-project (in build file:/Users/denys/tmp/scala-native-seed-project/)
[info] Linking (910 ms)
[info] Discovered 806 classes and 4727 methods
[info] Optimizing (debug mode) (844 ms)
[info] Generating intermediate code (390 ms)
[info] Produced 39 files
[info] Compiling to native code (555 ms)
[info] Linking native code (immix gc) (83 ms)
0
false
0
null
[success] Total time: 4 s, completed Oct 24, 2018 4:43:54 PM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment