mirror of https://github.com/sbt/sbt.git
Add sbt-houserules, formatting
This commit is contained in:
parent
9a42d645e9
commit
dc814a5154
|
|
@ -372,8 +372,7 @@ class MakePom(val log: Logger) {
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>{ g }</groupId>
|
<groupId>{ g }</groupId>
|
||||||
<artifactId>{ a }</artifactId>
|
<artifactId>{ a }</artifactId>
|
||||||
</exclusion>
|
</exclusion>)
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def makeRepositories(settings: IvySettings, includeAll: Boolean, filterRepositories: MavenRepository => Boolean) =
|
def makeRepositories(settings: IvySettings, includeAll: Boolean, filterRepositories: MavenRepository => Boolean) =
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
package sbt.internal.librarymanagement
|
package sbt.internal.librarymanagement
|
||||||
package cross
|
package cross
|
||||||
|
|
||||||
object CrossVersionUtil
|
object CrossVersionUtil {
|
||||||
{
|
|
||||||
val trueString = "true"
|
val trueString = "true"
|
||||||
val falseString = "false"
|
val falseString = "false"
|
||||||
val fullString = "full"
|
val fullString = "full"
|
||||||
|
|
@ -17,7 +16,8 @@ object CrossVersionUtil
|
||||||
def isBinary(s: String): Boolean = (s == binaryString)
|
def isBinary(s: String): Boolean = (s == binaryString)
|
||||||
|
|
||||||
private[sbt] def isSbtApiCompatible(v: String): Boolean = sbtApiVersion(v).isDefined
|
private[sbt] def isSbtApiCompatible(v: String): Boolean = sbtApiVersion(v).isDefined
|
||||||
/** Returns sbt binary interface x.y API compatible with the given version string v.
|
/**
|
||||||
|
* Returns sbt binary interface x.y API compatible with the given version string v.
|
||||||
* RCs for x.y.0 are considered API compatible.
|
* RCs for x.y.0 are considered API compatible.
|
||||||
* Compatibile versions include 0.12.0-1 and 0.12.0-RC1 for Some(0, 12).
|
* Compatibile versions include 0.12.0-1 and 0.12.0-RC1 for Some(0, 12).
|
||||||
*/
|
*/
|
||||||
|
|
@ -34,7 +34,8 @@ object CrossVersionUtil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private[sbt] def isScalaApiCompatible(v: String): Boolean = scalaApiVersion(v).isDefined
|
private[sbt] def isScalaApiCompatible(v: String): Boolean = scalaApiVersion(v).isDefined
|
||||||
/** Returns Scala binary interface x.y API compatible with the given version string v.
|
/**
|
||||||
|
* Returns Scala binary interface x.y API compatible with the given version string v.
|
||||||
* Compatibile versions include 2.10.0-1 and 2.10.1-M1 for Some(2, 10), but not 2.10.0-RC1.
|
* Compatibile versions include 2.10.0-1 and 2.10.1-M1 for Some(2, 10), but not 2.10.0-RC1.
|
||||||
*/
|
*/
|
||||||
private[sbt] def scalaApiVersion(v: String): Option[(Int, Int)] =
|
private[sbt] def scalaApiVersion(v: String): Option[(Int, Int)] =
|
||||||
|
|
|
||||||
|
|
@ -139,8 +139,7 @@ private[sbt] case class SbtChainResolver(
|
||||||
else if (useLatest) temp map { x =>
|
else if (useLatest) temp map { x =>
|
||||||
(reparseModuleDescriptor(dd, data, resolver, x), resolver)
|
(reparseModuleDescriptor(dd, data, resolver, x), resolver)
|
||||||
}
|
}
|
||||||
else temp map { x => (forcedRevision(x), resolver) }
|
else temp map { x => (forcedRevision(x), resolver) })
|
||||||
)
|
|
||||||
} catch {
|
} catch {
|
||||||
case ex: Exception =>
|
case ex: Exception =>
|
||||||
Message.verbose("problem occurred while resolving " + dd + " with " + resolver
|
Message.verbose("problem occurred while resolving " + dd + " with " + resolver
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,7 @@ object ScalaArtifacts {
|
||||||
|
|
||||||
private[sbt] def toolDependencies(org: String, version: String): Seq[ModuleID] = Seq(
|
private[sbt] def toolDependencies(org: String, version: String): Seq[ModuleID] = Seq(
|
||||||
scalaToolDependency(org, ScalaArtifacts.CompilerID, version),
|
scalaToolDependency(org, ScalaArtifacts.CompilerID, version),
|
||||||
scalaToolDependency(org, ScalaArtifacts.LibraryID, version)
|
scalaToolDependency(org, ScalaArtifacts.LibraryID, version))
|
||||||
)
|
|
||||||
private[this] def scalaToolDependency(org: String, id: String, version: String): ModuleID =
|
private[this] def scalaToolDependency(org: String, id: String, version: String): ModuleID =
|
||||||
ModuleID(org, id, version, Some(Configurations.ScalaTool.name + "->default,optional(default)"))
|
ModuleID(org, id, version, Some(Configurations.ScalaTool.name + "->default,optional(default)"))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -248,16 +248,14 @@ object UpdateReport {
|
||||||
moduleReportMap { (configuration, modReport) =>
|
moduleReportMap { (configuration, modReport) =>
|
||||||
modReport.copy(
|
modReport.copy(
|
||||||
artifacts = modReport.artifacts filter { case (art, file) => f(configuration, modReport.module, art) },
|
artifacts = modReport.artifacts filter { case (art, file) => f(configuration, modReport.module, art) },
|
||||||
missingArtifacts = modReport.missingArtifacts filter { art => f(configuration, modReport.module, art) }
|
missingArtifacts = modReport.missingArtifacts filter { art => f(configuration, modReport.module, art) })
|
||||||
)
|
|
||||||
}
|
}
|
||||||
def substitute(f: (String, ModuleID, Seq[(Artifact, File)]) => Seq[(Artifact, File)]): UpdateReport =
|
def substitute(f: (String, ModuleID, Seq[(Artifact, File)]) => Seq[(Artifact, File)]): UpdateReport =
|
||||||
moduleReportMap { (configuration, modReport) =>
|
moduleReportMap { (configuration, modReport) =>
|
||||||
val newArtifacts = f(configuration, modReport.module, modReport.artifacts)
|
val newArtifacts = f(configuration, modReport.module, modReport.artifacts)
|
||||||
modReport.copy(
|
modReport.copy(
|
||||||
artifacts = f(configuration, modReport.module, modReport.artifacts),
|
artifacts = f(configuration, modReport.module, modReport.artifacts),
|
||||||
missingArtifacts = Nil
|
missingArtifacts = Nil)
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def toSeq: Seq[(String, ModuleID, Artifact, File)] =
|
def toSeq: Seq[(String, ModuleID, Artifact, File)] =
|
||||||
|
|
@ -269,8 +267,7 @@ object UpdateReport {
|
||||||
def addMissing(f: ModuleID => Seq[Artifact]): UpdateReport =
|
def addMissing(f: ModuleID => Seq[Artifact]): UpdateReport =
|
||||||
moduleReportMap { (configuration, modReport) =>
|
moduleReportMap { (configuration, modReport) =>
|
||||||
modReport.copy(
|
modReport.copy(
|
||||||
missingArtifacts = (modReport.missingArtifacts ++ f(modReport.module)).distinct
|
missingArtifacts = (modReport.missingArtifacts ++ f(modReport.module)).distinct)
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def moduleReportMap(f: (String, ModuleReport) => ModuleReport): UpdateReport =
|
def moduleReportMap(f: (String, ModuleReport) => ModuleReport): UpdateReport =
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.1.0")
|
||||||
Loading…
Reference in New Issue