|
LocalScala
There are two ways to use sbt with Scala 2.8 (the trunk version of Scala). Both ways involve building sbt locally. The first way is easier and can be used if you want to work with nightly snapshots. The second way is required if you want to use a custom build of Scala. Scala Nightly BuildSetup
$ svn checkout http://simple-build-tool.googlecode.com/svn/trunk/ sbt scala-compiler-2.8.0-20090910.003346-219.jar Take the version and replace the last number (the build number) with a '+'. For example:2.8.0-20090910.003346-+This is the version to specify below. (The '+' is like a wildcard at the end of the version in Ivy. It is required because the build numbers for scala-library and scala-compiler do not match. You will notice that Ivy is slower to resolve when using '+'.)
private val version2_8_0 = "2.8.0-20090910.003346-+" private val buildConfigurations = conf_2_7_5 :: conf_2_8_0 :: Nil $ sbt > update > full-build Custom Scala BuildSetup
svn checkout http://simple-build-tool.googlecode.com/svn/trunk/ sbt private val version2_8_0 = "2.8.0-local" private val buildConfigurations = conf_2_7_5 :: conf_2_8_0 :: Nil $SCALA_HOME/project/build/ScalaJars.scala $SCALA_HOME/project/build/build.properties should contain:project.name=scala project.organization=org.scala-lang project.version=2.8.0-local.
$ sbt publish-local $ sbt > update > cross-publish-local New compilerFor a new compiler:
$ sbt publish-local $ sbt > clean-lib > update > cross-publish-local Project Definitionimport sbt._
class ScalaJars(info: ProjectInfo) extends ParentProject(info)
{ top =>
override def outputPath: Path = "build"
val library = project(".", "Scala Library", new SubProject(_))
val compiler = project(".", "Scala Compiler", new SubProject(_), library)
override def shouldCheckOutputDirectories = false
class SubProject(info: ProjectInfo) extends DefaultProject(info)
{
override def outputPath = top.outputPath / "pack" / "lib"
override def shouldCheckOutputDirectories = false
override def publishLocalConfiguration = new DefaultPublishConfiguration("local", "release", true) {
override def srcArtifactPatterns: Iterable[String] = List(outputPath / "[artifact].[ext]").map(_.relativePath)
}
}
}
|
Sign in to add a comment
$SBT_HOME/project/build/src/CrossCompileProject?.scala should be just $SBT_HOME/project/build/CrossCompileProject?.scala
Thanks! -Mark
I'm trying the first method, but it looks like the wrong pattern is being used to search the snapshot repository. How can I configure the correct pattern: http://scala-tools.org/repo-snapshots/[organization]/[module]/2.8.0-SNAPSHOT/[artifact]-[revision].[ext]
...
Make sure you using the 0.5.5 launcher. The ability to specify a specific snapshot was introduced in that version of the launcher. I've updated the page to mention that.
-Mark
When I try to do publish-local on a project built with a nightly Scala according to the first method above, sbt complains (in make-pom) that it can't find the scala-library:
error? Error running deliver-local: unresolved dependency: org.scala-lang#scala-library;2.8.0-20091013.004057-+: not found
if you use 2.8.0-SNAPSHOT it will work perfectly. No need to find the specific scala version.
Sure, until the underlying version you built sbt with is incompatible with the latest nightly. In any case, I think most people on 2.8 are using 0.6.x now, even though it is experimental.
-Mark