mirror of https://github.com/sbt/sbt.git
Merge #1
This commit is contained in:
parent
7939e385c1
commit
277c754e36
|
|
@ -0,0 +1,4 @@
|
|||
language: scala
|
||||
scala:
|
||||
- 2.10.5
|
||||
- 2.11.7
|
||||
|
|
@ -7,11 +7,12 @@ def commonSettings: Seq[Setting[_]] = Seq(
|
|||
// publishArtifact in packageDoc := false,
|
||||
resolvers += Resolver.typesafeIvyRepo("releases"),
|
||||
resolvers += Resolver.sonatypeRepo("snapshots"),
|
||||
resolvers += Resolver.bintrayRepo("sbt", "maven-releases"),
|
||||
// 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)
|
||||
crossScalaVersions := Seq(scala210, scala211),
|
||||
// bintrayPackage := (bintrayPackage in ThisBuild).value,
|
||||
// bintrayRepository := (bintrayRepository in ThisBuild).value,
|
||||
resolvers += Resolver.sonatypeRepo("public")
|
||||
|
|
@ -47,7 +48,8 @@ lazy val root = (project in file(".")).
|
|||
lazy val lm = (project in file("librarymanagement")).
|
||||
settings(
|
||||
commonSettings,
|
||||
libraryDependencies ++= Seq(utilLogging, ioProj, utilCollection),
|
||||
libraryDependencies ++= Seq(ivy, jsch, sbtSerialization, scalaReflect.value, launcherInterface),
|
||||
libraryDependencies ++= Seq(utilLogging, utilLogging),
|
||||
libraryDependencies ++= Seq(sbtIO, utilCollection, ivy, jsch, sbtSerialization, scalaReflect.value, launcherInterface),
|
||||
resourceGenerators in Compile <+= (version, resourceManaged, streams, compile in Compile) map Util.generateVersionFile,
|
||||
name := "librarymanagement"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import org.apache.ivy.plugins.repository.file.{ FileRepository => FileRepo, File
|
|||
import java.io.{ IOException, File }
|
||||
import org.apache.ivy.util.{ FileUtil, ChecksumHelper }
|
||||
import org.apache.ivy.core.module.descriptor.{ Artifact => IArtifact }
|
||||
import sbt.io.IO
|
||||
|
||||
private[sbt] object ConvertResolver {
|
||||
import UpdateOptions.ResolverConverter
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ package sbt
|
|||
|
||||
import java.io.File
|
||||
import org.apache.ivy.util.url.CredentialsStore
|
||||
import sbt.io.IO
|
||||
|
||||
object Credentials {
|
||||
def apply(realm: String, host: String, userName: String, passwd: String): Credentials =
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import java.io.{ File, InputStream }
|
|||
import java.net.URL
|
||||
import java.util.regex.Pattern
|
||||
import sbt.mavenint.{ PomExtraDependencyAttributes, SbtPomExtraProperties }
|
||||
import sbt.io.Hash
|
||||
|
||||
@deprecated("We now use an Aether-based pom parser.", "0.13.8")
|
||||
final class CustomPomParser(delegate: ModuleDescriptorParser, transform: (ModuleDescriptorParser, ModuleDescriptor) => ModuleDescriptor) extends ModuleDescriptorParser {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package sbt
|
||||
|
||||
import sbt.io.{ AllPassFilter, NameFilter }
|
||||
|
||||
trait DependencyFilterExtra {
|
||||
def moduleFilter(organization: NameFilter = AllPassFilter, name: NameFilter = AllPassFilter, revision: NameFilter = AllPassFilter): ModuleFilter =
|
||||
new ModuleFilter {
|
||||
|
|
@ -57,4 +59,4 @@ trait ArtifactFilter extends SubDepFilter[Artifact, ArtifactFilter] {
|
|||
trait ConfigurationFilter extends SubDepFilter[String, ConfigurationFilter] {
|
||||
protected final def make(f: String => Boolean) = new ConfigurationFilter { def apply(m: String) = f(m) }
|
||||
final def apply(configuration: String, module: ModuleID, artifact: Artifact): Boolean = apply(configuration)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import org.apache.ivy.core.module.descriptor.{ Artifact => IArtifact, MDArtifact
|
|||
import org.apache.ivy.core.report.ResolveReport
|
||||
import org.apache.ivy.core.resolve.ResolveOptions
|
||||
import org.apache.ivy.plugins.resolver.{ BasicResolver, DependencyResolver }
|
||||
import sbt.io.{ IO, PathFinder }
|
||||
|
||||
final class DeliverConfiguration(val deliverIvyPattern: String, val status: String, val configurations: Option[Seq[Configuration]], val logging: UpdateLogging.Value)
|
||||
final class PublishConfiguration(val ivyFile: Option[File], val resolverName: String, val artifacts: Map[Artifact, File], val checksums: Seq[String], val logging: UpdateLogging.Value,
|
||||
|
|
@ -304,7 +305,7 @@ object IvyActions {
|
|||
case None => None
|
||||
case Some(configs) => Some(configs.map(_.name))
|
||||
}
|
||||
val existingFiles = PathFinder(base).***.get filterNot { _.isDirectory }
|
||||
val existingFiles = PathFinder(base).allPaths.get filterNot { _.isDirectory }
|
||||
val toCopy = new collection.mutable.HashSet[(File, File)]
|
||||
val retReport = report retrieve { (conf, mid, art, cached) =>
|
||||
configurationNames match {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import org.apache.ivy.plugins.repository.file.{ FileRepository => IvyFileReposit
|
|||
import org.apache.ivy.plugins.repository.{ ArtifactResourceResolver, Resource, ResourceDownloader }
|
||||
import org.apache.ivy.plugins.resolver.util.ResolvedResource
|
||||
import org.apache.ivy.util.FileUtil
|
||||
import sbt.io.Path
|
||||
|
||||
class NotInCache(val id: ModuleID, cause: Throwable)
|
||||
extends RuntimeException(NotInCache(id, cause), cause) {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ private[sbt] object JsonUtil {
|
|||
}
|
||||
def writeUpdateReport(ur: UpdateReport, graphPath: File): Unit =
|
||||
{
|
||||
IO.createDirectory(graphPath.getParentFile)
|
||||
sbt.io.IO.createDirectory(graphPath.getParentFile)
|
||||
toJsonFile(toLite(ur), graphPath)
|
||||
}
|
||||
def toLite(ur: UpdateReport): UpdateReportLite =
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ object LogicalClock {
|
|||
def apply(hashCode: Int): LogicalClock = {
|
||||
def intToByteArray(x: Int): Array[Byte] =
|
||||
Array((x >>> 24).toByte, (x >> 16 & 0xff).toByte, (x >> 8 & 0xff).toByte, (x & 0xff).toByte)
|
||||
apply(Hash.toHex(intToByteArray(hashCode)))
|
||||
apply(sbt.io.Hash.toHex(intToByteArray(hashCode)))
|
||||
}
|
||||
def apply(x: String): LogicalClock = new LogicalClock {
|
||||
override def toString: String = x
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import org.apache.ivy.core.settings.IvySettings
|
|||
import org.apache.ivy.core.module.descriptor.{ DependencyArtifactDescriptor, DependencyDescriptor, License, ModuleDescriptor, ExcludeRule }
|
||||
import org.apache.ivy.plugins.resolver.{ ChainResolver, DependencyResolver, IBiblioResolver }
|
||||
import ivyint.CustomRemoteMavenResolver
|
||||
import sbt.io.IO
|
||||
object MakePom {
|
||||
/** True if the revision is an ivy-range, not a complete revision. */
|
||||
def isDependencyVersionRange(revision: String): Boolean = {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import core.module.id.ModuleRevisionId
|
|||
import core.module.descriptor.ModuleDescriptor
|
||||
import ResolutionCache.{ Name, ReportDirectory, ResolvedName, ResolvedPattern }
|
||||
import parser.xml.XmlModuleDescriptorParser
|
||||
import sbt.io.IO
|
||||
|
||||
/**
|
||||
* Replaces the standard Ivy resolution cache in order to:
|
||||
|
|
|
|||
|
|
@ -345,9 +345,9 @@ object Resolver {
|
|||
case _: IOException => None
|
||||
case e: SAXParseException => System.err.println(s"WARNING: Problem parsing ${f().getAbsolutePath}, ${e.getMessage}"); None
|
||||
}
|
||||
loadHomeFromSettings(() => new File(Path.userHome, ".m2/settings.xml")) orElse
|
||||
loadHomeFromSettings(() => new File(sbt.io.Path.userHome, ".m2/settings.xml")) orElse
|
||||
loadHomeFromSettings(() => new File(new File(System.getenv("M2_HOME")), "conf/settings.xml")) getOrElse
|
||||
new File(Path.userHome, ".m2/repository")
|
||||
new File(sbt.io.Path.userHome, ".m2/repository")
|
||||
}
|
||||
// TODO - should this just be the *exact* same as mavenLocal? probably...
|
||||
def publishMavenLocal: MavenCache = new MavenCache("publish-m2-local", mavenLocalDir)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import org.apache.ivy.plugins.matcher.{ MapMatcher, PatternMatcher }
|
|||
import Configurations.{ System => _, _ }
|
||||
import annotation.tailrec
|
||||
import scala.concurrent.duration._
|
||||
import sbt.io.{ DirectoryFilter, Hash, IO, Path }
|
||||
|
||||
private[sbt] object CachedResolutionResolveCache {
|
||||
def createID(organization: String, name: String, revision: String) =
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package sbt
|
||||
|
||||
import Path._, Configurations._
|
||||
import sbt.io.Path._, Configurations._
|
||||
import sbt.io.IO
|
||||
import java.io.File
|
||||
import org.specs2._
|
||||
import cross.CrossVersionUtil
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ import java.io.File
|
|||
import java.util.concurrent.Callable
|
||||
import org.specs2._
|
||||
import mutable.Specification
|
||||
import IO.{ createDirectory, delete, touch, withTemporaryDirectory }
|
||||
import sbt.io.IO.{ createDirectory, delete, touch, withTemporaryDirectory }
|
||||
import sbt.io.IO
|
||||
import org.apache.ivy.util.ChecksumHelper
|
||||
import IfMissing.Fail
|
||||
import xsbti.ComponentProvider
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import org.apache.ivy.core.module.id.ModuleRevisionId
|
|||
import org.apache.ivy.core.resolve.ResolveOptions
|
||||
import org.specs2.mutable.Specification
|
||||
import sbt._
|
||||
import IO.withTemporaryDirectory
|
||||
import sbt.io.IO.withTemporaryDirectory
|
||||
|
||||
object CustomPomParserTest extends Specification {
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,12 @@ import sbt._
|
|||
import Keys._
|
||||
|
||||
object Dependencies {
|
||||
lazy val scala210 = "2.10.5"
|
||||
lazy val scala211 = "2.11.7"
|
||||
|
||||
val utilVersion = "0.1.0-M1"
|
||||
val ioVersion = "1.0.0-M1"
|
||||
lazy val ioProj = "org.scala-sbt" %% "io" % ioVersion
|
||||
lazy val sbtIO = "org.scala-sbt" %% "io" % ioVersion
|
||||
lazy val utilCollection = "org.scala-sbt" %% "util-collection" % utilVersion
|
||||
lazy val utilLogging = "org.scala-sbt" %% "util-logging" % utilVersion
|
||||
|
||||
|
|
@ -12,10 +15,5 @@ object Dependencies {
|
|||
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 }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
import sbt._
|
||||
import Keys._
|
||||
import sbt.IO
|
||||
|
||||
import java.io.File
|
||||
|
||||
|
||||
object Util {
|
||||
|
||||
def versionLine(version: String): String = "version=" + version
|
||||
def containsVersion(propFile: File, version: String): Boolean = IO.read(propFile).contains(versionLine(version))
|
||||
def lastCompilationTime(analysis: sbt.inc.Analysis): Long =
|
||||
{
|
||||
val lastCompilation = analysis.compilations.allCompilations.lastOption
|
||||
lastCompilation.map(_.startTime) getOrElse 0L
|
||||
}
|
||||
|
||||
def generateVersionFile(version: String, dir: File, s: TaskStreams, analysis: sbt.inc.Analysis): Seq[File] =
|
||||
{
|
||||
import java.util.{ Date, TimeZone }
|
||||
val formatter = new java.text.SimpleDateFormat("yyyyMMdd'T'HHmmss")
|
||||
formatter.setTimeZone(TimeZone.getTimeZone("GMT"))
|
||||
val timestamp = formatter.format(new Date)
|
||||
val content = versionLine(version) + "\ntimestamp=" + timestamp
|
||||
val f = dir / "xsbt.version.properties"
|
||||
if (!f.exists || f.lastModified < lastCompilationTime(analysis) || !containsVersion(f, version)) {
|
||||
s.log.info("Writing version information to " + f + " :\n" + content)
|
||||
IO.write(f, content)
|
||||
}
|
||||
f :: Nil
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue