Created
February 24, 2012 05:13
-
-
Save pfn/1897936 to your computer and use it in GitHub Desktop.
multi-project build.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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