How to get sbt to use scala-swing? (and a few other sbt questions)

568 views
Skip to first unread message

Ken

unread,
Mar 19, 2011, 4:44:57 PM3/19/11
to simple-b...@googlegroups.com
Feel free to point me to sbt docs for my questions--I just haven't been able to find the appropriate pages by searching, but there's a lot of sbt info out there, and I imagine the answers already exist.

I'm trying to build a simple Swing application (the LinePainting demo with slight modifications). My sbt config file is:


package com.digitaldoodles.context

import sbt._

class SBTConfig(info: ProjectInfo) extends DefaultProject(info) {
val scalaToolsSnapshots = ScalaToolsSnapshots
val scalaSwing = "org.scala-lang" % "scala-swing" % "2.8.1"
val scalatest = "org.scalatest" % "scalatest" % "1.3-SNAPSHOT"
}

sbt picks up changes I make to the config file, but doesn't seem to be doing anything about the scalaSwing declaration. I'll confess that don't really understand what sbt does with declarations like 'val scalaSwing'; I haven't found any explanations of how sbt translates that into paths used in the compile or run phases of an application. Feel free to recommend reading. (My background is more of a tech writer than a software engineer, and is quite lacking in the intricacies of build tools and such.)

When I try to do a 'compile' on my code, I get:

[info] == compile ==
[info]   Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling main sources...
[error] /Users/Ken/Documents/Programming/Scala/context/src/main/scala/Context.scala:6: value swing is not a member of package scala
[error] import scala.swing.event._
[error]              ^
[error] /Users/Ken/Documents/Programming/Scala/context/src/main/scala/Context.scala:42: value paintComponent is not a member of AnyRef
[error] super.paintComponent(g)
[error]      ^
[error] two errors found

which I'm interpreting as meaning that the dependency on scala-swing in the compile phase isn't being picked up.

I know Mark is doing a lot of work on documentation for sbt 0.9, and I'm really looking forward to that. Thanks for the help, everyone!

Ken McDonald

Ken McDonald

unread,
Mar 20, 2011, 3:49:43 PM3/20/11
to simple-build-tool
Oops, forgot about the need to "update". Problem solved.

Thanks,
Ken
Reply all
Reply to author
Forward
0 new messages