Created
June 5, 2012 14:05
-
-
Save tkmtmkt/2875217 to your computer and use it in GitHub Desktop.
sbtのディレクトリ構成をカスタマイズする設定を試してみた
This file contains 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 Keys._ | |
object TestBuild extends Build { | |
lazy val root: Project = Project("root", file("."), aggregate = nonRoots) | |
lazy val nonRoots = projects.filter(_ != root).map(p => LocalProject(p.id)) | |
lazy val sub1 = consoleProject("sub1", file("sub1")) | |
lazy val sub2 = webProject("sub2", file("sub2")) | |
def consoleProject(nameString: String, path: File) = Project(nameString, path) settings( | |
javacOptions in Compile := Seq("-encoding", "UTF-8", "-Xlint:unchecked"), | |
javaSource in Compile <<= sourceDirectory, | |
resourceDirectory in Compile <<= sourceDirectory, | |
includeFilter in unmanagedResources := "*.sql", | |
excludeFilter in unmanagedResources <<= (excludeFilter in unmanagedResources, includeFilter in unmanagedSources) { (excl, incl) => excl || incl } | |
) | |
def webProject(nameString: String, path: File) = Project(nameString, path) settings( | |
javacOptions in Compile := Seq("-encoding", "UTF-8", "-Xlint:unchecked"), | |
javaSource in Compile <<= sourceDirectory, | |
resourceDirectory in Compile <<= sourceDirectory, | |
includeFilter in unmanagedResources := "*.sql", | |
excludeFilter in unmanagedResources <<= (excludeFilter in unmanagedResources, includeFilter in unmanagedSources) { (excl, incl) => excl || incl }, | |
sourceDirectory <<= baseDirectory / "WEB-INF/src", | |
unmanagedBase <<= baseDirectory / "WEB-INF/lib", | |
libraryDependencies ++= Seq( | |
"javax.servlet" % "servlet-api" % "2.5", | |
"junit" % "junit" % "4.10" | |
) | |
) | |
} | |
// vim: set ts=4 sw=4 et: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment