Skip to content

Commit

Permalink
Enable building against locally compiled Scala version.
Browse files Browse the repository at this point in the history
This time we're abandoning build.sbt for good. Trying to make sense
of scopes, projects and configurations is hard enough when you're only
dealing with Build.scala.
  • Loading branch information
szeiger committed Nov 14, 2012
1 parent 32a65f7 commit f346209
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
12 changes: 0 additions & 12 deletions build.sbt

This file was deleted.

30 changes: 25 additions & 5 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,35 @@ object SlickBuild extends Build {
/* Custom Settings */
val repoKind = SettingKey[String]("repo-kind", "Maven repository kind (\"snapshots\" or \"releases\")")

val publishedScalaSettings = Seq(
scalaVersion := "2.10.0-RC2",
scalaBinaryVersion := "2.10.0-RC2",
//crossScalaVersions ++= "2.10.0-M4" :: Nil,
libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _),
libraryDependencies in config("macro") <+= scalaVersion("org.scala-lang" % "scala-compiler" % _)
)

val localScalaSettings: Seq[Setting[_]] = Seq(
scalaVersion := "2.10.0-unknown",
scalaBinaryVersion := "2.10.0-unknown",
crossVersion := CrossVersion.Disabled,
scalaHome := Some(file("C:/Users/szeiger/code/scala/build/pack")),
autoScalaLibrary := false,
unmanagedJars <<= scalaInstance.map( _.jars.classpath),
unmanagedJars in config("test") <<= scalaInstance.map( _.jars.classpath),
unmanagedJars in config("macro") <<= scalaInstance.map( _.jars.classpath)
)

val scalaSettings = publishedScalaSettings
//val scalaSettings = localScalaSettings

lazy val sharedSettings = Seq(
version := "0.11.2",
organizationName := "Typesafe",
organization := "com.typesafe",
resolvers += Resolver.sonatypeRepo("snapshots"),
scalacOptions ++= List("-deprecation", "-feature"),
libraryDependencies += "org.slf4j" % "slf4j-api" % "1.6.4",
// Add scala-compiler dependency for scala.reflect.internal
libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _),
logBuffered := false,
repoKind <<= (version)(v => if(v.trim.endsWith("SNAPSHOT")) "snapshots" else "releases"),
//publishTo <<= (repoKind)(r => Some(Resolver.file("test", file("c:/temp/repo/"+r)))),
Expand Down Expand Up @@ -53,7 +74,7 @@ object SlickBuild extends Build {
includeFilter in Sphinx := ("*.html" | "*.png" | "*.js" | "*.css" | "*.gif" | "*.txt"),
// Work around scaladoc problem
unmanagedClasspath in Compile += Attributed.blank(new java.io.File("doesnotexist"))
)
) ++ scalaSettings

/* Project Definitions */
lazy val aRootProject = Project(id = "root", base = file("."),
Expand All @@ -65,14 +86,13 @@ object SlickBuild extends Build {
testOnly <<= inputTask { argTask => (argTask) map { args => }}
)).aggregate(slickProject, slickTestkitProject)
lazy val slickProject = Project(id = "slick", base = file("."),
settings = Project.defaultSettings ++ sharedSettings ++ fmppSettings ++ site.settings ++ site.sphinxSupport() ++ inConfig(config("macro"))(Defaults.configSettings) ++ Seq(
settings = Project.defaultSettings ++ inConfig(config("macro"))(Defaults.configSettings) ++ sharedSettings ++ fmppSettings ++ site.settings ++ site.sphinxSupport() ++ Seq(
name := "Slick",
description := "Scala Language-Integrated Connection Kit",
scalacOptions in doc <++= (version).map(v => Seq("-doc-title", "Slick", "-doc-version", v)),
test := (),
testOnly <<= inputTask { argTask => (argTask) map { args => }},
ivyConfigurations += config("macro").hide.extend(Compile),
libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _ % "macro"),
unmanagedClasspath in Compile <++= fullClasspath in config("macro"),
mappings in (Compile, packageSrc) <++= mappings in (config("macro"), packageSrc),
mappings in (Compile, packageBin) <++= mappings in (config("macro"), packageBin)
Expand Down

0 comments on commit f346209

Please sign in to comment.