Easier bin compat for stuff under lmcoursier.definitions (#73)

This commit is contained in:
Alexandre Archambault 2019-05-28 12:48:16 +02:00 committed by GitHub
parent bf189d8fc1
commit bed2d2dd28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 756 additions and 119 deletions

View File

@ -18,6 +18,7 @@ inThisBuild(List(
val coursierVersion0 = "1.1.0-M14-5"
lazy val `lm-coursier` = project
// .enablePlugins(ContrabandPlugin)
.in(file("modules/lm-coursier"))
.settings(
shared,

View File

@ -0,0 +1,33 @@
{
"types": [
{
"name": "Authentication",
"namespace": "lmcoursier.definitions",
"target": "Scala",
"parents": [],
"type": "record",
"fields": [
{
"name": "user",
"type": "String"
},
{
"name": "password",
"type": "String"
},
{
"name": "optional",
"type": "Boolean",
"default": "false",
"since": "1.0.0"
},
{
"name": "realmOpt",
"type": "Option[String]",
"default": "None",
"since": "1.0.0"
}
]
}
]
}

View File

@ -0,0 +1,37 @@
{
"types": [
{
"name": "DateTime",
"namespace": "lmcoursier.definitions",
"target": "Scala",
"parents": [],
"type": "record",
"fields": [
{
"name": "year",
"type": "Int"
},
{
"name": "month",
"type": "Int"
},
{
"name": "day",
"type": "Int"
},
{
"name": "hour",
"type": "Int"
},
{
"name": "minute",
"type": "Int"
},
{
"name": "second",
"type": "Int"
}
]
}
]
}

View File

@ -0,0 +1,41 @@
{
"types": [
{
"name": "Dependency",
"namespace": "lmcoursier.definitions",
"target": "Scala",
"parents": [],
"type": "record",
"fields": [
{
"name": "module",
"type": "Module"
},
{
"name": "version",
"type": "String"
},
{
"name": "configuration",
"type": "Configuration"
},
{
"name": "exclusions",
"type": "Set[(Organization, ModuleName)]"
},
{
"name": "attributes",
"type": "Attributes"
},
{
"name": "optional",
"type": "Boolean"
},
{
"name": "transitive",
"type": "Boolean"
}
]
}
]
}

View File

@ -0,0 +1,25 @@
{
"types": [
{
"name": "Developer",
"namespace": "lmcoursier.definitions",
"target": "Scala",
"parents": [],
"type": "record",
"fields": [
{
"name": "id",
"type": "String"
},
{
"name": "name",
"type": "String"
},
{
"name": "url",
"type": "String"
}
]
}
]
}

View File

@ -0,0 +1,29 @@
{
"types": [
{
"name": "FallbackDependency",
"namespace": "lmcoursier",
"target": "Scala",
"parents": [],
"type": "record",
"fields": [
{
"name": "module",
"type": "lmcoursier.definitions.Module"
},
{
"name": "version",
"type": "String"
},
{
"name": "url",
"type": "java.net.URL"
},
{
"name": "changing",
"type": "Boolean"
}
]
}
]
}

View File

@ -0,0 +1,33 @@
{
"types": [
{
"name": "Info",
"namespace": "lmcoursier.definitions",
"target": "Scala",
"parents": [],
"type": "record",
"fields": [
{
"name": "description",
"type": "String"
},
{
"name": "homePage",
"type": "String"
},
{
"name": "licenses",
"type": "Seq[(String, Option[String])]"
},
{
"name": "developers",
"type": "Seq[Developer]"
},
{
"name": "publication",
"type": "Option[DateTime]"
}
]
}
]
}

View File

@ -0,0 +1,25 @@
{
"types": [
{
"name": "Module",
"namespace": "lmcoursier.definitions",
"target": "Scala",
"parents": [],
"type": "record",
"fields": [
{
"name": "organization",
"type": "Organization"
},
{
"name": "name",
"type": "ModuleName"
},
{
"name": "attributes",
"type": "Map[String, String]"
}
]
}
]
}

View File

@ -0,0 +1,45 @@
{
"types": [
{
"name": "Project",
"namespace": "lmcoursier.definitions",
"target": "Scala",
"parents": [],
"type": "record",
"fields": [
{
"name": "module",
"type": "Module"
},
{
"name": "version",
"type": "String"
},
{
"name": "dependencies",
"type": "Seq[(Configuration, Dependency)]"
},
{
"name": "configurations",
"type": "Map[Configuration, Seq[Configuration]]"
},
{
"name": "properties",
"type": "Seq[(String, String)]"
},
{
"name": "packagingOpt",
"type": "Option[Type]"
},
{
"name": "publications",
"type": "Seq[(Configuration, Publication)]"
},
{
"name": "info",
"type": "Info"
}
]
}
]
}

View File

@ -0,0 +1,29 @@
{
"types": [
{
"name": "Publication",
"namespace": "lmcoursier.definitions",
"target": "Scala",
"parents": [],
"type": "record",
"fields": [
{
"name": "name",
"type": "String"
},
{
"name": "type",
"type": "Type"
},
{
"name": "ext",
"type": "Extension"
},
{
"name": "classifier",
"type": "Classifier"
}
]
}
]
}

View File

@ -106,9 +106,7 @@ class CoursierDependencyResolution(conf: CoursierConfiguration) extends Dependen
}
.map {
case (config, dep) =>
val dep0 = dep.copy(
exclusions = dep.exclusions ++ excludeDependencies
)
val dep0 = dep.withExclusions(dep.exclusions ++ excludeDependencies)
(ToCoursier.configuration(config), ToCoursier.dependency(dep0))
}

View File

@ -1,13 +1,44 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier
import java.net.URL
import lmcoursier.definitions.Module
// FIXME Handle that via the contraband thing?
final case class FallbackDependency(
module: Module,
version: String,
url: URL,
changing: Boolean
)
final class FallbackDependency private (
val module: lmcoursier.definitions.Module,
val version: String,
val url: java.net.URL,
val changing: Boolean) extends Serializable {
override def equals(o: Any): Boolean = o match {
case x: FallbackDependency => (this.module == x.module) && (this.version == x.version) && (this.url == x.url) && (this.changing == x.changing)
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (37 * (17 + "lmcoursier.FallbackDependency".##) + module.##) + version.##) + url.##) + changing.##)
}
override def toString: String = {
"FallbackDependency(" + module + ", " + version + ", " + url + ", " + changing + ")"
}
private[this] def copy(module: lmcoursier.definitions.Module = module, version: String = version, url: java.net.URL = url, changing: Boolean = changing): FallbackDependency = {
new FallbackDependency(module, version, url, changing)
}
def withModule(module: lmcoursier.definitions.Module): FallbackDependency = {
copy(module = module)
}
def withVersion(version: String): FallbackDependency = {
copy(version = version)
}
def withUrl(url: java.net.URL): FallbackDependency = {
copy(url = url)
}
def withChanging(changing: Boolean): FallbackDependency = {
copy(changing = changing)
}
}
object FallbackDependency {
def apply(module: lmcoursier.definitions.Module, version: String, url: java.net.URL, changing: Boolean): FallbackDependency = new FallbackDependency(module, version, url, changing)
}

View File

@ -101,7 +101,12 @@ object FromSbt {
for {
(from, to) <- allMappings
attr <- attributes
} yield from -> dep.copy(configuration = to, attributes = attr)
} yield {
val dep0 = dep
.withConfiguration(to)
.withAttributes(attr)
from -> dep0
}
}
def fallbackDependencies(

View File

@ -1,11 +1,45 @@
package lmcoursier.definitions
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
final case class Authentication(
user: String,
password: String,
optional: Boolean = false,
realmOpt: Option[String] = None
) {
override def toString: String =
s"Authentication($user, *******, $optional, $realmOpt)"
// DO NOT EDIT MANUALLY
package lmcoursier.definitions
final class Authentication private (
val user: String,
val password: String,
val optional: Boolean,
val realmOpt: Option[String]) extends Serializable {
private def this(user: String, password: String) = this(user, password, false, None)
override def equals(o: Any): Boolean = o match {
case x: Authentication => (this.user == x.user) && (this.password == x.password) && (this.optional == x.optional) && (this.realmOpt == x.realmOpt)
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (37 * (17 + "lmcoursier.definitions.Authentication".##) + user.##) + password.##) + optional.##) + realmOpt.##)
}
override def toString: String = {
"Authentication(" + user + ", " + password + ", " + optional + ", " + realmOpt + ")"
}
private[this] def copy(user: String = user, password: String = password, optional: Boolean = optional, realmOpt: Option[String] = realmOpt): Authentication = {
new Authentication(user, password, optional, realmOpt)
}
def withUser(user: String): Authentication = {
copy(user = user)
}
def withPassword(password: String): Authentication = {
copy(password = password)
}
def withOptional(optional: Boolean): Authentication = {
copy(optional = optional)
}
def withRealmOpt(realmOpt: Option[String]): Authentication = {
copy(realmOpt = realmOpt)
}
}
object Authentication {
def apply(user: String, password: String): Authentication = new Authentication(user, password)
def apply(user: String, password: String, optional: Boolean, realmOpt: Option[String]): Authentication = new Authentication(user, password, optional, realmOpt)
}

View File

@ -1,3 +0,0 @@
package lmcoursier.definitions
final case class Classifier(value: String) extends AnyVal

View File

@ -1,3 +0,0 @@
package lmcoursier.definitions
final case class Configuration(value: String) extends AnyVal

View File

@ -0,0 +1,52 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions
final class DateTime private (
val year: Int,
val month: Int,
val day: Int,
val hour: Int,
val minute: Int,
val second: Int) extends Serializable {
override def equals(o: Any): Boolean = o match {
case x: DateTime => (this.year == x.year) && (this.month == x.month) && (this.day == x.day) && (this.hour == x.hour) && (this.minute == x.minute) && (this.second == x.second)
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (37 * (37 * (37 * (17 + "lmcoursier.definitions.DateTime".##) + year.##) + month.##) + day.##) + hour.##) + minute.##) + second.##)
}
override def toString: String = {
"DateTime(" + year + ", " + month + ", " + day + ", " + hour + ", " + minute + ", " + second + ")"
}
private[this] def copy(year: Int = year, month: Int = month, day: Int = day, hour: Int = hour, minute: Int = minute, second: Int = second): DateTime = {
new DateTime(year, month, day, hour, minute, second)
}
def withYear(year: Int): DateTime = {
copy(year = year)
}
def withMonth(month: Int): DateTime = {
copy(month = month)
}
def withDay(day: Int): DateTime = {
copy(day = day)
}
def withHour(hour: Int): DateTime = {
copy(hour = hour)
}
def withMinute(minute: Int): DateTime = {
copy(minute = minute)
}
def withSecond(second: Int): DateTime = {
copy(second = second)
}
}
object DateTime {
def apply(year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int): DateTime = new DateTime(year, month, day, hour, minute, second)
}

View File

@ -0,0 +1,13 @@
package lmcoursier.definitions
final case class Classifier(value: String) extends AnyVal
final case class Configuration(value: String) extends AnyVal
final case class Extension(value: String) extends AnyVal
final case class ModuleName(value: String) extends AnyVal
final case class Organization(value: String) extends AnyVal
final case class Type(value: String) extends AnyVal

View File

@ -1,14 +1,56 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions
final case class Dependency(
module: Module,
version: String,
configuration: Configuration,
exclusions: Set[(Organization, ModuleName)],
// Maven-specific
attributes: Attributes,
optional: Boolean,
transitive: Boolean
)
final class Dependency private (
val module: Module,
val version: String,
val configuration: Configuration,
val exclusions: Set[(Organization, ModuleName)],
val attributes: Attributes,
val optional: Boolean,
val transitive: Boolean) extends Serializable {
override def equals(o: Any): Boolean = o match {
case x: Dependency => (this.module == x.module) && (this.version == x.version) && (this.configuration == x.configuration) && (this.exclusions == x.exclusions) && (this.attributes == x.attributes) && (this.optional == x.optional) && (this.transitive == x.transitive)
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (37 * (37 * (37 * (37 * (17 + "lmcoursier.definitions.Dependency".##) + module.##) + version.##) + configuration.##) + exclusions.##) + attributes.##) + optional.##) + transitive.##)
}
override def toString: String = {
"Dependency(" + module + ", " + version + ", " + configuration + ", " + exclusions + ", " + attributes + ", " + optional + ", " + transitive + ")"
}
private[this] def copy(module: Module = module, version: String = version, configuration: Configuration = configuration, exclusions: Set[(Organization, ModuleName)] = exclusions, attributes: Attributes = attributes, optional: Boolean = optional, transitive: Boolean = transitive): Dependency = {
new Dependency(module, version, configuration, exclusions, attributes, optional, transitive)
}
def withModule(module: Module): Dependency = {
copy(module = module)
}
def withVersion(version: String): Dependency = {
copy(version = version)
}
def withConfiguration(configuration: Configuration): Dependency = {
copy(configuration = configuration)
}
def withExclusions(exclusions: Set[(Organization, ModuleName)]): Dependency = {
copy(exclusions = exclusions)
}
def withAttributes(attributes: Attributes): Dependency = {
copy(attributes = attributes)
}
def withOptional(optional: Boolean): Dependency = {
copy(optional = optional)
}
def withTransitive(transitive: Boolean): Dependency = {
copy(transitive = transitive)
}
}
object Dependency {
def apply(module: Module, version: String, configuration: Configuration, exclusions: Set[(Organization, ModuleName)], attributes: Attributes, optional: Boolean, transitive: Boolean): Dependency = new Dependency(module, version, configuration, exclusions, attributes, optional, transitive)
}

View File

@ -0,0 +1,40 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions
final class Developer private (
val id: String,
val name: String,
val url: String) extends Serializable {
override def equals(o: Any): Boolean = o match {
case x: Developer => (this.id == x.id) && (this.name == x.name) && (this.url == x.url)
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (17 + "lmcoursier.definitions.Developer".##) + id.##) + name.##) + url.##)
}
override def toString: String = {
"Developer(" + id + ", " + name + ", " + url + ")"
}
private[this] def copy(id: String = id, name: String = name, url: String = url): Developer = {
new Developer(id, name, url)
}
def withId(id: String): Developer = {
copy(id = id)
}
def withName(name: String): Developer = {
copy(name = name)
}
def withUrl(url: String): Developer = {
copy(url = url)
}
}
object Developer {
def apply(id: String, name: String, url: String): Developer = new Developer(id, name, url)
}

View File

@ -1,3 +0,0 @@
package lmcoursier.definitions
final case class Extension(value: String) extends AnyVal

View File

@ -1,26 +1,48 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions
final case class Info(
description: String,
homePage: String,
licenses: Seq[(String, Option[String])],
developers: Seq[Info.Developer],
publication: Option[Info.DateTime]
)
object Info {
final case class Developer(
id: String,
name: String,
url: String
)
final case class DateTime(
year: Int,
month: Int,
day: Int,
hour: Int,
minute: Int,
second: Int
)
final class Info private (
val description: String,
val homePage: String,
val licenses: Seq[(String, Option[String])],
val developers: Seq[Developer],
val publication: Option[DateTime]) extends Serializable {
override def equals(o: Any): Boolean = o match {
case x: Info => (this.description == x.description) && (this.homePage == x.homePage) && (this.licenses == x.licenses) && (this.developers == x.developers) && (this.publication == x.publication)
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (37 * (37 * (17 + "lmcoursier.definitions.Info".##) + description.##) + homePage.##) + licenses.##) + developers.##) + publication.##)
}
override def toString: String = {
"Info(" + description + ", " + homePage + ", " + licenses + ", " + developers + ", " + publication + ")"
}
private[this] def copy(description: String = description, homePage: String = homePage, licenses: Seq[(String, Option[String])] = licenses, developers: Seq[Developer] = developers, publication: Option[DateTime] = publication): Info = {
new Info(description, homePage, licenses, developers, publication)
}
def withDescription(description: String): Info = {
copy(description = description)
}
def withHomePage(homePage: String): Info = {
copy(homePage = homePage)
}
def withLicenses(licenses: Seq[(String, Option[String])]): Info = {
copy(licenses = licenses)
}
def withDevelopers(developers: Seq[Developer]): Info = {
copy(developers = developers)
}
def withPublication(publication: Option[DateTime]): Info = {
copy(publication = publication)
}
}
object Info {
def apply(description: String, homePage: String, licenses: Seq[(String, Option[String])], developers: Seq[Developer], publication: Option[DateTime]): Info = new Info(description, homePage, licenses, developers, publication)
}

View File

@ -1,7 +1,40 @@
package lmcoursier.definitions
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
final case class Module(
organization: Organization,
name: ModuleName,
attributes: Map[String, String]
)
// DO NOT EDIT MANUALLY
package lmcoursier.definitions
final class Module private (
val organization: Organization,
val name: ModuleName,
val attributes: Map[String, String]) extends Serializable {
override def equals(o: Any): Boolean = o match {
case x: Module => (this.organization == x.organization) && (this.name == x.name) && (this.attributes == x.attributes)
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (17 + "lmcoursier.definitions.Module".##) + organization.##) + name.##) + attributes.##)
}
override def toString: String = {
"Module(" + organization + ", " + name + ", " + attributes + ")"
}
private[this] def copy(organization: Organization = organization, name: ModuleName = name, attributes: Map[String, String] = attributes): Module = {
new Module(organization, name, attributes)
}
def withOrganization(organization: Organization): Module = {
copy(organization = organization)
}
def withName(name: ModuleName): Module = {
copy(name = name)
}
def withAttributes(attributes: Map[String, String]): Module = {
copy(attributes = attributes)
}
}
object Module {
def apply(organization: Organization, name: ModuleName, attributes: Map[String, String]): Module = new Module(organization, name, attributes)
}

View File

@ -1,3 +0,0 @@
package lmcoursier.definitions
final case class ModuleName(value: String) extends AnyVal

View File

@ -1,3 +0,0 @@
package lmcoursier.definitions
final case class Organization(value: String) extends AnyVal

View File

@ -1,12 +1,60 @@
package lmcoursier.definitions
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
final case class Project(
module: Module,
version: String,
dependencies: Seq[(Configuration, Dependency)],
configurations: Map[Configuration, Seq[Configuration]],
properties: Seq[(String, String)],
packagingOpt: Option[Type],
publications: Seq[(Configuration, Publication)],
info: Info
)
// DO NOT EDIT MANUALLY
package lmcoursier.definitions
final class Project private (
val module: Module,
val version: String,
val dependencies: Seq[(Configuration, Dependency)],
val configurations: Map[Configuration, Seq[Configuration]],
val properties: Seq[(String, String)],
val packagingOpt: Option[Type],
val publications: Seq[(Configuration, Publication)],
val info: Info) extends Serializable {
override def equals(o: Any): Boolean = o match {
case x: Project => (this.module == x.module) && (this.version == x.version) && (this.dependencies == x.dependencies) && (this.configurations == x.configurations) && (this.properties == x.properties) && (this.packagingOpt == x.packagingOpt) && (this.publications == x.publications) && (this.info == x.info)
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (37 * (37 * (37 * (37 * (37 * (17 + "lmcoursier.definitions.Project".##) + module.##) + version.##) + dependencies.##) + configurations.##) + properties.##) + packagingOpt.##) + publications.##) + info.##)
}
override def toString: String = {
"Project(" + module + ", " + version + ", " + dependencies + ", " + configurations + ", " + properties + ", " + packagingOpt + ", " + publications + ", " + info + ")"
}
private[this] def copy(module: Module = module, version: String = version, dependencies: Seq[(Configuration, Dependency)] = dependencies, configurations: Map[Configuration, Seq[Configuration]] = configurations, properties: Seq[(String, String)] = properties, packagingOpt: Option[Type] = packagingOpt, publications: Seq[(Configuration, Publication)] = publications, info: Info = info): Project = {
new Project(module, version, dependencies, configurations, properties, packagingOpt, publications, info)
}
def withModule(module: Module): Project = {
copy(module = module)
}
def withVersion(version: String): Project = {
copy(version = version)
}
def withDependencies(dependencies: Seq[(Configuration, Dependency)]): Project = {
copy(dependencies = dependencies)
}
def withConfigurations(configurations: Map[Configuration, Seq[Configuration]]): Project = {
copy(configurations = configurations)
}
def withProperties(properties: Seq[(String, String)]): Project = {
copy(properties = properties)
}
def withPackagingOpt(packagingOpt: Option[Type]): Project = {
copy(packagingOpt = packagingOpt)
}
def withPublications(publications: Seq[(Configuration, Publication)]): Project = {
copy(publications = publications)
}
def withInfo(info: Info): Project = {
copy(info = info)
}
}
object Project {
def apply(module: Module, version: String, dependencies: Seq[(Configuration, Dependency)], configurations: Map[Configuration, Seq[Configuration]], properties: Seq[(String, String)], packagingOpt: Option[Type], publications: Seq[(Configuration, Publication)], info: Info): Project = new Project(module, version, dependencies, configurations, properties, packagingOpt, publications, info)
}

View File

@ -1,8 +1,44 @@
package lmcoursier.definitions
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
final case class Publication(
name: String,
`type`: Type,
ext: Extension,
classifier: Classifier
)
// DO NOT EDIT MANUALLY
package lmcoursier.definitions
final class Publication private (
val name: String,
val `type`: Type,
val ext: Extension,
val classifier: Classifier) extends Serializable {
override def equals(o: Any): Boolean = o match {
case x: Publication => (this.name == x.name) && (this.`type` == x.`type`) && (this.ext == x.ext) && (this.classifier == x.classifier)
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (37 * (17 + "lmcoursier.definitions.Publication".##) + name.##) + `type`.##) + ext.##) + classifier.##)
}
override def toString: String = {
"Publication(" + name + ", " + `type` + ", " + ext + ", " + classifier + ")"
}
private[this] def copy(name: String = name, `type`: Type = `type`, ext: Extension = ext, classifier: Classifier = classifier): Publication = {
new Publication(name, `type`, ext, classifier)
}
def withName(name: String): Publication = {
copy(name = name)
}
def withType(`type`: Type): Publication = {
copy(`type` = `type`)
}
def withExt(ext: Extension): Publication = {
copy(ext = ext)
}
def withClassifier(classifier: Classifier): Publication = {
copy(classifier = classifier)
}
}
object Publication {
def apply(name: String, `type`: Type, ext: Extension, classifier: Classifier): Publication = new Publication(name, `type`, ext, classifier)
}

View File

@ -1,3 +0,0 @@
package lmcoursier.definitions
final case class Type(value: String) extends AnyVal

View File

@ -31,10 +31,11 @@ final case class ResolutionParams(
if (fallbackDependencies.isEmpty)
Nil
else {
val map = fallbackDependencies.map {
case FallbackDependency(mod, ver, url, changing) =>
(ToCoursier.module(mod), ver) -> ((url, changing))
}.toMap
val map = fallbackDependencies
.map { dep =>
(ToCoursier.module(dep.module), dep.version) -> ((dep.url, dep.changing))
}
.toMap
Seq(
InMemoryRepository(map)

View File

@ -47,10 +47,11 @@ object InputsTasks {
sbv
)
proj.copy(
dependencies = proj.dependencies.map {
proj.withDependencies(
proj.dependencies.map {
case (config, dep) =>
(config, dep.copy(exclusions = dep.exclusions ++ exclusions0))
val dep0 = dep.withExclusions(dep.exclusions ++ exclusions0)
(config, dep0)
}
)
}

View File

@ -72,8 +72,8 @@ object IvyXml {
.collect { case (conf, dep) if conf.value == shadedConfig.value => dep }
}
val project: Project = project0.copy(
dependencies = project0.dependencies.collect {
val project = project0.withDependencies(
project0.dependencies.collect {
case p @ (_, dep) if !filterOutDependencies(dep) => p
}
)
@ -169,7 +169,7 @@ object IvyXml {
val currentProject = {
val proj = coursierProject.value
val publications = coursierPublications.value
proj.copy(publications = publications)
proj.withPublications(publications)
}
writeFiles(currentProject, shadedConfigOpt, sbt.Keys.ivySbt.value, sbt.Keys.streams.value.log)
}

View File

@ -32,7 +32,7 @@ object DisplayTasks {
Def.task {
val proj = coursierProject.value
val publications = coursierPublications.value
proj.copy(publications = publications)
proj.withPublications(publications)
}
val resolutionsTask =

View File

@ -39,7 +39,7 @@ object ResolutionTasks {
Def.task {
val baseConfigGraphs = coursierConfigGraphs.value
val publications = coursierPublications.value
(ToCoursier.project(coursierProject.value.copy(publications = publications)), coursierFallbackDependencies.value, baseConfigGraphs)
(ToCoursier.project(coursierProject.value.withPublications(publications)), coursierFallbackDependencies.value, baseConfigGraphs)
}
val resolversTask =

View File

@ -24,8 +24,8 @@ object SbtCoursierFromSbt {
// this is a loose attempt at fixing that
cm.configurations match {
case Seq(cfg) =>
p.copy(
dependencies = p.dependencies.map {
p.withDependencies(
p.dependencies.map {
case (_, d) => (Configuration(cfg.name), d)
}
)

View File

@ -29,7 +29,7 @@ object UpdateTasks {
Def.task {
val proj = coursierProject.value
val publications = coursierPublications.value
proj.copy(publications = publications)
proj.withPublications(publications)
}
val resTask =

View File

@ -5,6 +5,7 @@ plugins_(
"com.typesafe" % "sbt-mima-plugin" % "0.3.0",
"com.jsuereth" % "sbt-pgp" % "1.1.2",
"io.get-coursier" % "sbt-shading" % sbtCoursierVersion
// "org.scala-sbt" % "sbt-contraband" % "0.4.3"
)
libs ++= Seq(