Skip to content

Instantly share code, notes, and snippets.

@pfn
Created February 24, 2012 05:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfn/1897936 to your computer and use it in GitHub Desktop.
Save pfn/1897936 to your computer and use it in GitHub Desktop.
multi-project build.scala
import sbt._
import sbt.Keys._
import AndroidKeys._
/*
* this represents a multi-project structure like:
* - root-project (wrapper/meta project)
* `- lite (android project)
* `- common (android library-project)
*
* This configuration allows calling sbt {package,package-debug,package-release}
* from the root project without having to "project lite" * and then calling
* sbt android:package{-release,-debug}
*
* There is no magic in the val name vs. project id vs. file name; they are
* all the same in this example due to laziness of picking a name.
*/
object MyProjectBuild extends Build {
// meta project
lazy val root = Project(id = "meta-project", base = file(".")) settings(
packageT in Compile <<= packageT in Android in lite,
packageRelease <<= packageRelease in Android in lite,
packageDebug <<= packageDebug in Android in lite
) aggregate(lite, common)
// android application project
lazy val lite = Project(id = "lite", base = file("lite")) settings(
compile in Compile <<= compile in Compile dependsOn(
packageT in Compile in common)
) dependsOn(common)
// android library project
lazy val common = Project(id = "common", base = file("common"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment