mirror of https://github.com/sbt/sbt.git
Merge pull request #216 from dwijnand/sans-copy
Replace abstract protected[this] copy with abstract withX methods
This commit is contained in:
commit
67d97fed25
52
build.sbt
52
build.sbt
|
|
@ -1,6 +1,6 @@
|
|||
import Dependencies._
|
||||
import Path._
|
||||
//import com.typesafe.tools.mima.core._, ProblemFilters._
|
||||
import com.typesafe.tools.mima.core._, ProblemFilters._
|
||||
|
||||
def commonSettings: Seq[Setting[_]] = Seq(
|
||||
scalaVersion := scala212,
|
||||
|
|
@ -35,15 +35,6 @@ val mimaSettings = Def settings (
|
|||
organization.value %% moduleName.value % version
|
||||
cross (if (crossPaths.value) CrossVersion.binary else CrossVersion.disabled)
|
||||
),
|
||||
mimaBinaryIssueFilters ++= {
|
||||
import com.typesafe.tools.mima.core._
|
||||
import com.typesafe.tools.mima.core.ProblemFilters._
|
||||
Seq(
|
||||
exclude[DirectMissingMethodProblem]("sbt.internal.librarymanagement.ivyint.GigahorseUrlHandler#SbtUrlInfo.this"),
|
||||
exclude[IncompatibleMethTypeProblem]("sbt.internal.librarymanagement.ivyint.GigahorseUrlHandler#SbtUrlInfo.this"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.internal.librarymanagement.ivyint.GigahorseUrlHandler.checkStatusCode")
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
lazy val lmRoot = (project in file("."))
|
||||
|
|
@ -114,6 +105,42 @@ lazy val lmCore = (project in file("core"))
|
|||
(((srcs --- sdirs --- base) pair (relativeTo(sdirs) | relativeTo(base) | flat)) toSeq)
|
||||
},
|
||||
mimaSettings,
|
||||
mimaBinaryIssueFilters ++= Seq(
|
||||
// internal class moved
|
||||
exclude[MissingClassProblem]("sbt.internal.librarymanagement.InlineConfigurationFunctions"),
|
||||
// dropped internal class parent (InlineConfigurationFunctions)
|
||||
exclude[MissingTypesProblem]("sbt.librarymanagement.ModuleDescriptorConfiguration$"),
|
||||
|
||||
// Configuration's copy method was never meant to be public
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.Configuration.copy"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.Configuration.copy$default$*"),
|
||||
|
||||
// the data type copy methods were never meant to be public
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactExtra.copy"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactExtra.copy$default$*"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ModuleReportExtra.copy"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ModuleReportExtra.copy$default$*"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactTypeFilterExtra.copy"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactTypeFilterExtra.copy$default$*"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ModuleIDExtra.copy"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ModuleIDExtra.copy$default$*"),
|
||||
|
||||
// these abstract classes are private[librarymanagement] so it's fine if they have more methods
|
||||
exclude[ReversedMissingMethodProblem]("sbt.librarymanagement.ArtifactExtra.*"),
|
||||
exclude[ReversedMissingMethodProblem]("sbt.librarymanagement.ModuleReportExtra.*"),
|
||||
exclude[ReversedMissingMethodProblem]("sbt.librarymanagement.ArtifactTypeFilterExtra.*"),
|
||||
exclude[ReversedMissingMethodProblem]("sbt.librarymanagement.ModuleIDExtra.*"),
|
||||
|
||||
// these abstract classes are private[librarymanagement] so they can lose these abstract methods
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactExtra.type"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactExtra.url"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactExtra.checksum"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactExtra.name"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactExtra.configurations"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactExtra.classifier"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactExtra.extension"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.librarymanagement.ArtifactTypeFilterExtra.types"),
|
||||
),
|
||||
)
|
||||
.configure(addSbtIO, addSbtUtilLogging, addSbtUtilPosition, addSbtUtilCache)
|
||||
|
||||
|
|
@ -131,6 +158,11 @@ lazy val lmIvy = (project in file("ivy"))
|
|||
scalacOptions in (Compile, console) --=
|
||||
Vector("-Ywarn-unused-import", "-Ywarn-unused", "-Xlint"),
|
||||
mimaSettings,
|
||||
mimaBinaryIssueFilters ++= Seq(
|
||||
exclude[DirectMissingMethodProblem]("sbt.internal.librarymanagement.ivyint.GigahorseUrlHandler#SbtUrlInfo.this"),
|
||||
exclude[IncompatibleMethTypeProblem]("sbt.internal.librarymanagement.ivyint.GigahorseUrlHandler#SbtUrlInfo.this"),
|
||||
exclude[DirectMissingMethodProblem]("sbt.internal.librarymanagement.ivyint.GigahorseUrlHandler.checkStatusCode"),
|
||||
),
|
||||
)
|
||||
|
||||
def customCommands: Seq[Setting[_]] = Seq(
|
||||
|
|
|
|||
|
|
@ -56,6 +56,6 @@ final class Artifact private (
|
|||
}
|
||||
object Artifact extends sbt.librarymanagement.ArtifactFunctions {
|
||||
|
||||
def apply(name: String): Artifact = new Artifact(name, Artifact.DefaultType, Artifact.DefaultExtension, None, Vector.empty, None, Map.empty, None)
|
||||
def apply(name: String): Artifact = new Artifact(name)
|
||||
def apply(name: String, `type`: String, extension: String, classifier: Option[String], configurations: Vector[sbt.librarymanagement.ConfigRef], url: Option[java.net.URL], extraAttributes: Map[String, String], checksum: Option[sbt.librarymanagement.Checksum]): Artifact = new Artifact(name, `type`, extension, classifier, configurations, url, extraAttributes, checksum)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,6 @@ final class Binary private (
|
|||
}
|
||||
object Binary {
|
||||
|
||||
def apply(): Binary = new Binary("", "")
|
||||
def apply(): Binary = new Binary()
|
||||
def apply(prefix: String, suffix: String): Binary = new Binary(prefix, suffix)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ final class ConflictManager private (
|
|||
}
|
||||
object ConflictManager extends sbt.librarymanagement.ConflictManagerFunctions {
|
||||
|
||||
def apply(name: String): ConflictManager = new ConflictManager(name, "*", "*")
|
||||
def apply(name: String): ConflictManager = new ConflictManager(name)
|
||||
def apply(name: String, organization: String, module: String): ConflictManager = new ConflictManager(name, organization, module)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,6 @@ final class Constant private (
|
|||
}
|
||||
object Constant {
|
||||
|
||||
def apply(): Constant = new Constant("")
|
||||
def apply(): Constant = new Constant()
|
||||
def apply(value: String): Constant = new Constant(value)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,6 @@ final class Full private (
|
|||
}
|
||||
object Full {
|
||||
|
||||
def apply(): Full = new Full("", "")
|
||||
def apply(): Full = new Full()
|
||||
def apply(prefix: String, suffix: String): Full = new Full(prefix, suffix)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,6 @@ final class InclExclRule private (
|
|||
}
|
||||
object InclExclRule extends sbt.librarymanagement.InclExclRuleFunctions {
|
||||
|
||||
def apply(): InclExclRule = new InclExclRule("*", "*", "*", Vector.empty, sbt.librarymanagement.Disabled())
|
||||
def apply(): InclExclRule = new InclExclRule()
|
||||
def apply(organization: String, name: String, artifact: String, configurations: Vector[sbt.librarymanagement.ConfigRef], crossVersion: sbt.librarymanagement.CrossVersion): InclExclRule = new InclExclRule(organization, name, artifact, configurations, crossVersion)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ final class IvyFileConfiguration private (
|
|||
}
|
||||
object IvyFileConfiguration {
|
||||
|
||||
def apply(file: java.io.File, autoScalaTools: Boolean): IvyFileConfiguration = new IvyFileConfiguration(false, None, file, autoScalaTools)
|
||||
def apply(file: java.io.File, autoScalaTools: Boolean): IvyFileConfiguration = new IvyFileConfiguration(file, autoScalaTools)
|
||||
def apply(validate: Boolean, scalaModuleInfo: Option[sbt.librarymanagement.ScalaModuleInfo], file: java.io.File, autoScalaTools: Boolean): IvyFileConfiguration = new IvyFileConfiguration(validate, scalaModuleInfo, file, autoScalaTools)
|
||||
def apply(validate: Boolean, scalaModuleInfo: sbt.librarymanagement.ScalaModuleInfo, file: java.io.File, autoScalaTools: Boolean): IvyFileConfiguration = new IvyFileConfiguration(validate, Option(scalaModuleInfo), file, autoScalaTools)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,73 @@
|
|||
/**
|
||||
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.librarymanagement
|
||||
final class MakePomConfiguration private (
|
||||
val file: Option[java.io.File],
|
||||
val moduleInfo: Option[sbt.librarymanagement.ModuleInfo],
|
||||
val configurations: Option[scala.Vector[sbt.librarymanagement.Configuration]],
|
||||
val extra: Option[scala.xml.NodeSeq],
|
||||
val process: scala.Function1[scala.xml.Node, scala.xml.Node],
|
||||
val filterRepositories: scala.Function1[sbt.librarymanagement.MavenRepository, Boolean],
|
||||
val allRepositories: Boolean,
|
||||
val includeTypes: Set[String]) extends Serializable {
|
||||
|
||||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: MakePomConfiguration => (this.file == x.file) && (this.moduleInfo == x.moduleInfo) && (this.configurations == x.configurations) && (this.extra == x.extra) && (this.process == x.process) && (this.filterRepositories == x.filterRepositories) && (this.allRepositories == x.allRepositories) && (this.includeTypes == x.includeTypes)
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
37 * (37 * (37 * (37 * (37 * (37 * (37 * (37 * (37 * (17 + "sbt.librarymanagement.MakePomConfiguration".##) + file.##) + moduleInfo.##) + configurations.##) + extra.##) + process.##) + filterRepositories.##) + allRepositories.##) + includeTypes.##)
|
||||
}
|
||||
override def toString: String = {
|
||||
"MakePomConfiguration(" + file + ", " + moduleInfo + ", " + configurations + ", " + extra + ", " + process + ", " + filterRepositories + ", " + allRepositories + ", " + includeTypes + ")"
|
||||
}
|
||||
protected[this] def copy(file: Option[java.io.File] = file, moduleInfo: Option[sbt.librarymanagement.ModuleInfo] = moduleInfo, configurations: Option[scala.Vector[sbt.librarymanagement.Configuration]] = configurations, extra: Option[scala.xml.NodeSeq] = extra, process: scala.Function1[scala.xml.Node, scala.xml.Node] = process, filterRepositories: scala.Function1[sbt.librarymanagement.MavenRepository, Boolean] = filterRepositories, allRepositories: Boolean = allRepositories, includeTypes: Set[String] = includeTypes): MakePomConfiguration = {
|
||||
new MakePomConfiguration(file, moduleInfo, configurations, extra, process, filterRepositories, allRepositories, includeTypes)
|
||||
}
|
||||
def withFile(file: Option[java.io.File]): MakePomConfiguration = {
|
||||
copy(file = file)
|
||||
}
|
||||
def withFile(file: java.io.File): MakePomConfiguration = {
|
||||
copy(file = Option(file))
|
||||
}
|
||||
def withModuleInfo(moduleInfo: Option[sbt.librarymanagement.ModuleInfo]): MakePomConfiguration = {
|
||||
copy(moduleInfo = moduleInfo)
|
||||
}
|
||||
def withModuleInfo(moduleInfo: sbt.librarymanagement.ModuleInfo): MakePomConfiguration = {
|
||||
copy(moduleInfo = Option(moduleInfo))
|
||||
}
|
||||
def withConfigurations(configurations: Option[scala.Vector[sbt.librarymanagement.Configuration]]): MakePomConfiguration = {
|
||||
copy(configurations = configurations)
|
||||
}
|
||||
def withConfigurations(configurations: scala.Vector[sbt.librarymanagement.Configuration]): MakePomConfiguration = {
|
||||
copy(configurations = Option(configurations))
|
||||
}
|
||||
def withExtra(extra: Option[scala.xml.NodeSeq]): MakePomConfiguration = {
|
||||
copy(extra = extra)
|
||||
}
|
||||
def withExtra(extra: scala.xml.NodeSeq): MakePomConfiguration = {
|
||||
copy(extra = Option(extra))
|
||||
}
|
||||
def withProcess(process: scala.Function1[scala.xml.Node, scala.xml.Node]): MakePomConfiguration = {
|
||||
copy(process = process)
|
||||
}
|
||||
def withFilterRepositories(filterRepositories: scala.Function1[sbt.librarymanagement.MavenRepository, Boolean]): MakePomConfiguration = {
|
||||
copy(filterRepositories = filterRepositories)
|
||||
}
|
||||
def withAllRepositories(allRepositories: Boolean): MakePomConfiguration = {
|
||||
copy(allRepositories = allRepositories)
|
||||
}
|
||||
def withIncludeTypes(includeTypes: Set[String]): MakePomConfiguration = {
|
||||
copy(includeTypes = includeTypes)
|
||||
}
|
||||
}
|
||||
object MakePomConfiguration extends sbt.librarymanagement.MakePomConfigurationFunctions {
|
||||
|
||||
def apply(file: Option[java.io.File], moduleInfo: Option[sbt.librarymanagement.ModuleInfo], configurations: Option[scala.Vector[sbt.librarymanagement.Configuration]], extra: Option[scala.xml.NodeSeq], process: scala.Function1[scala.xml.Node, scala.xml.Node], filterRepositories: scala.Function1[sbt.librarymanagement.MavenRepository, Boolean], allRepositories: Boolean, includeTypes: Set[String]): MakePomConfiguration = new MakePomConfiguration(file, moduleInfo, configurations, extra, process, filterRepositories, allRepositories, includeTypes)
|
||||
def apply(file: java.io.File, moduleInfo: sbt.librarymanagement.ModuleInfo, configurations: scala.Vector[sbt.librarymanagement.Configuration], extra: scala.xml.NodeSeq, process: scala.Function1[scala.xml.Node, scala.xml.Node], filterRepositories: scala.Function1[sbt.librarymanagement.MavenRepository, Boolean], allRepositories: Boolean, includeTypes: Set[String]): MakePomConfiguration = new MakePomConfiguration(Option(file), Option(moduleInfo), Option(configurations), Option(extra), process, filterRepositories, allRepositories, includeTypes)
|
||||
}
|
||||
|
|
@ -45,6 +45,6 @@ final class MavenCache private (
|
|||
}
|
||||
object MavenCache {
|
||||
def apply(name: String, rootFile: java.io.File): MavenCache = new MavenCache(name, rootFile)
|
||||
def apply(name: String, root: String, rootFile: java.io.File): MavenCache = new MavenCache(name, root, true, rootFile)
|
||||
def apply(name: String, root: String, rootFile: java.io.File): MavenCache = new MavenCache(name, root, rootFile)
|
||||
def apply(name: String, root: String, localIfFile: Boolean, rootFile: java.io.File): MavenCache = new MavenCache(name, root, localIfFile, rootFile)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ final class MavenRepo private (
|
|||
}
|
||||
object MavenRepo {
|
||||
|
||||
def apply(name: String, root: String): MavenRepo = new MavenRepo(name, root, true)
|
||||
def apply(name: String, root: String): MavenRepo = new MavenRepo(name, root)
|
||||
def apply(name: String, root: String, localIfFile: Boolean): MavenRepo = new MavenRepo(name, root, localIfFile)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@ final class ModuleDescriptorConfiguration private (
|
|||
copy(conflictManager = conflictManager)
|
||||
}
|
||||
}
|
||||
object ModuleDescriptorConfiguration extends sbt.internal.librarymanagement.InlineConfigurationFunctions {
|
||||
object ModuleDescriptorConfiguration extends sbt.librarymanagement.InlineConfigurationFunctions {
|
||||
|
||||
def apply(module: sbt.librarymanagement.ModuleID, moduleInfo: sbt.librarymanagement.ModuleInfo): ModuleDescriptorConfiguration = new ModuleDescriptorConfiguration(false, None, module, moduleInfo, Vector.empty, Vector.empty, Vector.empty, scala.xml.NodeSeq.Empty, sbt.librarymanagement.Configurations.default, Option(sbt.librarymanagement.Configurations.Compile), sbt.librarymanagement.ConflictManager.default)
|
||||
def apply(module: sbt.librarymanagement.ModuleID, moduleInfo: sbt.librarymanagement.ModuleInfo): ModuleDescriptorConfiguration = new ModuleDescriptorConfiguration(module, moduleInfo)
|
||||
def apply(validate: Boolean, scalaModuleInfo: Option[sbt.librarymanagement.ScalaModuleInfo], module: sbt.librarymanagement.ModuleID, moduleInfo: sbt.librarymanagement.ModuleInfo, dependencies: Vector[sbt.librarymanagement.ModuleID], overrides: Vector[sbt.librarymanagement.ModuleID], excludes: Vector[sbt.librarymanagement.InclExclRule], ivyXML: scala.xml.NodeSeq, configurations: Vector[sbt.librarymanagement.Configuration], defaultConfiguration: Option[sbt.librarymanagement.Configuration], conflictManager: sbt.librarymanagement.ConflictManager): ModuleDescriptorConfiguration = new ModuleDescriptorConfiguration(validate, scalaModuleInfo, module, moduleInfo, dependencies, overrides, excludes, ivyXML, configurations, defaultConfiguration, conflictManager)
|
||||
def apply(validate: Boolean, scalaModuleInfo: sbt.librarymanagement.ScalaModuleInfo, module: sbt.librarymanagement.ModuleID, moduleInfo: sbt.librarymanagement.ModuleInfo, dependencies: Vector[sbt.librarymanagement.ModuleID], overrides: Vector[sbt.librarymanagement.ModuleID], excludes: Vector[sbt.librarymanagement.InclExclRule], ivyXML: scala.xml.NodeSeq, configurations: Vector[sbt.librarymanagement.Configuration], defaultConfiguration: sbt.librarymanagement.Configuration, conflictManager: sbt.librarymanagement.ConflictManager): ModuleDescriptorConfiguration = new ModuleDescriptorConfiguration(validate, Option(scalaModuleInfo), module, moduleInfo, dependencies, overrides, excludes, ivyXML, configurations, Option(defaultConfiguration), conflictManager)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,6 @@ final class ModuleID private (
|
|||
}
|
||||
object ModuleID extends sbt.librarymanagement.ModuleIDFunctions {
|
||||
|
||||
def apply(organization: String, name: String, revision: String): ModuleID = new ModuleID(organization, name, revision, None, false, true, false, Vector.empty, Vector.empty, Vector.empty, Map.empty, sbt.librarymanagement.Disabled(), None)
|
||||
def apply(organization: String, name: String, revision: String): ModuleID = new ModuleID(organization, name, revision)
|
||||
def apply(organization: String, name: String, revision: String, configurations: Option[String], isChanging: Boolean, isTransitive: Boolean, isForce: Boolean, explicitArtifacts: Vector[sbt.librarymanagement.Artifact], inclusions: Vector[sbt.librarymanagement.InclExclRule], exclusions: Vector[sbt.librarymanagement.InclExclRule], extraAttributes: Map[String, String], crossVersion: sbt.librarymanagement.CrossVersion, branchName: Option[String]): ModuleID = new ModuleID(organization, name, revision, configurations, isChanging, isTransitive, isForce, explicitArtifacts, inclusions, exclusions, extraAttributes, crossVersion, branchName)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,6 @@ final class ModuleInfo private (
|
|||
}
|
||||
object ModuleInfo {
|
||||
|
||||
def apply(nameFormal: String): ModuleInfo = new ModuleInfo(nameFormal, "", None, None, Vector.empty, "", None, None, Vector.empty)
|
||||
def apply(nameFormal: String): ModuleInfo = new ModuleInfo(nameFormal)
|
||||
def apply(nameFormal: String, description: String, homepage: Option[java.net.URL], startYear: Option[Int], licenses: Vector[scala.Tuple2[String, java.net.URL]], organizationName: String, organizationHomepage: Option[java.net.URL], scmInfo: Option[sbt.librarymanagement.ScmInfo], developers: Vector[sbt.librarymanagement.Developer]): ModuleInfo = new ModuleInfo(nameFormal, description, homepage, startYear, licenses, organizationName, organizationHomepage, scmInfo, developers)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,6 @@ final class ModuleReport private (
|
|||
}
|
||||
object ModuleReport {
|
||||
|
||||
def apply(module: sbt.librarymanagement.ModuleID, artifacts: Vector[scala.Tuple2[sbt.librarymanagement.Artifact, java.io.File]], missingArtifacts: Vector[sbt.librarymanagement.Artifact]): ModuleReport = new ModuleReport(module, artifacts, missingArtifacts, None, None, None, None, false, None, None, None, None, Map.empty, None, None, Vector.empty, Vector.empty, Vector.empty)
|
||||
def apply(module: sbt.librarymanagement.ModuleID, artifacts: Vector[scala.Tuple2[sbt.librarymanagement.Artifact, java.io.File]], missingArtifacts: Vector[sbt.librarymanagement.Artifact]): ModuleReport = new ModuleReport(module, artifacts, missingArtifacts)
|
||||
def apply(module: sbt.librarymanagement.ModuleID, artifacts: Vector[scala.Tuple2[sbt.librarymanagement.Artifact, java.io.File]], missingArtifacts: Vector[sbt.librarymanagement.Artifact], status: Option[String], publicationDate: Option[java.util.Calendar], resolver: Option[String], artifactResolver: Option[String], evicted: Boolean, evictedData: Option[String], evictedReason: Option[String], problem: Option[String], homepage: Option[String], extraAttributes: Map[String, String], isDefault: Option[Boolean], branch: Option[String], configurations: Vector[sbt.librarymanagement.ConfigRef], licenses: Vector[scala.Tuple2[String, Option[String]]], callers: Vector[sbt.librarymanagement.Caller]): ModuleReport = new ModuleReport(module, artifacts, missingArtifacts, status, publicationDate, resolver, artifactResolver, evicted, evictedData, evictedReason, problem, homepage, extraAttributes, isDefault, branch, configurations, licenses, callers)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,6 @@ final class Patterns private (
|
|||
}
|
||||
object Patterns extends sbt.librarymanagement.PatternsFunctions {
|
||||
|
||||
def apply(): Patterns = new Patterns(Vector.empty, Vector.empty, true, false, false)
|
||||
def apply(): Patterns = new Patterns()
|
||||
def apply(ivyPatterns: Vector[String], artifactPatterns: Vector[String], isMavenCompatible: Boolean, descriptorOptional: Boolean, skipConsistencyCheck: Boolean): Patterns = new Patterns(ivyPatterns, artifactPatterns, isMavenCompatible, descriptorOptional, skipConsistencyCheck)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ final class PomConfiguration private (
|
|||
}
|
||||
object PomConfiguration {
|
||||
|
||||
def apply(file: java.io.File, autoScalaTools: Boolean): PomConfiguration = new PomConfiguration(false, None, file, autoScalaTools)
|
||||
def apply(file: java.io.File, autoScalaTools: Boolean): PomConfiguration = new PomConfiguration(file, autoScalaTools)
|
||||
def apply(validate: Boolean, scalaModuleInfo: Option[sbt.librarymanagement.ScalaModuleInfo], file: java.io.File, autoScalaTools: Boolean): PomConfiguration = new PomConfiguration(validate, scalaModuleInfo, file, autoScalaTools)
|
||||
def apply(validate: Boolean, scalaModuleInfo: sbt.librarymanagement.ScalaModuleInfo, file: java.io.File, autoScalaTools: Boolean): PomConfiguration = new PomConfiguration(validate, Option(scalaModuleInfo), file, autoScalaTools)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ final class PublishConfiguration private (
|
|||
}
|
||||
object PublishConfiguration {
|
||||
|
||||
def apply(): PublishConfiguration = new PublishConfiguration(true, None, None, None, None, Vector(), Vector("sha1", "md5"), None, false)
|
||||
def apply(): PublishConfiguration = new PublishConfiguration()
|
||||
def apply(publishMavenStyle: Boolean, deliverIvyPattern: Option[String], status: Option[String], configurations: Option[scala.Vector[sbt.librarymanagement.ConfigRef]], resolverName: Option[String], artifacts: Vector[scala.Tuple2[sbt.librarymanagement.Artifact, java.io.File]], checksums: scala.Vector[String], logging: Option[sbt.librarymanagement.UpdateLogging], overwrite: Boolean): PublishConfiguration = new PublishConfiguration(publishMavenStyle, deliverIvyPattern, status, configurations, resolverName, artifacts, checksums, logging, overwrite)
|
||||
def apply(publishMavenStyle: Boolean, deliverIvyPattern: String, status: String, configurations: scala.Vector[sbt.librarymanagement.ConfigRef], resolverName: String, artifacts: Vector[scala.Tuple2[sbt.librarymanagement.Artifact, java.io.File]], checksums: scala.Vector[String], logging: sbt.librarymanagement.UpdateLogging, overwrite: Boolean): PublishConfiguration = new PublishConfiguration(publishMavenStyle, Option(deliverIvyPattern), Option(status), Option(configurations), Option(resolverName), artifacts, checksums, Option(logging), overwrite)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ final class RetrieveConfiguration private (
|
|||
}
|
||||
object RetrieveConfiguration {
|
||||
|
||||
def apply(): RetrieveConfiguration = new RetrieveConfiguration(None, None, false, None)
|
||||
def apply(retrieveDirectory: Option[java.io.File], outputPattern: Option[String]): RetrieveConfiguration = new RetrieveConfiguration(retrieveDirectory, outputPattern, false, None)
|
||||
def apply(retrieveDirectory: java.io.File, outputPattern: String): RetrieveConfiguration = new RetrieveConfiguration(Option(retrieveDirectory), Option(outputPattern), false, None)
|
||||
def apply(): RetrieveConfiguration = new RetrieveConfiguration()
|
||||
def apply(retrieveDirectory: Option[java.io.File], outputPattern: Option[String]): RetrieveConfiguration = new RetrieveConfiguration(retrieveDirectory, outputPattern)
|
||||
def apply(retrieveDirectory: java.io.File, outputPattern: String): RetrieveConfiguration = new RetrieveConfiguration(Option(retrieveDirectory), Option(outputPattern))
|
||||
def apply(retrieveDirectory: Option[java.io.File], outputPattern: Option[String], sync: Boolean, configurationsToRetrieve: Option[scala.Vector[sbt.librarymanagement.ConfigRef]]): RetrieveConfiguration = new RetrieveConfiguration(retrieveDirectory, outputPattern, sync, configurationsToRetrieve)
|
||||
def apply(retrieveDirectory: java.io.File, outputPattern: String, sync: Boolean, configurationsToRetrieve: scala.Vector[sbt.librarymanagement.ConfigRef]): RetrieveConfiguration = new RetrieveConfiguration(Option(retrieveDirectory), Option(outputPattern), sync, Option(configurationsToRetrieve))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,6 @@ final class ScalaModuleInfo private (
|
|||
}
|
||||
object ScalaModuleInfo {
|
||||
|
||||
def apply(scalaFullVersion: String, scalaBinaryVersion: String, configurations: Vector[sbt.librarymanagement.Configuration], checkExplicit: Boolean, filterImplicit: Boolean, overrideScalaVersion: Boolean): ScalaModuleInfo = new ScalaModuleInfo(scalaFullVersion, scalaBinaryVersion, configurations, checkExplicit, filterImplicit, overrideScalaVersion, sbt.librarymanagement.ScalaArtifacts.Organization, sbt.librarymanagement.ScalaArtifacts.Artifacts)
|
||||
def apply(scalaFullVersion: String, scalaBinaryVersion: String, configurations: Vector[sbt.librarymanagement.Configuration], checkExplicit: Boolean, filterImplicit: Boolean, overrideScalaVersion: Boolean): ScalaModuleInfo = new ScalaModuleInfo(scalaFullVersion, scalaBinaryVersion, configurations, checkExplicit, filterImplicit, overrideScalaVersion)
|
||||
def apply(scalaFullVersion: String, scalaBinaryVersion: String, configurations: Vector[sbt.librarymanagement.Configuration], checkExplicit: Boolean, filterImplicit: Boolean, overrideScalaVersion: Boolean, scalaOrganization: String, scalaArtifacts: scala.Vector[String]): ScalaModuleInfo = new ScalaModuleInfo(scalaFullVersion, scalaBinaryVersion, configurations, checkExplicit, filterImplicit, overrideScalaVersion, scalaOrganization, scalaArtifacts)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ final class ScmInfo private (
|
|||
}
|
||||
object ScmInfo {
|
||||
|
||||
def apply(browseUrl: java.net.URL, connection: String): ScmInfo = new ScmInfo(browseUrl, connection, None)
|
||||
def apply(browseUrl: java.net.URL, connection: String): ScmInfo = new ScmInfo(browseUrl, connection)
|
||||
def apply(browseUrl: java.net.URL, connection: String, devConnection: Option[String]): ScmInfo = new ScmInfo(browseUrl, connection, devConnection)
|
||||
def apply(browseUrl: java.net.URL, connection: String, devConnection: String): ScmInfo = new ScmInfo(browseUrl, connection, Option(devConnection))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ final class UpdateConfiguration private (
|
|||
}
|
||||
object UpdateConfiguration {
|
||||
|
||||
def apply(): UpdateConfiguration = new UpdateConfiguration(None, false, sbt.librarymanagement.UpdateLogging.Default, sbt.librarymanagement.LogicalClock.unknown, None, None, false, false)
|
||||
def apply(): UpdateConfiguration = new UpdateConfiguration()
|
||||
def apply(retrieveManaged: Option[sbt.librarymanagement.RetrieveConfiguration], missingOk: Boolean, logging: sbt.librarymanagement.UpdateLogging, logicalClock: sbt.librarymanagement.LogicalClock, metadataDirectory: Option[java.io.File], artifactFilter: Option[sbt.librarymanagement.ArtifactTypeFilter], offline: Boolean, frozen: Boolean): UpdateConfiguration = new UpdateConfiguration(retrieveManaged, missingOk, logging, logicalClock, metadataDirectory, artifactFilter, offline, frozen)
|
||||
def apply(retrieveManaged: sbt.librarymanagement.RetrieveConfiguration, missingOk: Boolean, logging: sbt.librarymanagement.UpdateLogging, logicalClock: sbt.librarymanagement.LogicalClock, metadataDirectory: java.io.File, artifactFilter: sbt.librarymanagement.ArtifactTypeFilter, offline: Boolean, frozen: Boolean): UpdateConfiguration = new UpdateConfiguration(Option(retrieveManaged), missingOk, logging, logicalClock, Option(metadataDirectory), Option(artifactFilter), offline, frozen)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -572,7 +572,7 @@
|
|||
},
|
||||
{ "name": "conflictManager", "type": "sbt.librarymanagement.ConflictManager", "default": "sbt.librarymanagement.ConflictManager.default", "since": "0.0.1" }
|
||||
],
|
||||
"parentsCompanion": "sbt.internal.librarymanagement.InlineConfigurationFunctions"
|
||||
"parentsCompanion": "sbt.librarymanagement.InlineConfigurationFunctions"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"types": [
|
||||
{
|
||||
"name": "MakePomConfiguration",
|
||||
"namespace": "sbt.librarymanagement",
|
||||
"target": "Scala",
|
||||
"type": "record",
|
||||
"generateCodec": false,
|
||||
"fields": [
|
||||
{ "name": "file", "type": "java.io.File?" },
|
||||
{ "name": "moduleInfo", "type": "sbt.librarymanagement.ModuleInfo?" },
|
||||
{ "name": "configurations", "type": "scala.Vector[sbt.librarymanagement.Configuration]?" },
|
||||
{ "name": "extra", "type": "scala.xml.NodeSeq?" },
|
||||
{ "name": "process", "type": "scala.Function1[scala.xml.Node, scala.xml.Node]" },
|
||||
{ "name": "filterRepositories", "type": "scala.Function1[sbt.librarymanagement.MavenRepository, Boolean]" },
|
||||
{ "name": "allRepositories", "type": "boolean" },
|
||||
{ "name": "includeTypes", "type": "Set[String]" }
|
||||
],
|
||||
"parentsCompanion": "sbt.librarymanagement.MakePomConfigurationFunctions"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
/* sbt -- Simple Build Tool
|
||||
* Copyright 2008, 2009, 2010 Mark Harrah
|
||||
*/
|
||||
package sbt.internal.librarymanagement
|
||||
package sbt.librarymanagement
|
||||
|
||||
import sbt.librarymanagement._
|
||||
|
||||
abstract class InlineConfigurationFunctions {
|
||||
private[librarymanagement] abstract class InlineConfigurationFunctions {
|
||||
def configurations(
|
||||
explicitConfigurations: Iterable[Configuration],
|
||||
defaultConfiguration: Option[Configuration]
|
||||
|
|
|
|||
|
|
@ -6,34 +6,18 @@ package sbt.librarymanagement
|
|||
import java.io.File
|
||||
import java.net.URL
|
||||
|
||||
abstract class ArtifactExtra {
|
||||
def name: String
|
||||
def `type`: String
|
||||
def extension: String
|
||||
def classifier: Option[String]
|
||||
def configurations: Vector[ConfigRef]
|
||||
def url: Option[URL]
|
||||
private[librarymanagement] abstract class ArtifactExtra {
|
||||
def extraAttributes: Map[String, String]
|
||||
def checksum: Option[Checksum]
|
||||
|
||||
protected[this] def copy(
|
||||
name: String = name,
|
||||
`type`: String = `type`,
|
||||
extension: String = extension,
|
||||
classifier: Option[String] = classifier,
|
||||
configurations: Vector[ConfigRef] = configurations,
|
||||
url: Option[URL] = url,
|
||||
extraAttributes: Map[String, String] = extraAttributes,
|
||||
checksum: Option[Checksum] = checksum
|
||||
): Artifact
|
||||
def withExtraAttributes(extraAttributes: Map[String, String]): Artifact
|
||||
|
||||
def extra(attributes: (String, String)*) =
|
||||
copy(extraAttributes = extraAttributes ++ ModuleID.checkE(attributes))
|
||||
withExtraAttributes(extraAttributes ++ ModuleID.checkE(attributes))
|
||||
}
|
||||
|
||||
import Configurations.{ Optional, Pom, Test }
|
||||
|
||||
abstract class ArtifactFunctions {
|
||||
private[librarymanagement] abstract class ArtifactFunctions {
|
||||
def apply(name: String, extra: Map[String, String]): Artifact =
|
||||
Artifact(name, DefaultType, DefaultExtension, None, Vector.empty, None, extra, None)
|
||||
def apply(name: String, classifier: String): Artifact =
|
||||
|
|
|
|||
|
|
@ -7,20 +7,17 @@ final class Configuration private[sbt] (
|
|||
val name: String,
|
||||
val description: String,
|
||||
val isPublic: Boolean,
|
||||
val extendsConfigs: Vector[sbt.librarymanagement.Configuration],
|
||||
val transitive: Boolean)
|
||||
extends sbt.librarymanagement.ConfigurationExtra
|
||||
val extendsConfigs: Vector[Configuration],
|
||||
val transitive: Boolean
|
||||
) extends ConfigurationExtra
|
||||
with Serializable {
|
||||
|
||||
require(name != null, "name cannot be null")
|
||||
require(name.size > 0, "name cannot be empty")
|
||||
require(name.nonEmpty, "name cannot be empty")
|
||||
require(id != null, "id cannot be null")
|
||||
require(id.size > 0, "id cannot be empty")
|
||||
require(id.nonEmpty, "id cannot be empty")
|
||||
require(id.head.isUpper, s"id must be capitalized: $id")
|
||||
|
||||
private def this(id: String, name: String) =
|
||||
this(id, name, "", true, Vector.empty, true)
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: Configuration =>
|
||||
(this.id == x.id) &&
|
||||
|
|
@ -31,50 +28,64 @@ final class Configuration private[sbt] (
|
|||
(this.transitive == x.transitive)
|
||||
case _ => false
|
||||
}
|
||||
override val hashCode: Int = {
|
||||
37 * (37 * (37 * (37 * (37 * (37 * (17 + id.##) + name.##) + description.##) + isPublic.##) + extendsConfigs.##) + transitive.##)
|
||||
}
|
||||
override def toString: String = {
|
||||
name
|
||||
}
|
||||
protected[this] def copy(id: String = id,
|
||||
name: String = name,
|
||||
description: String = description,
|
||||
isPublic: Boolean = isPublic,
|
||||
extendsConfigs: Vector[sbt.librarymanagement.Configuration] =
|
||||
extendsConfigs,
|
||||
transitive: Boolean = transitive): Configuration = {
|
||||
|
||||
override val hashCode: Int =
|
||||
37 * (37 * (37 * (37 * (37 * (37 * (17 +
|
||||
id.##) + name.##) + description.##) + isPublic.##) + extendsConfigs.##) + transitive.##)
|
||||
|
||||
override def toString: String = name
|
||||
|
||||
private[this] def copy(
|
||||
id: String = id,
|
||||
name: String = name,
|
||||
description: String = description,
|
||||
isPublic: Boolean = isPublic,
|
||||
extendsConfigs: Vector[Configuration] = extendsConfigs,
|
||||
transitive: Boolean = transitive
|
||||
): Configuration =
|
||||
new Configuration(id, name, description, isPublic, extendsConfigs, transitive)
|
||||
}
|
||||
|
||||
def withDescription(description: String): Configuration = {
|
||||
copy(description = description)
|
||||
}
|
||||
def withDescription(description: String): Configuration = copy(description = description)
|
||||
|
||||
def withIsPublic(isPublic: Boolean): Configuration = {
|
||||
copy(isPublic = isPublic)
|
||||
}
|
||||
def withIsPublic(isPublic: Boolean): Configuration = copy(isPublic = isPublic)
|
||||
|
||||
def withExtendsConfigs(
|
||||
extendsConfigs: Vector[sbt.librarymanagement.Configuration]): Configuration = {
|
||||
def withExtendsConfigs(extendsConfigs: Vector[Configuration]): Configuration =
|
||||
copy(extendsConfigs = extendsConfigs)
|
||||
}
|
||||
|
||||
def withTransitive(transitive: Boolean): Configuration = {
|
||||
def withTransitive(transitive: Boolean): Configuration =
|
||||
copy(transitive = transitive)
|
||||
}
|
||||
|
||||
def toConfigRef: ConfigRef = ConfigRef(name)
|
||||
}
|
||||
|
||||
object Configuration {
|
||||
// Don't call this directly. It's intended to be used from config macro.
|
||||
def of(id: String, name: String): Configuration =
|
||||
new Configuration(id, name, "", true, Vector.empty, true)
|
||||
def of(id: String,
|
||||
name: String,
|
||||
description: String,
|
||||
isPublic: Boolean,
|
||||
extendsConfigs: Vector[sbt.librarymanagement.Configuration],
|
||||
transitive: Boolean): Configuration =
|
||||
|
||||
def of(
|
||||
id: String,
|
||||
name: String,
|
||||
description: String,
|
||||
isPublic: Boolean,
|
||||
extendsConfigs: Vector[Configuration],
|
||||
transitive: Boolean
|
||||
): Configuration =
|
||||
new Configuration(id, name, description, isPublic, extendsConfigs, transitive)
|
||||
}
|
||||
|
||||
/*
|
||||
Configuration isn't defined with Contraband.
|
||||
|
||||
The reasons that block it from being made a Contraband type (AFAIK):
|
||||
* its hashCode is a val, not a def
|
||||
* it doesn't have companion apply methods, but "of" instead
|
||||
|
||||
Other reasons that I don't think are blocking:
|
||||
* it's constructor is private[sbt] (doesn't matter, Configuration.of is public)
|
||||
|
||||
Reasons that are definitely not blocking:
|
||||
* it has a custom toString, supported by Contraband
|
||||
* it has init requirements, supported by Contraband via parent class
|
||||
* it has other methods, supported by Contraband via parent class
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ object Configurations {
|
|||
}
|
||||
}
|
||||
|
||||
abstract class ConfigurationExtra {
|
||||
private[librarymanagement] abstract class ConfigurationExtra {
|
||||
def id: String
|
||||
def name: String
|
||||
def description: String
|
||||
|
|
@ -142,7 +142,7 @@ private[sbt] object ConfigurationMacro {
|
|||
.map(_.tree.asInstanceOf[c.Tree])
|
||||
}
|
||||
|
||||
abstract class ConfigRefFunctions {
|
||||
private[librarymanagement] abstract class ConfigRefFunctions {
|
||||
implicit def configToConfigRef(c: Configuration): ConfigRef =
|
||||
c.toConfigRef
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import sbt.librarymanagement.syntax._
|
|||
|
||||
final case class ScalaVersion(full: String, binary: String)
|
||||
|
||||
abstract class CrossVersionFunctions {
|
||||
private[librarymanagement] abstract class CrossVersionFunctions {
|
||||
|
||||
/** Compatibility with 0.13 */
|
||||
final val Disabled = sbt.librarymanagement.Disabled
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ package sbt.librarymanagement
|
|||
|
||||
import sbt.librarymanagement.DependencyBuilders.{ Organization, OrganizationArtifactName }
|
||||
|
||||
abstract class InclExclRuleFunctions {
|
||||
private[librarymanagement] abstract class InclExclRuleFunctions {
|
||||
def everything = InclExclRule("*", "*", "*", Vector.empty, Disabled())
|
||||
|
||||
def apply(organization: String, name: String): InclExclRule =
|
||||
|
|
@ -29,24 +29,20 @@ abstract class InclExclRuleFunctions {
|
|||
}
|
||||
}
|
||||
|
||||
abstract class ArtifactTypeFilterExtra {
|
||||
def types: Set[String]
|
||||
private[librarymanagement] abstract class ArtifactTypeFilterExtra {
|
||||
def inverted: Boolean
|
||||
|
||||
protected[this] def copy(
|
||||
types: Set[String] = types,
|
||||
inverted: Boolean = inverted
|
||||
): ArtifactTypeFilter
|
||||
def withInverted(inverted: Boolean): ArtifactTypeFilter
|
||||
|
||||
def invert = copy(inverted = !inverted)
|
||||
def invert = withInverted(!inverted)
|
||||
}
|
||||
|
||||
abstract class ArtifactTypeFilterFunctions {
|
||||
private[librarymanagement] abstract class ArtifactTypeFilterFunctions {
|
||||
def allow(types: Set[String]) = ArtifactTypeFilter(types, false)
|
||||
def forbid(types: Set[String]) = ArtifactTypeFilter(types, true)
|
||||
}
|
||||
|
||||
abstract class ConflictManagerFunctions {
|
||||
private[librarymanagement] abstract class ConflictManagerFunctions {
|
||||
// To avoid NPE (or making the val's below lazy)
|
||||
// For case classes refchecks rewrites apply calls to constructor calls, we have to do it manually
|
||||
def apply(name: String, organization: String = "*", module: String = "*"): ConflictManager
|
||||
|
|
|
|||
|
|
@ -1,137 +1,17 @@
|
|||
package sbt.librarymanagement
|
||||
|
||||
import java.io.File
|
||||
import scala.xml.{ Node => XNode, NodeSeq }
|
||||
|
||||
/**
|
||||
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
final class MakePomConfiguration private (val file: Option[File],
|
||||
val moduleInfo: Option[ModuleInfo],
|
||||
val configurations: Option[Vector[Configuration]],
|
||||
val extra: Option[NodeSeq],
|
||||
val process: XNode => XNode,
|
||||
val filterRepositories: MavenRepository => Boolean,
|
||||
val allRepositories: Boolean,
|
||||
val includeTypes: Set[String])
|
||||
extends Serializable {
|
||||
private def this() =
|
||||
this(None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
identity,
|
||||
MakePomConfiguration.constTrue,
|
||||
true,
|
||||
Set(Artifact.DefaultType, Artifact.PomType))
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: MakePomConfiguration =>
|
||||
(this.file == x.file) && (this.moduleInfo == x.moduleInfo) && (this.configurations == x.configurations) && (this.extra == x.extra) && (this.process == x.process) && (this.filterRepositories == x.filterRepositories) && (this.allRepositories == x.allRepositories) && (this.includeTypes == x.includeTypes)
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
37 * (37 * (37 * (37 * (37 * (37 * (37 * (37 * (37 * (17 + "sbt.librarymanagement.MakePomConfiguration".##) + file.##) + moduleInfo.##) + configurations.##) + extra.##) + process.##) + filterRepositories.##) + allRepositories.##) + includeTypes.##)
|
||||
}
|
||||
override def toString: String = {
|
||||
"MakePomConfiguration(" + file + ", " + moduleInfo + ", " + configurations + ", " + extra + ", " + process + ", " + filterRepositories + ", " + allRepositories + ", " + includeTypes + ")"
|
||||
}
|
||||
protected[this] def copy(file: Option[File] = file,
|
||||
moduleInfo: Option[ModuleInfo] = moduleInfo,
|
||||
configurations: Option[Vector[Configuration]] = configurations,
|
||||
extra: Option[NodeSeq] = extra,
|
||||
process: XNode => XNode = process,
|
||||
filterRepositories: MavenRepository => Boolean = filterRepositories,
|
||||
allRepositories: Boolean = allRepositories,
|
||||
includeTypes: Set[String] = includeTypes): MakePomConfiguration = {
|
||||
new MakePomConfiguration(file,
|
||||
moduleInfo,
|
||||
configurations,
|
||||
extra,
|
||||
process,
|
||||
filterRepositories,
|
||||
allRepositories,
|
||||
includeTypes)
|
||||
}
|
||||
def withFile(file: Option[File]): MakePomConfiguration = {
|
||||
copy(file = file)
|
||||
}
|
||||
def withFile(file: File): MakePomConfiguration = {
|
||||
copy(file = Option(file))
|
||||
}
|
||||
def withModuleInfo(moduleInfo: Option[ModuleInfo]): MakePomConfiguration = {
|
||||
copy(moduleInfo = moduleInfo)
|
||||
}
|
||||
def withModuleInfo(moduleInfo: ModuleInfo): MakePomConfiguration = {
|
||||
copy(moduleInfo = Option(moduleInfo))
|
||||
}
|
||||
def withConfigurations(configurations: Option[Vector[Configuration]]): MakePomConfiguration = {
|
||||
copy(configurations = configurations)
|
||||
}
|
||||
def withExtra(extra: Option[NodeSeq]): MakePomConfiguration = {
|
||||
copy(extra = extra)
|
||||
}
|
||||
def withExtra(extra: NodeSeq): MakePomConfiguration = {
|
||||
copy(extra = Option(extra))
|
||||
}
|
||||
def withProcess(process: XNode => XNode): MakePomConfiguration = {
|
||||
copy(process = process)
|
||||
}
|
||||
def withFilterRepositories(
|
||||
filterRepositories: MavenRepository => Boolean
|
||||
): MakePomConfiguration = {
|
||||
copy(filterRepositories = filterRepositories)
|
||||
}
|
||||
def withAllRepositories(allRepositories: Boolean): MakePomConfiguration = {
|
||||
copy(allRepositories = allRepositories)
|
||||
}
|
||||
def withIncludeTypes(includeTypes: Set[String]): MakePomConfiguration = {
|
||||
copy(includeTypes = includeTypes)
|
||||
}
|
||||
}
|
||||
|
||||
object MakePomConfiguration {
|
||||
private[librarymanagement] abstract class MakePomConfigurationFunctions {
|
||||
private[sbt] lazy val constTrue: MavenRepository => Boolean = _ => true
|
||||
|
||||
def apply(): MakePomConfiguration =
|
||||
new MakePomConfiguration(None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
identity,
|
||||
constTrue,
|
||||
true,
|
||||
Set(Artifact.DefaultType, Artifact.PomType))
|
||||
def apply(file: Option[File],
|
||||
moduleInfo: Option[ModuleInfo],
|
||||
configurations: Option[Vector[Configuration]],
|
||||
extra: Option[NodeSeq],
|
||||
process: XNode => XNode,
|
||||
filterRepositories: MavenRepository => Boolean,
|
||||
allRepositories: Boolean,
|
||||
includeTypes: Set[String]): MakePomConfiguration =
|
||||
new MakePomConfiguration(file,
|
||||
moduleInfo,
|
||||
configurations,
|
||||
extra,
|
||||
process,
|
||||
filterRepositories,
|
||||
allRepositories,
|
||||
includeTypes)
|
||||
def apply(file: File,
|
||||
moduleInfo: ModuleInfo,
|
||||
configurations: Vector[Configuration],
|
||||
extra: NodeSeq,
|
||||
process: XNode => XNode,
|
||||
filterRepositories: MavenRepository => Boolean,
|
||||
allRepositories: Boolean,
|
||||
includeTypes: Set[String]): MakePomConfiguration =
|
||||
new MakePomConfiguration(Option(file),
|
||||
Option(moduleInfo),
|
||||
Option(configurations),
|
||||
Option(extra),
|
||||
process,
|
||||
filterRepositories,
|
||||
allRepositories,
|
||||
includeTypes)
|
||||
MakePomConfiguration(
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
identity(_: scala.xml.Node),
|
||||
constTrue,
|
||||
true,
|
||||
Set(Artifact.DefaultType, Artifact.PomType)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import sbt.internal.librarymanagement.mavenint.SbtPomExtraProperties
|
|||
import scala.collection.mutable.ListBuffer
|
||||
import sbt.librarymanagement.syntax._
|
||||
|
||||
abstract class ModuleIDExtra {
|
||||
private[librarymanagement] abstract class ModuleIDExtra {
|
||||
def organization: String
|
||||
def name: String
|
||||
def revision: String
|
||||
|
|
@ -24,21 +24,14 @@ abstract class ModuleIDExtra {
|
|||
def crossVersion: CrossVersion
|
||||
def branchName: Option[String]
|
||||
|
||||
protected[this] def copy(
|
||||
organization: String = organization,
|
||||
name: String = name,
|
||||
revision: String = revision,
|
||||
configurations: Option[String] = configurations,
|
||||
isChanging: Boolean = isChanging,
|
||||
isTransitive: Boolean = isTransitive,
|
||||
isForce: Boolean = isForce,
|
||||
explicitArtifacts: Vector[Artifact] = explicitArtifacts,
|
||||
inclusions: Vector[InclusionRule] = inclusions,
|
||||
exclusions: Vector[ExclusionRule] = exclusions,
|
||||
extraAttributes: Map[String, String] = extraAttributes,
|
||||
crossVersion: CrossVersion = crossVersion,
|
||||
branchName: Option[String] = branchName
|
||||
): ModuleID
|
||||
def withIsChanging(isChanging: Boolean): ModuleID
|
||||
def withIsTransitive(isTransitive: Boolean): ModuleID
|
||||
def withIsForce(isForce: Boolean): ModuleID
|
||||
def withExplicitArtifacts(explicitArtifacts: Vector[Artifact]): ModuleID
|
||||
def withExclusions(exclusions: Vector[InclExclRule]): ModuleID
|
||||
def withExtraAttributes(extraAttributes: Map[String, String]): ModuleID
|
||||
def withCrossVersion(crossVersion: CrossVersion): ModuleID
|
||||
def withBranchName(branchName: Option[String]): ModuleID
|
||||
|
||||
protected def toStringImpl: String =
|
||||
s"""$organization:$name:$revision""" +
|
||||
|
|
@ -78,14 +71,14 @@ abstract class ModuleIDExtra {
|
|||
def cross(v: Boolean): ModuleID = cross(if (v) CrossVersion.binary else Disabled())
|
||||
|
||||
/** Specifies the cross-version behavior for this module. See [CrossVersion] for details.*/
|
||||
def cross(v: CrossVersion): ModuleID = copy(crossVersion = v)
|
||||
def cross(v: CrossVersion): ModuleID = withCrossVersion(v)
|
||||
|
||||
// () required for chaining
|
||||
/** Do not follow dependencies of this module. Synonym for `intransitive`.*/
|
||||
def notTransitive() = intransitive()
|
||||
|
||||
/** Do not follow dependencies of this module. Synonym for `notTransitive`.*/
|
||||
def intransitive() = copy(isTransitive = false)
|
||||
def intransitive() = withIsTransitive(false)
|
||||
|
||||
/**
|
||||
* Marks this dependency as "changing". Ivy will always check if the metadata has changed and then if the artifact has changed,
|
||||
|
|
@ -93,13 +86,13 @@ abstract class ModuleIDExtra {
|
|||
*
|
||||
* See the "Changes in artifacts" section of https://ant.apache.org/ivy/history/trunk/concept.html for full details.
|
||||
*/
|
||||
def changing() = copy(isChanging = true)
|
||||
def changing() = withIsChanging(true)
|
||||
|
||||
/**
|
||||
* Indicates that conflict resolution should only select this module's revision.
|
||||
* This prevents a newer revision from being pulled in by a transitive dependency, for example.
|
||||
*/
|
||||
def force() = copy(isForce = true)
|
||||
def force() = withIsForce(true)
|
||||
|
||||
/**
|
||||
* Specifies a URL from which the main artifact for this dependency can be downloaded.
|
||||
|
|
@ -116,13 +109,13 @@ abstract class ModuleIDExtra {
|
|||
* these artifact definitions override the information in the dependency's published metadata.
|
||||
*/
|
||||
def artifacts(newArtifacts: Artifact*) =
|
||||
copy(explicitArtifacts = newArtifacts.toVector ++ explicitArtifacts)
|
||||
withExplicitArtifacts(newArtifacts.toVector ++ explicitArtifacts)
|
||||
|
||||
/**
|
||||
* Applies the provided exclusions to dependencies of this module. Note that only exclusions that specify
|
||||
* both the exact organization and name and nothing else will be included in a pom.xml.
|
||||
*/
|
||||
def excludeAll(rules: ExclusionRule*) = copy(exclusions = this.exclusions ++ rules)
|
||||
def excludeAll(rules: ExclusionRule*) = withExclusions(exclusions ++ rules)
|
||||
|
||||
/** Excludes the dependency with organization `org` and `name` from being introduced by this dependency during resolution. */
|
||||
def exclude(org: String, name: String) =
|
||||
|
|
@ -133,7 +126,7 @@ abstract class ModuleIDExtra {
|
|||
* This information will only be published in an ivy.xml and not in a pom.xml.
|
||||
*/
|
||||
def extra(attributes: (String, String)*) =
|
||||
copy(extraAttributes = this.extraAttributes ++ ModuleID.checkE(attributes))
|
||||
withExtraAttributes(extraAttributes ++ ModuleID.checkE(attributes))
|
||||
|
||||
/**
|
||||
* Not recommended for new use. This method is not deprecated, but the `update-classifiers` task is preferred
|
||||
|
|
@ -176,12 +169,12 @@ abstract class ModuleIDExtra {
|
|||
/**
|
||||
* Sets the Ivy branch of this module.
|
||||
*/
|
||||
def branch(branchName: String) = copy(branchName = Some(branchName))
|
||||
def branch(branchName: String) = withBranchName(Some(branchName))
|
||||
|
||||
def branch(branchName: Option[String]) = copy(branchName = branchName)
|
||||
def branch(branchName: Option[String]) = withBranchName(branchName)
|
||||
}
|
||||
|
||||
abstract class ModuleIDFunctions {
|
||||
private[librarymanagement] abstract class ModuleIDFunctions {
|
||||
|
||||
/** Prefixes all keys with `e:` if they are not already so prefixed. */
|
||||
def checkE(attributes: Seq[(String, String)]) =
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@ final class RawRepository(val resolver: AnyRef, name: String) extends Resolver(n
|
|||
}
|
||||
}
|
||||
|
||||
abstract class MavenRepositoryFunctions {
|
||||
private[librarymanagement] abstract class MavenRepositoryFunctions {
|
||||
def apply(name: String, root: String, localIfFile: Boolean = true): MavenRepository =
|
||||
MavenRepo(name, root, localIfFile)
|
||||
}
|
||||
|
||||
abstract class PatternsFunctions {
|
||||
private[librarymanagement] abstract class PatternsFunctions {
|
||||
implicit def defaultPatterns: Patterns = Resolver.defaultPatterns
|
||||
|
||||
def apply(artifactPatterns: String*): Patterns = Patterns(true, artifactPatterns: _*)
|
||||
|
|
@ -42,7 +42,7 @@ abstract class PatternsFunctions {
|
|||
}
|
||||
}
|
||||
|
||||
trait SshBasedRepositoryExtra {
|
||||
private[librarymanagement] trait SshBasedRepositoryExtra {
|
||||
|
||||
/** The object representing the configured ssh connection for this repository. */
|
||||
def connection: SshConnection
|
||||
|
|
@ -67,7 +67,7 @@ trait SshBasedRepositoryExtra {
|
|||
copy(KeyFileAuthentication(user, keyfile, password))
|
||||
}
|
||||
|
||||
trait SshRepositoryExtra extends SshBasedRepositoryExtra {
|
||||
private[librarymanagement] trait SshRepositoryExtra extends SshBasedRepositoryExtra {
|
||||
def name: String
|
||||
def patterns: sbt.librarymanagement.Patterns
|
||||
def publishPermissions: Option[String]
|
||||
|
|
@ -78,7 +78,7 @@ trait SshRepositoryExtra extends SshBasedRepositoryExtra {
|
|||
SshRepository(name, connection, patterns, publishPermissions)
|
||||
}
|
||||
|
||||
trait SftpRepositoryExtra extends SshBasedRepositoryExtra {
|
||||
private[librarymanagement] trait SftpRepositoryExtra extends SshBasedRepositoryExtra {
|
||||
def name: String
|
||||
def patterns: sbt.librarymanagement.Patterns
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ private[sbt] class FakeRepository(resolver: AnyRef, name: String) extends xsbti.
|
|||
def rawRepository = new RawRepository(resolver, name)
|
||||
}
|
||||
|
||||
abstract class ResolverFunctions {
|
||||
private[librarymanagement] abstract class ResolverFunctions {
|
||||
private[sbt] def useSecureResolvers =
|
||||
sys.props.get("sbt.repository.secure") map { _.toLowerCase == "true" } getOrElse true
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package sbt.librarymanagement
|
|||
import java.io.File
|
||||
import java.{ util => ju }
|
||||
|
||||
abstract class ConfigurationReportExtra {
|
||||
private[librarymanagement] abstract class ConfigurationReportExtra {
|
||||
def configuration: ConfigRef
|
||||
def modules: Vector[ModuleReport]
|
||||
def details: Vector[OrganizationArtifactReport]
|
||||
|
|
@ -34,7 +34,7 @@ abstract class ConfigurationReportExtra {
|
|||
}, details)
|
||||
}
|
||||
|
||||
abstract class ModuleReportExtra {
|
||||
private[librarymanagement] abstract class ModuleReportExtra {
|
||||
def module: ModuleID
|
||||
def artifacts: Vector[(Artifact, File)]
|
||||
def missingArtifacts: Vector[Artifact]
|
||||
|
|
@ -54,6 +54,8 @@ abstract class ModuleReportExtra {
|
|||
def licenses: Vector[(String, Option[String])]
|
||||
def callers: Vector[Caller]
|
||||
|
||||
def withArtifacts(artifacts: Vector[(Artifact, File)]): ModuleReport
|
||||
|
||||
protected[this] def arts: Vector[String] =
|
||||
artifacts.map(_.toString) ++ missingArtifacts.map(art => "(MISSING) " + art)
|
||||
|
||||
|
|
@ -102,31 +104,10 @@ abstract class ModuleReportExtra {
|
|||
}
|
||||
|
||||
def retrieve(f: (ModuleID, Artifact, File) => File): ModuleReport =
|
||||
copy(artifacts = artifacts.map { case (art, file) => (art, f(module, art, file)) })
|
||||
|
||||
protected[this] def copy(
|
||||
module: ModuleID = module,
|
||||
artifacts: Vector[(Artifact, File)] = artifacts,
|
||||
missingArtifacts: Vector[Artifact] = missingArtifacts,
|
||||
status: Option[String] = status,
|
||||
publicationDate: Option[ju.Calendar] = publicationDate,
|
||||
resolver: Option[String] = resolver,
|
||||
artifactResolver: Option[String] = artifactResolver,
|
||||
evicted: Boolean = evicted,
|
||||
evictedData: Option[String] = evictedData,
|
||||
evictedReason: Option[String] = evictedReason,
|
||||
problem: Option[String] = problem,
|
||||
homepage: Option[String] = homepage,
|
||||
extraAttributes: Map[String, String] = extraAttributes,
|
||||
isDefault: Option[Boolean] = isDefault,
|
||||
branch: Option[String] = branch,
|
||||
configurations: Vector[ConfigRef] = configurations,
|
||||
licenses: Vector[(String, Option[String])] = licenses,
|
||||
callers: Vector[Caller] = callers
|
||||
): ModuleReport
|
||||
withArtifacts(artifacts.map { case (art, file) => (art, f(module, art, file)) })
|
||||
}
|
||||
|
||||
abstract class UpdateReportExtra {
|
||||
private[librarymanagement] abstract class UpdateReportExtra {
|
||||
def cachedDescriptor: File
|
||||
def configurations: Vector[ConfigurationReport]
|
||||
def stats: UpdateStats
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ final class ExternalIvyConfiguration private (
|
|||
}
|
||||
object ExternalIvyConfiguration {
|
||||
|
||||
def apply(): ExternalIvyConfiguration = new ExternalIvyConfiguration(None, None, sbt.librarymanagement.ivy.UpdateOptions(), None, None, Vector())
|
||||
def apply(): ExternalIvyConfiguration = new ExternalIvyConfiguration()
|
||||
def apply(lock: Option[xsbti.GlobalLock], log: Option[xsbti.Logger], updateOptions: sbt.librarymanagement.ivy.UpdateOptions, baseDirectory: Option[java.io.File], uri: Option[java.net.URI], extraResolvers: Vector[sbt.librarymanagement.Resolver]): ExternalIvyConfiguration = new ExternalIvyConfiguration(lock, log, updateOptions, baseDirectory, uri, extraResolvers)
|
||||
def apply(lock: xsbti.GlobalLock, log: xsbti.Logger, updateOptions: sbt.librarymanagement.ivy.UpdateOptions, baseDirectory: java.io.File, uri: java.net.URI, extraResolvers: Vector[sbt.librarymanagement.Resolver]): ExternalIvyConfiguration = new ExternalIvyConfiguration(Option(lock), Option(log), updateOptions, Option(baseDirectory), Option(uri), extraResolvers)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ object InlineIvyConfiguration {
|
|||
.withResolutionCacheDir(resolutionCacheDir)
|
||||
.withLog(log)
|
||||
}
|
||||
def apply(): InlineIvyConfiguration = new InlineIvyConfiguration(None, None, sbt.librarymanagement.ivy.UpdateOptions(), None, sbt.librarymanagement.Resolver.defaults, Vector.empty, Vector.empty, sbt.librarymanagement.ivy.IvyDefaults.defaultChecksums, false, None)
|
||||
def apply(): InlineIvyConfiguration = new InlineIvyConfiguration()
|
||||
def apply(lock: Option[xsbti.GlobalLock], log: Option[xsbti.Logger], updateOptions: sbt.librarymanagement.ivy.UpdateOptions, paths: Option[sbt.librarymanagement.ivy.IvyPaths], resolvers: Vector[sbt.librarymanagement.Resolver], otherResolvers: Vector[sbt.librarymanagement.Resolver], moduleConfigurations: Vector[sbt.librarymanagement.ModuleConfiguration], checksums: Vector[String], managedChecksums: Boolean, resolutionCacheDir: Option[java.io.File]): InlineIvyConfiguration = new InlineIvyConfiguration(lock, log, updateOptions, paths, resolvers, otherResolvers, moduleConfigurations, checksums, managedChecksums, resolutionCacheDir)
|
||||
def apply(lock: xsbti.GlobalLock, log: xsbti.Logger, updateOptions: sbt.librarymanagement.ivy.UpdateOptions, paths: sbt.librarymanagement.ivy.IvyPaths, resolvers: Vector[sbt.librarymanagement.Resolver], otherResolvers: Vector[sbt.librarymanagement.Resolver], moduleConfigurations: Vector[sbt.librarymanagement.ModuleConfiguration], checksums: Vector[String], managedChecksums: Boolean, resolutionCacheDir: java.io.File): InlineIvyConfiguration = new InlineIvyConfiguration(Option(lock), Option(log), updateOptions, Option(paths), resolvers, otherResolvers, moduleConfigurations, checksums, managedChecksums, Option(resolutionCacheDir))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.5")
|
||||
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.2")
|
||||
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.3")
|
||||
|
||||
scalacOptions += "-language:postfixOps"
|
||||
|
|
|
|||
Loading…
Reference in New Issue