scala - how to set main class in SBT 0.13 project -


could guys please explain me how set main class in sbt project ? i'm trying use version 0.13.

my directory structure simple (unlike sbt's documentation). in root folder have build.sbt following content

name := "sbt_test"  version := "1.0"  scalaversion := "2.10.1-local"  autoscalalibrary := false  scalahome := some(file("/program files (x86)/scala/"))  mainclass := some("hi")  librarydependencies ++= seq(     "org.scalatest" % "scalatest_2.10" % "2.0.m5b" % "test" )  eclipsekeys.withsource := true 

and have subfolder project single file hi.scala contains following code

object hi {   def main(args: array[string]) = println("hi!") } 

i'm able compile calling sbt compile sbt run returns

the system cannot find file c:\work\externals\sbt\bin\sbtconfig.txt. [info] loading project definition c:\work\test_projects\sbt_test\project [info] set current project sbt_test (in build file:/c:/work/test_projects/sbt_test/) java.lang.runtimeexception: no main class detected.         @ scala.sys.package$.error(package.scala:27) [trace] stack trace suppressed: run last compile:run full output. [error] (compile:run) no main class detected. [error] total time: 0 s, completed apr 8, 2013 6:14:41 pm 

ps.

i'm shocked after reading sbt's documentation , 15 similar questions on stackoverflow couldn't make sbt project run. it's basic functionality should brain-dead simple , clear in first 10 seconds of looking @ sbt's web-site.

ps2.

and i'd ask typesafe employees improve documentation of product instead of downvoting questions of people investing significant time in switching new platform.

you need put application's source in src/main/scala/, project/ build definition code.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -