mirror of https://github.com/sbt/sbt.git
drop some NotNulls from ivy/ plus some adjustments
This commit is contained in:
parent
c3f54347ef
commit
9090cd6218
|
|
@ -21,7 +21,7 @@ private object ConvertResolver
|
|||
initializeMavenStyle(resolver, repo.name, repo.root)
|
||||
resolver
|
||||
}
|
||||
case JavaNet1Repository =>
|
||||
case r: JavaNet1Repository =>
|
||||
{
|
||||
// Thanks to Matthias Pfau for posting how to use the Maven 1 repository on java.net with Ivy:
|
||||
// http://www.nabble.com/Using-gradle-Ivy-with-special-maven-repositories-td23775489.html
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import util.Message
|
|||
|
||||
import scala.xml.NodeSeq
|
||||
|
||||
final class IvySbt(configuration: IvyConfiguration)
|
||||
final class IvySbt(val configuration: IvyConfiguration)
|
||||
{
|
||||
import configuration.{log, baseDirectory}
|
||||
/** ========== Configuration/Setup ============
|
||||
|
|
@ -86,8 +86,9 @@ final class IvySbt(configuration: IvyConfiguration)
|
|||
finally { ivy.popContext() }
|
||||
}
|
||||
|
||||
final class Module(val moduleSettings: ModuleSettings) extends NotNull
|
||||
final class Module(val moduleSettings: ModuleSettings)
|
||||
{
|
||||
def owner = IvySbt.this
|
||||
def logger = configuration.log
|
||||
def withModule[T](f: (Ivy,DefaultModuleDescriptor,String) => T): T =
|
||||
withIvy[T] { ivy => f(ivy, moduleDescriptor, defaultConfig) }
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ package sbt
|
|||
import java.io.File
|
||||
import scala.xml.{Node, NodeSeq}
|
||||
|
||||
final class IvyPaths(val baseDirectory: File, val cacheDirectory: Option[File]) extends NotNull
|
||||
final class IvyPaths(val baseDirectory: File, val cacheDirectory: Option[File])
|
||||
{
|
||||
def withBase(newBaseDirectory: File) = new IvyPaths(newBaseDirectory, cacheDirectory)
|
||||
}
|
||||
sealed trait IvyConfiguration extends NotNull
|
||||
sealed trait IvyConfiguration
|
||||
{
|
||||
type This <: IvyConfiguration
|
||||
def lock: Option[xsbti.GlobalLock]
|
||||
|
|
@ -48,7 +48,7 @@ object IvyConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
sealed trait ModuleSettings extends NotNull
|
||||
sealed trait ModuleSettings
|
||||
{
|
||||
def validate: Boolean
|
||||
def ivyScala: Option[IvyScala]
|
||||
|
|
@ -62,11 +62,11 @@ final class PomConfiguration(val file: File, val ivyScala: Option[IvyScala], val
|
|||
{
|
||||
def noScala = new PomConfiguration(file, None, validate)
|
||||
}
|
||||
final class InlineConfiguration(val module: ModuleID, val dependencies: Iterable[ModuleID], val ivyXML: NodeSeq,
|
||||
val configurations: Iterable[Configuration], val defaultConfiguration: Option[Configuration], val ivyScala: Option[IvyScala],
|
||||
final class InlineConfiguration(val module: ModuleID, val dependencies: Seq[ModuleID], val ivyXML: NodeSeq,
|
||||
val configurations: Seq[Configuration], val defaultConfiguration: Option[Configuration], val ivyScala: Option[IvyScala],
|
||||
val validate: Boolean) extends ModuleSettings
|
||||
{
|
||||
def withConfigurations(configurations: Iterable[Configuration]) =
|
||||
def withConfigurations(configurations: Seq[Configuration]) =
|
||||
new InlineConfiguration(module, dependencies, ivyXML, configurations, defaultConfiguration, ivyScala, validate)
|
||||
def noScala = new InlineConfiguration(module, dependencies, ivyXML, configurations, defaultConfiguration, None, validate)
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ final class EmptyConfiguration(val module: ModuleID, val ivyScala: Option[IvySca
|
|||
}
|
||||
object InlineConfiguration
|
||||
{
|
||||
def apply(module: ModuleID, dependencies: Iterable[ModuleID]) =
|
||||
def apply(module: ModuleID, dependencies: Seq[ModuleID]) =
|
||||
new InlineConfiguration(module, dependencies, NodeSeq.Empty, Nil, None, None, false)
|
||||
def configurations(explicitConfigurations: Iterable[Configuration], defaultConfiguration: Option[Configuration]) =
|
||||
if(explicitConfigurations.isEmpty)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ object ModuleID
|
|||
for ( (key, value) <- attributes) yield
|
||||
if(key.startsWith("e:")) (key, value) else ("e:" + key, value)
|
||||
}
|
||||
sealed trait Resolver extends NotNull
|
||||
sealed trait Resolver
|
||||
{
|
||||
def name: String
|
||||
}
|
||||
|
|
@ -47,7 +47,7 @@ sealed case class MavenRepository(name: String, root: String) extends Resolver
|
|||
override def toString = name + ": " + root
|
||||
}
|
||||
|
||||
final class Patterns(val ivyPatterns: Seq[String], val artifactPatterns: Seq[String], val isMavenCompatible: Boolean) extends NotNull
|
||||
final class Patterns(val ivyPatterns: Seq[String], val artifactPatterns: Seq[String], val isMavenCompatible: Boolean)
|
||||
{
|
||||
private[sbt] def mavenStyle(): Patterns = Patterns(ivyPatterns, artifactPatterns, true)
|
||||
private[sbt] def withIvys(patterns: Seq[String]): Patterns = Patterns(patterns ++ ivyPatterns, artifactPatterns, isMavenCompatible)
|
||||
|
|
@ -61,12 +61,12 @@ object Patterns
|
|||
}
|
||||
object RepositoryHelpers
|
||||
{
|
||||
final case class SshConnection(authentication: Option[SshAuthentication], hostname: Option[String], port: Option[Int]) extends NotNull
|
||||
final case class SshConnection(authentication: Option[SshAuthentication], hostname: Option[String], port: Option[Int])
|
||||
{
|
||||
def copy(authentication: Option[SshAuthentication]) = SshConnection(authentication, hostname, port)
|
||||
}
|
||||
/** Configuration specific to an Ivy filesystem resolver. */
|
||||
final case class FileConfiguration(isLocal: Boolean, isTransactional: Option[Boolean]) extends NotNull
|
||||
final case class FileConfiguration(isLocal: Boolean, isTransactional: Option[Boolean])
|
||||
{
|
||||
def transactional() = FileConfiguration(isLocal, Some(true))
|
||||
def nontransactional() = FileConfiguration(isLocal, Some(false))
|
||||
|
|
@ -151,7 +151,8 @@ import Resolver._
|
|||
object ScalaToolsReleases extends MavenRepository(ScalaToolsReleasesName, ScalaToolsReleasesRoot)
|
||||
object ScalaToolsSnapshots extends MavenRepository(ScalaToolsSnapshotsName, ScalaToolsSnapshotsRoot)
|
||||
object DefaultMavenRepository extends MavenRepository("public", IBiblioResolver.DEFAULT_M2_ROOT)
|
||||
object JavaNet1Repository extends Resolver
|
||||
object JavaNet1Repository extends JavaNet1Repository
|
||||
sealed trait JavaNet1Repository extends Resolver
|
||||
{
|
||||
def name = "java.net Maven1 Repository"
|
||||
}
|
||||
|
|
@ -357,7 +358,7 @@ object Artifact
|
|||
Artifact(name, extract(name, defaultType), extract(name, defaultExtension), None, Nil, Some(file.toURI.toURL))
|
||||
}
|
||||
}
|
||||
final case class ModuleConfiguration(organization: String, name: String, revision: String, resolver: Resolver) extends NotNull
|
||||
final case class ModuleConfiguration(organization: String, name: String, revision: String, resolver: Resolver)
|
||||
object ModuleConfiguration
|
||||
{
|
||||
def apply(org: String, resolver: Resolver): ModuleConfiguration = apply(org, "*", "*", resolver)
|
||||
|
|
|
|||
Loading…
Reference in New Issue