Skip to content

Commit

Permalink
Merge pull request #1 from Duhemm/setup-travis
Browse files Browse the repository at this point in the history
Setup travis, public tests in utilLogging
  • Loading branch information
eed3si9n committed Aug 31, 2015
2 parents ef7ff65 + b4e27ce commit 95b9239
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 29 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: scala
scala:
- 2.10.5
- 2.11.7
16 changes: 8 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ def commonSettings: Seq[Setting[_]] = Seq(
// concurrentRestrictions in Global += Util.testExclusiveRestriction,
testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"),
javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"),
incOptions := incOptions.value.withNameHashing(true)
// crossScalaVersions := Seq(scala210)
incOptions := incOptions.value.withNameHashing(true),
crossScalaVersions := Seq(scala210, scala211)
// bintrayPackage := (bintrayPackage in ThisBuild).value,
// bintrayRepository := (bintrayRepository in ThisBuild).value
)

// def testedBaseSettings: Seq[Setting[_]] =
// baseSettings ++ testDependencies
def testedBaseSettings: Seq[Setting[_]] = commonSettings
def testedBaseSettings: Seq[Setting[_]] =
commonSettings ++ testDependencies

lazy val utilRoot: Project = (project in file(".")).
// configs(Sxr.sxrConf).
Expand Down Expand Up @@ -101,7 +100,7 @@ lazy val utilComplete = (project in internalPath / "util-complete").
testedBaseSettings,
// Util.crossBuild,
name := "Util Completion",
libraryDependencies ++= Seq(jline, ioProj),
libraryDependencies ++= Seq(jline, sbtIO),
crossScalaVersions := Seq(scala210, scala211)
)

Expand All @@ -110,6 +109,7 @@ lazy val utilLogging = (project in internalPath / "util-logging").
dependsOn(utilInterface).
settings(
testedBaseSettings,
publishArtifact in (Test, packageBin) := true,
name := "Util Logging",
libraryDependencies += jline
)
Expand All @@ -135,7 +135,7 @@ lazy val utilCache = (project in internalPath / "util-cache").
settings(
commonSettings,
name := "Util Cache",
libraryDependencies ++= Seq(sbinary, sbtSerialization, scalaReflect.value, ioProj) ++ scalaXml.value
libraryDependencies ++= Seq(sbinary, sbtSerialization, scalaReflect.value, sbtIO) ++ scalaXml.value
)

// Builds on cache to provide caching for filesystem-related operations
Expand All @@ -144,5 +144,5 @@ lazy val utilTracking = (project in internalPath / "util-tracking").
settings(
commonSettings,
name := "Util Tracking",
libraryDependencies ++= Seq(ioProj)
libraryDependencies ++= Seq(sbtIO)
)
3 changes: 2 additions & 1 deletion internal/util-cache/src/main/scala/sbt/CacheIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package sbt
import java.io.{ File, FileNotFoundException }
import sbinary.{ DefaultProtocol, Format, Operations }
import scala.reflect.Manifest
import sbt.io.IO

object CacheIO {
def toBytes[T](format: Format[T])(value: T)(implicit mf: Manifest[Format[T]]): Array[Byte] =
Expand Down Expand Up @@ -41,4 +42,4 @@ object CacheIO {
def typeHash[T](implicit mf: Manifest[T]) = mf.toString.hashCode
def manifest[T](implicit mf: Manifest[T]): Manifest[T] = mf
def objManifest[T](t: T)(implicit mf: Manifest[T]): Manifest[T] = mf
}
}
3 changes: 2 additions & 1 deletion internal/util-cache/src/main/scala/sbt/FileInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import java.io.{ File, IOException }
import sbinary.{ DefaultProtocol, Format }
import DefaultProtocol._
import scala.reflect.Manifest
import sbt.io.Hash

sealed trait FileInfo extends NotNull {
val file: File
Expand Down Expand Up @@ -103,4 +104,4 @@ object FilesInfo {
implicit def hashInputsCache: InputCache[FilesInfo[HashFileInfo]] = hash.infosInputCache
implicit def modifiedInputsCache: InputCache[FilesInfo[ModifiedFileInfo]] = lastModified.infosInputCache
implicit def fullInputsCache: InputCache[FilesInfo[HashModifiedFileInfo]] = full.infosInputCache
}
}
3 changes: 2 additions & 1 deletion internal/util-cache/src/main/scala/sbt/SeparatedCache.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Types.:+:
import sbinary.{ DefaultProtocol, Format, Input, Output => Out }
import DefaultProtocol.ByteFormat
import java.io.{ File, InputStream, OutputStream }
import sbt.internal.io.Using

trait InputCache[I] {
type Internal
Expand Down Expand Up @@ -59,4 +60,4 @@ class BasicCache[I, O](implicit input: InputCache[I], outFormat: Format[O]) exte
outFormat.writes(stream, out)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sbt.complete

import java.io.File
import sbt.IO
import sbt.io.IO

/**
* These sources of examples are used in parsers for user input completion. An example of such a source is the
Expand Down Expand Up @@ -56,4 +56,4 @@ class FileExamples(base: File, prefix: String = "") extends ExampleSource {

private def dirStartsWithPrefix(relativizedPath: String): Boolean =
(relativizedPath startsWith prefix) || (prefix startsWith relativizedPath)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package sbt
package complete

import java.io.File
import sbt.io.IO

object HistoryCommands {
val Start = "!"
Expand Down Expand Up @@ -70,4 +71,4 @@ object HistoryCommands {

val actionParser: Parser[complete.History => Option[List[String]]] =
Start ~> (help | last | execInt | list | execStr) // execStr must come last
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package sbt.complete

import org.specs2.mutable.Specification
import org.specs2.specification.Scope
import sbt.IO.withTemporaryDirectory
import java.io.File
import sbt.IO._
import sbt.io.IO._

class FileExamplesTest extends Specification {

Expand Down
6 changes: 4 additions & 2 deletions internal/util-tracking/src/main/scala/sbt/Tracked.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import sbinary.Format
import scala.pickling.PicklingException
import scala.reflect.Manifest
import scala.collection.mutable
import IO.{ delete, read, write }
import sbt.io.IO.{ delete, read, write }
import sbt.io.{ IO, Path }
import sbt.internal.io.Using
import sbt.serialization._

object Tracked {
Expand Down Expand Up @@ -251,4 +253,4 @@ object FileFunction {
}
}
}
}
}
22 changes: 11 additions & 11 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ object Dependencies {
lazy val scala211 = "2.11.7"

val bootstrapSbtVersion = "0.13.8"
// lazy val interfaceProj = "org.scala-sbt" % "interface" % bootstrapSbtVersion
lazy val ioProj = "org.scala-sbt" % "io" % bootstrapSbtVersion
// lazy val collectionProj = "org.scala-sbt" % "collections" % bootstrapSbtVersion
// lazy val logProj = "org.scala-sbt" % "logging" % bootstrapSbtVersion
// lazy val crossProj = "org.scala-sbt" % "cross" % bootstrapSbtVersion

lazy val sbtIO = "org.scala-sbt" %% "io" % "1.0.0-M1"
lazy val jline = "jline" % "jline" % "2.11"
// lazy val launcherInterface = "org.scala-sbt" % "launcher-interface" % "1.0.0-M1"
// lazy val ivy = "org.scala-sbt.ivy" % "ivy" % "2.3.0-sbt-927bc9ded7f8fba63297cddd0d5a3d01d6ad5d8d"
// lazy val jsch = "com.jcraft" % "jsch" % "0.1.46" intransitive ()
lazy val sbtSerialization = "org.scala-sbt" %% "serialization" % "0.1.2"
lazy val sbinary = "org.scala-tools.sbinary" %% "sbinary" % "0.4.2"
// lazy val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.11.4"
// lazy val specs2 = "org.specs2" %% "specs2" % "2.3.11"
// lazy val junit = "junit" % "junit" % "4.11"

lazy val scalaCompiler = Def.setting { "org.scala-lang" % "scala-compiler" % scalaVersion.value }
lazy val scalaReflect = Def.setting { "org.scala-lang" % "scala-reflect" % scalaVersion.value }

private def scala211Module(name: String, moduleVersion: String) =
Def.setting {
scalaVersion.value match {
case sv if (sv startsWith "2.9.") || (sv startsWith "2.10.") => Nil
case _ => ("org.scala-lang.modules" %% name % moduleVersion) :: Nil
}
}

lazy val scalaXml = scala211Module("scala-xml", "1.0.1")

lazy val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.11.4"
lazy val specs2 = "org.specs2" %% "specs2" % "2.3.11"
lazy val testDependencies = libraryDependencies ++= Seq(
scalaCheck,
specs2
)
}

0 comments on commit 95b9239

Please sign in to comment.