ErikR
ErikR

Reputation: 52039

scala sbt-launch.jar - multiple projects ihe same directory?

I'm sure this is simple, but I haven't figured it out yet...

I've installed sbt-launch.jar and a shell script to execute it (named sbt).

How do I put multiple projects in the same directory?

When I run sbt the directories project and target get created and populated, and the current project is default-XXXXX. The compile command picks up source files in the top-level directory and jar files in the top-level 'lib' directory.

How do I add another project under the same directory? Every time I run sbt in an empty directory it creates a 20+ MB project directory.

Note 1: when I run sbt I an not getting asked "Create new project?" or any other questions.

Note 2: I am using sbt-launch.jar from this url: http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/0.10.1/sbt-launch.jar

and I'm following the instructions at: http://code.google.com/p/simple-build-tool/wiki/Setup

Upvotes: 3

Views: 684

Answers (1)

ErikR
ErikR

Reputation: 52039

Found the answer (for sbt 0.10.1):

Create the file project/Build.scala that looks like this:

import sbt._
object MyBuild extends Build
{

  lazy val root = Project("root", file("."))
  lazy val sub1: Project = Project("proj1", file("dir1"));
  lazy val sub2 = Project("proj2", file("dir2"))
}

This creates three projects 'root' (in the top-level directory), 'proj1' (in the sub-directory 'dir1') and 'proj2' (in the sub-directory 'dir2')

For more info, see https://github.com/harrah/xsbt/wiki/Full-Configuration

Upvotes: 5

Related Questions