Simpler building for small projects?

66 views
Skip to first unread message

Mark Summerfield

unread,
Jan 13, 2017, 9:49:12 AM1/13/17
to scala-user
I've looked at sbt but it looks far more sophisticated than I need.

I want to build a small GUI project using Swing, ~10-20 .scala files, ~1-2KLOC, plus some .jar files e.g., sqlite-jdbc-3....jar, and maybe a few more.

Maybe a shell script would be enough to rebuild after changes?

I do all my development on Xubuntu, but eventually I'd also want to create a completely stand-alone executable (including everything in one file if possible) for Windows.

Is there a simpler alternative to sbt for this?

Thanks.

Donald McLean

unread,
Jan 13, 2017, 10:00:24 AM1/13/17
to scala-user
"Simpler" is a matter of experience and opinion.

It was simpler (for me) to use Ant. Especially since my project is part of a larger project that also uses Ant, so there are no special hoops for the configuration manager to jump through to build my app.

Cheer,

Donald

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Family photographs are a critical legacy for
ourselves and our descendants. Protect that
legacy with a digital backup and recovery plan.

Seth Tisue

unread,
Jan 13, 2017, 10:06:29 AM1/13/17
to scala-user
IMO you actually do want sbt for this. Yes, sbt is extremely powerful and flexible for large projects that need to do custom stuff, but you don't need to get into that; it also has defaults that handle small projects extremely well, with minimal configuration or fuss. Set scalaVersion, add a few libraryDependencies, done. `sbt run` to compile and run your code. For delivery, sbt-native-packager.

Oliver Ruebenacker

unread,
Jan 13, 2017, 10:30:00 AM1/13/17
to Mark Summerfield, scala-user

     Hello,

  If you have a few *.jar files you want to include, just put them in lib and SBT will include them. This is known as "unmanaged dependencies" because SBT does not manage them (e.g. SBT does not go and get them for you).

  You could also let SBT manage them by adding them to libraryDependencies (as Seth points out). That's what people usually do. For example, for sqlite-jdbc, Version 3.7.2, you would write into your *.sbt file:

libraryDependencies += "org.xerial" % "sqlite-jdbc" % "3.7.2"

     Best, Oliver

On Fri, Jan 13, 2017 at 4:46 AM, 'Mark Summerfield' via scala-user <scala...@googlegroups.com> wrote:

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Oliver Ruebenacker
Senior Software Engineer, Diabetes Portal, Broad Institute

Message has been deleted

Jeff Dyke

unread,
Jan 13, 2017, 7:19:14 PM1/13/17
to Nicholas Sterling, scala-user
as a relative scala newbie, when we/I (first company using scala, two of us chose it) first started, we did so with SBT and were up and running in minutes as others have pointed out, you will hit complications, but only when you need the advanced options of the tool.  I think its quoted in this thread, from a blog post, but to paraphrase learn how to use sbt, don't immediately try to master it.  A problem for another day, start writing, testing and deploying code today :)

Best,
Jeff

On Fri, Jan 13, 2017 at 4:57 PM, Nicholas Sterling <nicholas...@gmail.com> wrote:
Perhaps the docs make SBT looks too sophisticated, but you will be surprised at how straightforward the build.sbt file is for what you want to do, and you will be better off for having done it.  For example, you will be able to bring up a REPL with all of your build products on the classpath to try things out.  You can use plugins to do things like check for newer versions of the libraries that you depend on, or to show you the dependency tree for your libraries.

However, you should know that there is an alternative to SBT called CBT that you might find more straightforward.  The author gave this presentation on it a while back (I imagine the tool has progressed significantly since then):

Reply all
Reply to author
Forward
0 new messages