Use data-class in lm-coursier (#152)

This commit is contained in:
Alexandre Archambault 2019-10-18 13:39:03 +02:00 committed by GitHub
parent 0b193815c8
commit ce2544d776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 263 additions and 1500 deletions

View File

@ -18,7 +18,6 @@ inThisBuild(List(
val coursierVersion0 = "2.0.0-RC4-1" val coursierVersion0 = "2.0.0-RC4-1"
lazy val `lm-coursier` = project lazy val `lm-coursier` = project
.enablePlugins(ContrabandPlugin)
.in(file("modules/lm-coursier")) .in(file("modules/lm-coursier"))
.settings( .settings(
shared, shared,
@ -26,6 +25,7 @@ lazy val `lm-coursier` = project
Mima.lmCoursierFilters, Mima.lmCoursierFilters,
libraryDependencies ++= Seq( libraryDependencies ++= Seq(
"io.get-coursier" %% "coursier" % coursierVersion0, "io.get-coursier" %% "coursier" % coursierVersion0,
"io.github.alexarchambault" %% "data-class" % "0.2.0" % Provided,
// We depend on librarymanagement-ivy rather than just // We depend on librarymanagement-ivy rather than just
// librarymanagement-core to handle the ModuleDescriptor passed // librarymanagement-core to handle the ModuleDescriptor passed
// to DependencyResolutionInterface.update, which is an // to DependencyResolutionInterface.update, which is an
@ -33,8 +33,7 @@ lazy val `lm-coursier` = project
// is ignored). // is ignored).
"org.scala-sbt" %% "librarymanagement-ivy" % "1.2.4", "org.scala-sbt" %% "librarymanagement-ivy" % "1.2.4",
"org.scalatest" %% "scalatest" % "3.0.8" % Test "org.scalatest" %% "scalatest" % "3.0.8" % Test
), )
Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "scala",
) )
lazy val `lm-coursier-shaded` = project lazy val `lm-coursier-shaded` = project
@ -57,6 +56,7 @@ lazy val `lm-coursier-shaded` = project
), ),
libraryDependencies ++= Seq( libraryDependencies ++= Seq(
"io.get-coursier" %% "coursier" % coursierVersion0 % "shaded", "io.get-coursier" %% "coursier" % coursierVersion0 % "shaded",
"io.github.alexarchambault" %% "data-class" % "0.2.0" % Provided,
"org.scala-lang.modules" %% "scala-xml" % "1.2.0", // depending on that one so that it doesn't get shaded "org.scala-lang.modules" %% "scala-xml" % "1.2.0", // depending on that one so that it doesn't get shaded
"org.scala-sbt" %% "librarymanagement-ivy" % "1.2.4", "org.scala-sbt" %% "librarymanagement-ivy" % "1.2.4",
"org.scalatest" %% "scalatest" % "3.0.8" % Test "org.scalatest" %% "scalatest" % "3.0.8" % Test

View File

@ -1,33 +0,0 @@
{
"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

@ -1,37 +0,0 @@
{
"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

@ -1,48 +0,0 @@
{
"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": "publication",
"type": "Publication"
},
{
"name": "optional",
"type": "Boolean"
},
{
"name": "transitive",
"type": "Boolean"
}
],
"extra": [
"def attributes: Attributes = publication.attributes",
"def withAttributes(attributes: Attributes): Dependency = withPublication(publication.withType(attributes.`type`).withClassifier(attributes.classifier))"
],
"extraCompanion": [
"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, Publication(\"\", attributes.`type`, Extension(\"\"), attributes.classifier), optional, transitive)"
]
}
]
}

View File

@ -1,25 +0,0 @@
{
"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

@ -1,29 +0,0 @@
{
"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

@ -1,33 +0,0 @@
{
"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

@ -1,56 +0,0 @@
{
"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]"
}
]
},
{
"name": "ModuleMatchers",
"namespace": "lmcoursier.definitions",
"target": "Scala",
"parents": [],
"type": "record",
"fields": [
{
"name": "exclude",
"type": "Set[lmcoursier.definitions.Module]",
"doc": "Use \"*\" in either organization or name to match any."
},
{
"name": "include",
"type": "Set[lmcoursier.definitions.Module]",
"doc": "Use \"*\" in either organization or name to match any."
},
{
"name": "includeByDefault",
"type": "Boolean",
"default": "true",
"since": "2.0.0-RC4"
}
],
"extraCompanion": [
"/** ModuleMatchers that matches to any modules. */",
"def all: ModuleMatchers = ModuleMatchers(Set.empty, Set.empty)",
"def only(mod: Module): ModuleMatchers = ModuleMatchers(Set.empty, Set(mod), includeByDefault = false)"
]
}
]
}

View File

@ -1,45 +0,0 @@
{
"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

@ -1,33 +0,0 @@
{
"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"
}
],
"extra": [
"def attributes: Attributes = Attributes(`type`, classifier)",
"def withAttributes(attributes: Attributes): Publication = withType(attributes.`type`).withClassifier(attributes.classifier)"
]
}
]
}

View File

@ -1,553 +1,100 @@
/**
* This code USED TO BE generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO EDIT MANUALLY from now on
package lmcoursier package lmcoursier
import java.io.File import java.io.File
import dataclass.data
import lmcoursier.credentials.Credentials import lmcoursier.credentials.Credentials
import lmcoursier.definitions.{Authentication, CacheLogger, Module, ModuleMatchers, Project, Reconciliation, Strict} import lmcoursier.definitions.{Authentication, CacheLogger, Module, ModuleMatchers, Project, Reconciliation, Strict}
import sbt.librarymanagement.Resolver import sbt.librarymanagement.Resolver
import xsbti.Logger import xsbti.Logger
final class CoursierConfiguration private ( @data class CoursierConfiguration(
val log: Option[Logger], log: Option[Logger] = None,
val resolvers: Vector[Resolver], resolvers: Vector[Resolver] = Resolver.defaults,
val parallelDownloads: Int, parallelDownloads: Int = 6,
val maxIterations: Int, maxIterations: Int = 100,
val sbtScalaOrganization: Option[String], sbtScalaOrganization: Option[String] = None,
val sbtScalaVersion: Option[String], sbtScalaVersion: Option[String] = None,
val sbtScalaJars: Vector[File], sbtScalaJars: Vector[File] = Vector.empty,
val interProjectDependencies: Vector[Project], interProjectDependencies: Vector[Project] = Vector.empty,
val excludeDependencies: Vector[(String, String)], excludeDependencies: Vector[(String, String)] = Vector.empty,
val fallbackDependencies: Vector[FallbackDependency], fallbackDependencies: Vector[FallbackDependency] = Vector.empty,
val autoScalaLibrary: Boolean, autoScalaLibrary: Boolean = true,
val hasClassifiers: Boolean, hasClassifiers: Boolean = false,
val classifiers: Vector[String], classifiers: Vector[String] = Vector.empty,
val mavenProfiles: Vector[String], mavenProfiles: Vector[String] = Vector.empty,
val scalaOrganization: Option[String], scalaOrganization: Option[String] = None,
val scalaVersion: Option[String], scalaVersion: Option[String] = None,
val authenticationByRepositoryId: Vector[(String, Authentication)], authenticationByRepositoryId: Vector[(String, Authentication)] = Vector.empty,
val credentials: Seq[Credentials], credentials: Seq[Credentials] = Vector.empty,
val logger: Option[CacheLogger], logger: Option[CacheLogger] = None,
val cache: Option[File], cache: Option[File] = None,
val ivyHome: Option[File], @since
val followHttpToHttpsRedirections: Option[Boolean], ivyHome: Option[File] = None,
val strict: Option[Strict], @since
val extraProjects: Vector[Project], followHttpToHttpsRedirections: Option[Boolean] = None,
val forceVersions: Vector[(Module, String)], @since
val reconciliation: Vector[(ModuleMatchers, Reconciliation)] strict: Option[Strict] = None,
) extends Serializable { extraProjects: Vector[Project] = Vector.empty,
forceVersions: Vector[(Module, String)] = Vector.empty,
private def this() = @since
this( reconciliation: Vector[(ModuleMatchers, Reconciliation)] = Vector.empty
None, ) {
Resolver.defaults,
6,
100,
None,
None,
Vector.empty,
Vector.empty,
Vector.empty,
Vector.empty,
true,
false,
Vector.empty,
Vector.empty,
None,
None,
Vector.empty,
Vector.empty,
None,
None,
None,
None,
None,
Vector.empty,
Vector.empty,
Vector.empty
)
def this(
log: Option[Logger],
resolvers: Vector[Resolver],
parallelDownloads: Int,
maxIterations: Int,
sbtScalaOrganization: Option[String],
sbtScalaVersion: Option[String],
sbtScalaJars: Vector[File],
interProjectDependencies: Vector[Project],
excludeDependencies: Vector[(String, String)],
fallbackDependencies: Vector[FallbackDependency],
autoScalaLibrary: Boolean,
hasClassifiers: Boolean,
classifiers: Vector[String],
mavenProfiles: Vector[String],
scalaOrganization: Option[String],
scalaVersion: Option[String],
authenticationByRepositoryId: Vector[(String, Authentication)],
credentials: Seq[Credentials],
logger: Option[CacheLogger],
cache: Option[File],
ivyHome: Option[File],
followHttpToHttpsRedirections: Option[Boolean]
) =
this(
log,
resolvers,
parallelDownloads,
maxIterations,
sbtScalaOrganization,
sbtScalaVersion,
sbtScalaJars,
interProjectDependencies,
excludeDependencies,
fallbackDependencies,
autoScalaLibrary,
hasClassifiers,
classifiers,
mavenProfiles,
scalaOrganization,
scalaVersion,
authenticationByRepositoryId,
credentials,
logger,
cache,
ivyHome,
followHttpToHttpsRedirections,
None,
Vector.empty,
Vector.empty,
Vector.empty
)
def this(
log: Option[Logger],
resolvers: Vector[Resolver],
parallelDownloads: Int,
maxIterations: Int,
sbtScalaOrganization: Option[String],
sbtScalaVersion: Option[String],
sbtScalaJars: Vector[File],
interProjectDependencies: Vector[Project],
excludeDependencies: Vector[(String, String)],
fallbackDependencies: Vector[FallbackDependency],
autoScalaLibrary: Boolean,
hasClassifiers: Boolean,
classifiers: Vector[String],
mavenProfiles: Vector[String],
scalaOrganization: Option[String],
scalaVersion: Option[String],
authenticationByRepositoryId: Vector[(String, Authentication)],
credentials: Seq[Credentials],
logger: Option[CacheLogger],
cache: Option[File],
ivyHome: Option[File],
followHttpToHttpsRedirections: Option[Boolean],
strict: Option[Strict],
extraProjects: Vector[Project],
forceVersions: Vector[(Module, String)],
) =
this(
log,
resolvers,
parallelDownloads,
maxIterations,
sbtScalaOrganization,
sbtScalaVersion,
sbtScalaJars,
interProjectDependencies,
excludeDependencies,
fallbackDependencies,
autoScalaLibrary,
hasClassifiers,
classifiers,
mavenProfiles,
scalaOrganization,
scalaVersion,
authenticationByRepositoryId,
credentials,
logger,
cache,
ivyHome,
followHttpToHttpsRedirections,
strict,
extraProjects,
forceVersions,
Vector.empty
)
override def equals(o: Any): Boolean =
o match {
case other: CoursierConfiguration =>
log == other.log &&
resolvers == other.resolvers &&
parallelDownloads == other.parallelDownloads &&
maxIterations == other.maxIterations &&
sbtScalaOrganization == other.sbtScalaOrganization &&
sbtScalaVersion == other.sbtScalaVersion &&
sbtScalaJars == other.sbtScalaJars &&
interProjectDependencies == other.interProjectDependencies &&
excludeDependencies == other.excludeDependencies &&
fallbackDependencies == other.fallbackDependencies &&
autoScalaLibrary == other.autoScalaLibrary &&
hasClassifiers == other.hasClassifiers &&
classifiers == other.classifiers &&
mavenProfiles == other.mavenProfiles &&
scalaOrganization == other.scalaOrganization &&
scalaVersion == other.scalaVersion &&
authenticationByRepositoryId == other.authenticationByRepositoryId &&
credentials == other.credentials &&
logger == other.logger &&
cache == other.cache &&
ivyHome == other.ivyHome &&
followHttpToHttpsRedirections == other.followHttpToHttpsRedirections &&
strict == other.strict &&
extraProjects == other.extraProjects &&
forceVersions == other.forceVersions &&
reconciliation == other.reconciliation
case _ => false
}
override def hashCode: Int = {
var code = 37 * (17 + "lmcoursier.CoursierConfiguration".##)
code = 37 * (code + log.##)
code = 37 * (code + resolvers.##)
code = 37 * (code + parallelDownloads.##)
code = 37 * (code + maxIterations.##)
code = 37 * (code + sbtScalaOrganization.##)
code = 37 * (code + sbtScalaVersion.##)
code = 37 * (code + sbtScalaJars.##)
code = 37 * (code + interProjectDependencies.##)
code = 37 * (code + excludeDependencies.##)
code = 37 * (code + fallbackDependencies.##)
code = 37 * (code + autoScalaLibrary.##)
code = 37 * (code + hasClassifiers.##)
code = 37 * (code + classifiers.##)
code = 37 * (code + mavenProfiles.##)
code = 37 * (code + scalaOrganization.##)
code = 37 * (code + scalaVersion.##)
code = 37 * (code + authenticationByRepositoryId.##)
code = 37 * (code + credentials.##)
code = 37 * (code + logger.##)
code = 37 * (code + cache.##)
code = 37 * (code + ivyHome.##)
code = 37 * (code + followHttpToHttpsRedirections.##)
code = 37 * (code + strict.##)
code = 37 * (code + extraProjects.##)
code = 37 * (code + forceVersions.##)
code = 37 * (code + reconciliation.##)
code
}
override def toString: String =
s"CoursierConfiguration($log, $resolvers, $parallelDownloads, $maxIterations, $sbtScalaOrganization, $sbtScalaVersion, $sbtScalaJars, $interProjectDependencies, $excludeDependencies, $fallbackDependencies, $autoScalaLibrary, $hasClassifiers, $classifiers, $mavenProfiles, $scalaOrganization, $scalaVersion, $authenticationByRepositoryId, $credentials, $logger, $cache, $ivyHome, $followHttpToHttpsRedirections, $strict, $extraProjects, $forceVersions)"
private[this] def copy(
log: Option[Logger] = log,
resolvers: Vector[Resolver] = resolvers,
parallelDownloads: Int = parallelDownloads,
maxIterations: Int = maxIterations,
sbtScalaOrganization: Option[String] = sbtScalaOrganization,
sbtScalaVersion: Option[String] = sbtScalaVersion,
sbtScalaJars: Vector[File] = sbtScalaJars,
interProjectDependencies: Vector[Project] = interProjectDependencies,
excludeDependencies: Vector[(String, String)] = excludeDependencies,
fallbackDependencies: Vector[FallbackDependency] = fallbackDependencies,
autoScalaLibrary: Boolean = autoScalaLibrary,
hasClassifiers: Boolean = hasClassifiers,
classifiers: Vector[String] = classifiers,
mavenProfiles: Vector[String] = mavenProfiles,
scalaOrganization: Option[String] = scalaOrganization,
scalaVersion: Option[String] = scalaVersion,
authenticationByRepositoryId: Vector[(String, Authentication)] = authenticationByRepositoryId,
credentials: Seq[Credentials] = credentials,
logger: Option[CacheLogger] = logger,
cache: Option[File] = cache,
ivyHome: Option[File] = ivyHome,
followHttpToHttpsRedirections: Option[Boolean] = followHttpToHttpsRedirections,
strict: Option[Strict] = strict,
extraProjects: Vector[Project] = extraProjects,
forceVersions: Vector[(Module, String)] = forceVersions,
reconciliation: Vector[(ModuleMatchers, Reconciliation)] = reconciliation
): CoursierConfiguration =
new CoursierConfiguration(
log,
resolvers,
parallelDownloads,
maxIterations,
sbtScalaOrganization,
sbtScalaVersion,
sbtScalaJars,
interProjectDependencies,
excludeDependencies,
fallbackDependencies,
autoScalaLibrary,
hasClassifiers,
classifiers,
mavenProfiles,
scalaOrganization,
scalaVersion,
authenticationByRepositoryId,
credentials,
logger,
cache,
ivyHome,
followHttpToHttpsRedirections,
strict,
extraProjects,
forceVersions,
reconciliation
)
def withLog(log: Option[Logger]): CoursierConfiguration =
copy(log = log)
def withLog(log: Logger): CoursierConfiguration = def withLog(log: Logger): CoursierConfiguration =
copy(log = Option(log)) withLog(Option(log))
def withResolvers(resolvers: Vector[Resolver]): CoursierConfiguration =
copy(resolvers = resolvers)
def withParallelDownloads(parallelDownloads: Int): CoursierConfiguration =
copy(parallelDownloads = parallelDownloads)
def withMaxIterations(maxIterations: Int): CoursierConfiguration =
copy(maxIterations = maxIterations)
def withSbtScalaOrganization(sbtScalaOrganization: Option[String]): CoursierConfiguration =
copy(sbtScalaOrganization = sbtScalaOrganization)
def withSbtScalaOrganization(sbtScalaOrganization: String): CoursierConfiguration = def withSbtScalaOrganization(sbtScalaOrganization: String): CoursierConfiguration =
copy(sbtScalaOrganization = Option(sbtScalaOrganization)) withSbtScalaOrganization(Option(sbtScalaOrganization))
def withSbtScalaVersion(sbtScalaVersion: Option[String]): CoursierConfiguration =
copy(sbtScalaVersion = sbtScalaVersion)
def withSbtScalaVersion(sbtScalaVersion: String): CoursierConfiguration = def withSbtScalaVersion(sbtScalaVersion: String): CoursierConfiguration =
copy(sbtScalaVersion = Option(sbtScalaVersion)) withSbtScalaVersion(Option(sbtScalaVersion))
def withSbtScalaJars(sbtScalaJars: Vector[File]): CoursierConfiguration =
copy(sbtScalaJars = sbtScalaJars)
def withInterProjectDependencies(interProjectDependencies: Vector[Project]): CoursierConfiguration =
copy(interProjectDependencies = interProjectDependencies)
def withExcludeDependencies(excludeDependencies: Vector[(String, String)]): CoursierConfiguration =
copy(excludeDependencies = excludeDependencies)
def withFallbackDependencies(fallbackDependencies: Vector[FallbackDependency]): CoursierConfiguration =
copy(fallbackDependencies = fallbackDependencies)
def withAutoScalaLibrary(autoScalaLibrary: Boolean): CoursierConfiguration =
copy(autoScalaLibrary = autoScalaLibrary)
def withHasClassifiers(hasClassifiers: Boolean): CoursierConfiguration =
copy(hasClassifiers = hasClassifiers)
def withClassifiers(classifiers: Vector[String]): CoursierConfiguration =
copy(classifiers = classifiers)
def withMavenProfiles(mavenProfiles: Vector[String]): CoursierConfiguration =
copy(mavenProfiles = mavenProfiles)
def withScalaOrganization(scalaOrganization: Option[String]): CoursierConfiguration =
copy(scalaOrganization = scalaOrganization)
def withScalaOrganization(scalaOrganization: String): CoursierConfiguration = def withScalaOrganization(scalaOrganization: String): CoursierConfiguration =
copy(scalaOrganization = Option(scalaOrganization)) withScalaOrganization(Option(scalaOrganization))
def withScalaVersion(scalaVersion: Option[String]): CoursierConfiguration =
copy(scalaVersion = scalaVersion)
def withScalaVersion(scalaVersion: String): CoursierConfiguration = def withScalaVersion(scalaVersion: String): CoursierConfiguration =
copy(scalaVersion = Option(scalaVersion)) withScalaVersion(Option(scalaVersion))
def withAuthenticationByRepositoryId(authenticationByRepositoryId: Vector[(String, Authentication)]): CoursierConfiguration =
copy(authenticationByRepositoryId = authenticationByRepositoryId)
def withCredentials(credentials: Seq[Credentials]): CoursierConfiguration =
copy(credentials = credentials)
def withLogger(logger: Option[CacheLogger]): CoursierConfiguration =
copy(logger = logger)
def withLogger(logger: CacheLogger): CoursierConfiguration = def withLogger(logger: CacheLogger): CoursierConfiguration =
copy(logger = Option(logger)) withLogger(Option(logger))
def withCache(cache: Option[File]): CoursierConfiguration =
copy(cache = cache)
def withCache(cache: File): CoursierConfiguration = def withCache(cache: File): CoursierConfiguration =
copy(cache = Option(cache)) withCache(Option(cache))
def withIvyHome(ivyHomeOpt: Option[File]): CoursierConfiguration =
copy(ivyHome = ivyHomeOpt)
def withIvyHome(ivyHome: File): CoursierConfiguration = def withIvyHome(ivyHome: File): CoursierConfiguration =
copy(ivyHome = Option(ivyHome)) withIvyHome(Option(ivyHome))
def withFollowHttpToHttpsRedirections(followHttpToHttpsRedirectionsOpt: Option[Boolean]): CoursierConfiguration =
copy(followHttpToHttpsRedirections = followHttpToHttpsRedirectionsOpt)
def withFollowHttpToHttpsRedirections(followHttpToHttpsRedirections: Boolean): CoursierConfiguration = def withFollowHttpToHttpsRedirections(followHttpToHttpsRedirections: Boolean): CoursierConfiguration =
copy(followHttpToHttpsRedirections = Some(followHttpToHttpsRedirections)) withFollowHttpToHttpsRedirections(Some(followHttpToHttpsRedirections))
def withFollowHttpToHttpsRedirections(): CoursierConfiguration = def withFollowHttpToHttpsRedirections(): CoursierConfiguration =
copy(followHttpToHttpsRedirections = Some(true)) withFollowHttpToHttpsRedirections(Some(true))
def withStrict(strict: Strict): CoursierConfiguration = def withStrict(strict: Strict): CoursierConfiguration =
copy(strict = Some(strict)) withStrict(Some(strict))
def withStrict(strictOpt: Option[Strict]): CoursierConfiguration =
copy(strict = strictOpt)
def withExtraProjects(extraProjects: Vector[Project]): CoursierConfiguration =
copy(extraProjects = extraProjects)
def withForceVersions(forceVersions: Vector[(Module, String)]): CoursierConfiguration =
copy(forceVersions = forceVersions)
def withReconciliation(reconciliation: Vector[(ModuleMatchers, Reconciliation)]): CoursierConfiguration =
copy(reconciliation = reconciliation)
} }
object CoursierConfiguration { object CoursierConfiguration {
def apply(): CoursierConfiguration =
new CoursierConfiguration()
def apply(
log: Option[Logger],
resolvers: Vector[Resolver],
parallelDownloads: Int,
maxIterations: Int,
sbtScalaOrganization: Option[String],
sbtScalaVersion: Option[String],
sbtScalaJars: Vector[File],
interProjectDependencies: Vector[Project],
excludeDependencies: Vector[(String, String)],
fallbackDependencies: Vector[FallbackDependency],
autoScalaLibrary: Boolean,
hasClassifiers: Boolean,
classifiers: Vector[String],
mavenProfiles: Vector[String],
scalaOrganization: Option[String],
scalaVersion: Option[String],
authenticationByRepositoryId: Vector[(String, Authentication)],
credentials: Seq[Credentials],
logger: Option[CacheLogger],
cache: Option[File]
): CoursierConfiguration =
new CoursierConfiguration(
log,
resolvers,
parallelDownloads,
maxIterations,
sbtScalaOrganization,
sbtScalaVersion,
sbtScalaJars,
interProjectDependencies,
excludeDependencies,
fallbackDependencies,
autoScalaLibrary,
hasClassifiers,
classifiers,
mavenProfiles,
scalaOrganization,
scalaVersion,
authenticationByRepositoryId,
credentials,
logger,
cache,
None,
None,
None,
Vector.empty,
Vector.empty,
Vector.empty
)
def apply( def apply(
log: Logger, log: Logger,
resolvers: Vector[Resolver], resolvers: Vector[Resolver],
parallelDownloads: Int, parallelDownloads: Int,
maxIterations: Int, maxIterations: Int,
sbtScalaOrganization: String, sbtScalaOrganization: String,
sbtScalaVersion: String, sbtScalaVersion: String,
sbtScalaJars: Vector[File], sbtScalaJars: Vector[File],
interProjectDependencies: Vector[Project], interProjectDependencies: Vector[Project],
excludeDependencies: Vector[(String, String)], excludeDependencies: Vector[(String, String)],
fallbackDependencies: Vector[FallbackDependency], fallbackDependencies: Vector[FallbackDependency],
autoScalaLibrary: Boolean, autoScalaLibrary: Boolean,
hasClassifiers: Boolean, hasClassifiers: Boolean,
classifiers: Vector[String], classifiers: Vector[String],
mavenProfiles: Vector[String], mavenProfiles: Vector[String],
scalaOrganization: String, scalaOrganization: String,
scalaVersion: String, scalaVersion: String,
authenticationByRepositoryId: Vector[(String, Authentication)], authenticationByRepositoryId: Vector[(String, Authentication)],
credentials: Seq[Credentials], credentials: Seq[Credentials],
logger: CacheLogger, logger: CacheLogger,
cache: File cache: File
): CoursierConfiguration = ): CoursierConfiguration =
new CoursierConfiguration( CoursierConfiguration(
Option(log), Option(log),
resolvers,
parallelDownloads,
maxIterations,
Option(sbtScalaOrganization),
Option(sbtScalaVersion),
sbtScalaJars,
interProjectDependencies,
excludeDependencies,
fallbackDependencies,
autoScalaLibrary,
hasClassifiers,
classifiers,
mavenProfiles,
Option(scalaOrganization),
Option(scalaVersion),
authenticationByRepositoryId,
credentials,
Option(logger),
Option(cache),
None,
None,
None,
Vector.empty,
Vector.empty,
Vector.empty
)
def apply(
log: Option[Logger],
resolvers: Vector[Resolver],
parallelDownloads: Int,
maxIterations: Int,
sbtScalaOrganization: Option[String],
sbtScalaVersion: Option[String],
sbtScalaJars: Vector[File],
interProjectDependencies: Vector[Project],
excludeDependencies: Vector[(String, String)],
fallbackDependencies: Vector[FallbackDependency],
autoScalaLibrary: Boolean,
hasClassifiers: Boolean,
classifiers: Vector[String],
mavenProfiles: Vector[String],
scalaOrganization: Option[String],
scalaVersion: Option[String],
authenticationByRepositoryId: Vector[(String, Authentication)],
credentials: Seq[Credentials],
logger: Option[CacheLogger],
cache: Option[File],
ivyHome: Option[File]
): CoursierConfiguration =
new CoursierConfiguration(
log,
resolvers, resolvers,
parallelDownloads, parallelDownloads,
maxIterations, maxIterations,
sbtScalaOrganization, Option(sbtScalaOrganization),
sbtScalaVersion, Option(sbtScalaVersion),
sbtScalaJars, sbtScalaJars,
interProjectDependencies, interProjectDependencies,
excludeDependencies, excludeDependencies,
@ -556,17 +103,11 @@ object CoursierConfiguration {
hasClassifiers, hasClassifiers,
classifiers, classifiers,
mavenProfiles, mavenProfiles,
scalaOrganization, Option(scalaOrganization),
scalaVersion, Option(scalaVersion),
authenticationByRepositoryId, authenticationByRepositoryId,
credentials, credentials,
logger, Option(logger),
cache, Option(cache),
ivyHome,
None,
None,
Vector.empty,
Vector.empty,
Vector.empty
) )
} }

View File

@ -1,44 +1,13 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier package lmcoursier
final class FallbackDependency private (
val module: lmcoursier.definitions.Module, import java.net.URL
val version: String,
val url: java.net.URL, import dataclass.data
val changing: Boolean) extends Serializable { import lmcoursier.definitions.Module
@data class FallbackDependency(
module: Module,
override def equals(o: Any): Boolean = o match { version: String,
case x: FallbackDependency => (this.module == x.module) && (this.version == x.version) && (this.url == x.url) && (this.changing == x.changing) url: URL,
case _ => false changing: Boolean
} )
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

@ -1,62 +1,30 @@
package lmcoursier.credentials package lmcoursier.credentials
final class DirectCredentials private( import dataclass._
val host: String,
val username: String, @data class DirectCredentials(
val password: String, host: String = "",
val realm: Option[String], username: String = "",
val optional: Boolean, password: String = "",
val matchHost: Boolean, @since
val httpsOnly: Boolean realm: Option[String] = None,
@since
optional: Boolean = true,
@since
matchHost: Boolean = false,
httpsOnly: Boolean = true
) extends Credentials { ) extends Credentials {
private def this() = this("", "", "", None, true, false, true) def withRealm(realm: String): DirectCredentials =
private def this(host: String, username: String, password: String) = this(host, username, password, None, true, false, true) withRealm(Option(realm))
private def this(host: String, username: String, password: String, realm: Option[String]) = this(host, username, password, realm, true, false, true)
private def this(host: String, username: String, password: String, realm: Option[String], optional: Boolean) = this(host, username, password, realm, optional, false, true)
override def equals(o: Any): Boolean = o match { override def toString(): String =
case x: DirectCredentials => (this.host == x.host) && (this.username == x.username) && (this.password == x.password) && (this.realm == x.realm) && (this.optional == x.optional) && (this.matchHost == x.matchHost) && (this.httpsOnly == x.httpsOnly) withPassword("****")
case _ => false .productIterator
} .mkString("DirectCredentials(", ", ", ")")
override def hashCode: Int = {
37 * (37 * (37 * (37 * (37 * (37 * (37 * (37 * (17 + "lmcoursier.credentials.DirectCredentials".##) + host.##) + username.##) + password.##) + realm.##) + optional.##) + matchHost.##) + httpsOnly.##)
}
override def toString: String = {
"Credentials(" + host + ", " + username + ", " + "****" + ", " + realm + ", " + optional + ", " + matchHost + ", " + httpsOnly + ")"
}
private[this] def copy(host: String = host, username: String = username, password: String = password, realm: Option[String] = realm, optional: Boolean = optional, matchHost: Boolean = matchHost, httpsOnly: Boolean = httpsOnly): DirectCredentials = {
new DirectCredentials(host, username, password, realm, optional, matchHost, httpsOnly)
}
def withHost(host: String): DirectCredentials = {
copy(host = host)
}
def withUsername(username: String): DirectCredentials = {
copy(username = username)
}
def withPassword(password: String): DirectCredentials = {
copy(password = password)
}
def withRealm(realm: Option[String]): DirectCredentials = {
copy(realm = realm)
}
def withRealm(realm: String): DirectCredentials = {
copy(realm = Option(realm))
}
def withOptional(optional: Boolean): DirectCredentials = {
copy(optional = optional)
}
def withMatchHost(matchHost: Boolean): DirectCredentials =
copy(matchHost = matchHost)
def withHttpsOnly(httpsOnly: Boolean): DirectCredentials =
copy(httpsOnly = httpsOnly)
} }
object DirectCredentials { object DirectCredentials {
def apply(host: String, username: String, password: String, realm: String): DirectCredentials = DirectCredentials(host, username, password, Option(realm))
def apply(): DirectCredentials = new DirectCredentials() def apply(host: String, username: String, password: String, realm: String, optional: Boolean): DirectCredentials = DirectCredentials(host, username, password, Option(realm), optional)
def apply(host: String, username: String, password: String): DirectCredentials = new DirectCredentials(host, username, password)
def apply(host: String, username: String, password: String, realm: Option[String]): DirectCredentials = new DirectCredentials(host, username, password, realm)
def apply(host: String, username: String, password: String, realm: String): DirectCredentials = new DirectCredentials(host, username, password, Option(realm))
def apply(host: String, username: String, password: String, realm: Option[String], optional: Boolean): DirectCredentials = new DirectCredentials(host, username, password, realm, optional)
def apply(host: String, username: String, password: String, realm: String, optional: Boolean): DirectCredentials = new DirectCredentials(host, username, password, Option(realm), optional)
} }

View File

@ -1,34 +1,8 @@
package lmcoursier.credentials package lmcoursier.credentials
final class FileCredentials private( import dataclass.data
val path: String,
val optional: Boolean
) extends Credentials {
private def this(path: String) = this(path, true) @data class FileCredentials(
path: String,
override def equals(o: Any): Boolean = o match { optional: Boolean = true
case x: FileCredentials => (this.path == x.path) && (this.optional == x.optional) ) extends Credentials
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (17 + "lmcoursier.credentials.CredentialFile".##) + path.##) + optional.##)
}
override def toString: String = {
"CredentialFile(" + path + ", " + optional + ")"
}
private[this] def copy(path: String = path, optional: Boolean = optional): FileCredentials = {
new FileCredentials(path, optional)
}
def withPath(path: String): FileCredentials = {
copy(path = path)
}
def withOptional(optional: Boolean): FileCredentials = {
copy(optional = optional)
}
}
object FileCredentials {
def apply(path: String): FileCredentials = new FileCredentials(path)
def apply(path: String, optional: Boolean): FileCredentials = new FileCredentials(path, optional)
}

View File

@ -1,35 +1,8 @@
package lmcoursier.definitions package lmcoursier.definitions
final class Attributes private ( import dataclass.data
val `type`: Type,
val classifier: Classifier
) {
override def equals(obj: Any): Boolean = @data class Attributes(
obj match { `type`: Type,
case other: Attributes => classifier: Classifier
`type` == other.`type` && classifier == other.classifier )
case _ => false
}
override def hashCode(): Int =
37 * (37 * (37 * (17 + "lmcoursier.definitions.Attributes".##) + `type`.##) + classifier.##)
override def toString: String =
s"Attributes(${`type`}, $classifier)"
private def copy(
`type`: Type = `type`,
classifier: Classifier = classifier
): Attributes =
new Attributes(`type`, classifier)
def withType(`type`: Type): Attributes =
copy(`type` = `type`)
def withClassifier(classifier: Classifier): Attributes =
copy(classifier = classifier)
}
object Attributes {
def apply(`type`: Type, classifier: Classifier): Attributes =
new Attributes(`type`, classifier)
}

View File

@ -1,45 +1,15 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions package lmcoursier.definitions
final class Authentication private (
val user: String, import dataclass.data
val password: String,
val optional: Boolean, @data class Authentication(
val realmOpt: Option[String]) extends Serializable { user: String,
password: String,
private def this(user: String, password: String) = this(user, password, false, None) optional: Boolean = false,
realmOpt: Option[String] = 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) override def toString(): String =
case _ => false withPassword("****")
} .productIterator
override def hashCode: Int = { .mkString("Authentication(", ", ", ")")
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,52 +1,12 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions package lmcoursier.definitions
final class DateTime private (
val year: Int, import dataclass.data
val month: Int,
val day: Int, @data class DateTime(
val hour: Int, year: Int,
val minute: Int, month: Int,
val second: Int) extends Serializable { day: Int,
hour: Int,
minute: Int,
second: Int
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

@ -1,57 +1,42 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions package lmcoursier.definitions
final class Dependency private (
val module: Module, import dataclass.data
val version: String,
val configuration: Configuration, @data class Dependency(
val exclusions: Set[(Organization, ModuleName)], module: Module,
val publication: Publication, version: String,
val optional: Boolean, configuration: Configuration,
val transitive: Boolean) extends Serializable { exclusions: Set[(Organization, ModuleName)],
publication: Publication,
optional: Boolean,
transitive: Boolean
) {
def attributes: Attributes = publication.attributes def attributes: Attributes = publication.attributes
def withAttributes(attributes: Attributes): Dependency = withPublication(publication.withType(attributes.`type`).withClassifier(attributes.classifier)) def withAttributes(attributes: Attributes): Dependency =
withPublication(
publication
override def equals(o: Any): Boolean = o match { .withType(attributes.`type`)
case x: Dependency => (this.module == x.module) && (this.version == x.version) && (this.configuration == x.configuration) && (this.exclusions == x.exclusions) && (this.publication == x.publication) && (this.optional == x.optional) && (this.transitive == x.transitive) .withClassifier(attributes.classifier)
case _ => false )
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (37 * (37 * (37 * (37 * (17 + "lmcoursier.definitions.Dependency".##) + module.##) + version.##) + configuration.##) + exclusions.##) + publication.##) + optional.##) + transitive.##)
}
override def toString: String = {
"Dependency(" + module + ", " + version + ", " + configuration + ", " + exclusions + ", " + publication + ", " + optional + ", " + transitive + ")"
}
private[this] def copy(module: Module = module, version: String = version, configuration: Configuration = configuration, exclusions: Set[(Organization, ModuleName)] = exclusions, publication: Publication = publication, optional: Boolean = optional, transitive: Boolean = transitive): Dependency = {
new Dependency(module, version, configuration, exclusions, publication, 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 withPublication(publication: Publication): Dependency = {
copy(publication = publication)
}
def withOptional(optional: Boolean): Dependency = {
copy(optional = optional)
}
def withTransitive(transitive: Boolean): Dependency = {
copy(transitive = transitive)
}
} }
object Dependency { 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, Publication("", attributes.`type`, Extension(""), attributes.classifier), optional, transitive) def apply(
def apply(module: Module, version: String, configuration: Configuration, exclusions: Set[(Organization, ModuleName)], publication: Publication, optional: Boolean, transitive: Boolean): Dependency = new Dependency(module, version, configuration, exclusions, publication, optional, transitive) module: Module,
version: String,
configuration: Configuration,
exclusions: Set[(Organization, ModuleName)],
attributes: Attributes,
optional: Boolean,
transitive: Boolean
): Dependency =
Dependency(
module,
version,
configuration,
exclusions,
Publication("", attributes.`type`, Extension(""), attributes.classifier),
optional,
transitive
)
} }

View File

@ -1,40 +1,9 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions package lmcoursier.definitions
final class Developer private (
val id: String, import dataclass.data
val name: String,
val url: String) extends Serializable { @data class Developer(
id: String,
name: String,
url: String
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,48 +1,11 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions package lmcoursier.definitions
final class Info private (
val description: String, import dataclass.data
val homePage: String,
val licenses: Seq[(String, Option[String])], @data class Info(
val developers: Seq[Developer], description: String,
val publication: Option[DateTime]) extends Serializable { homePage: String,
licenses: Seq[(String, Option[String])],
developers: Seq[Developer],
publication: Option[DateTime]
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,40 +1,8 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions package lmcoursier.definitions
final class Module private ( import dataclass.data
val organization: Organization,
val name: ModuleName, @data class Module(
val attributes: Map[String, String]) extends Serializable { organization: Organization,
name: ModuleName,
attributes: Map[String, String]
)
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,47 +1,20 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions package lmcoursier.definitions
import dataclass.data
/** /**
* @param exclude Use "*" in either organization or name to match any. * @param exclude Use "*" in either organization or name to match any.
* @param include Use "*" in either organization or name to match any. * @param include Use "*" in either organization or name to match any.
*/ */
final class ModuleMatchers private ( @data class ModuleMatchers(
val exclude: Set[lmcoursier.definitions.Module], exclude: Set[Module],
val include: Set[lmcoursier.definitions.Module], include: Set[Module],
val includeByDefault: Boolean) extends Serializable { includeByDefault: Boolean = true
)
private def this(exclude: Set[lmcoursier.definitions.Module], include: Set[lmcoursier.definitions.Module]) = this(exclude, include, true)
override def equals(o: Any): Boolean = o match {
case x: ModuleMatchers => (this.exclude == x.exclude) && (this.include == x.include) && (this.includeByDefault == x.includeByDefault)
case _ => false
}
override def hashCode: Int = {
37 * (37 * (37 * (37 * (17 + "lmcoursier.definitions.ModuleMatchers".##) + exclude.##) + include.##) + includeByDefault.##)
}
override def toString: String = {
"ModuleMatchers(" + exclude + ", " + include + ", " + includeByDefault + ")"
}
private[this] def copy(exclude: Set[lmcoursier.definitions.Module] = exclude, include: Set[lmcoursier.definitions.Module] = include, includeByDefault: Boolean = includeByDefault): ModuleMatchers = {
new ModuleMatchers(exclude, include, includeByDefault)
}
def withExclude(exclude: Set[lmcoursier.definitions.Module]): ModuleMatchers = {
copy(exclude = exclude)
}
def withInclude(include: Set[lmcoursier.definitions.Module]): ModuleMatchers = {
copy(include = include)
}
def withIncludeByDefault(includeByDefault: Boolean): ModuleMatchers = {
copy(includeByDefault = includeByDefault)
}
}
object ModuleMatchers { object ModuleMatchers {
/** ModuleMatchers that matches to any modules. */ def all: ModuleMatchers =
def all: ModuleMatchers = ModuleMatchers(Set.empty, Set.empty) ModuleMatchers(Set.empty, Set.empty)
def only(mod: Module): ModuleMatchers = ModuleMatchers(Set.empty, Set(mod), includeByDefault = false) def only(mod: Module): ModuleMatchers =
def apply(exclude: Set[lmcoursier.definitions.Module], include: Set[lmcoursier.definitions.Module]): ModuleMatchers = new ModuleMatchers(exclude, include) ModuleMatchers(Set.empty, Set(mod), includeByDefault = false)
def apply(exclude: Set[lmcoursier.definitions.Module], include: Set[lmcoursier.definitions.Module], includeByDefault: Boolean): ModuleMatchers = new ModuleMatchers(exclude, include, includeByDefault)
} }

View File

@ -1,60 +1,14 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions package lmcoursier.definitions
final class Project private (
val module: Module, import dataclass.data
val version: String,
val dependencies: Seq[(Configuration, Dependency)], @data class Project(
val configurations: Map[Configuration, Seq[Configuration]], module: Module,
val properties: Seq[(String, String)], version: String,
val packagingOpt: Option[Type], dependencies: Seq[(Configuration, Dependency)],
val publications: Seq[(Configuration, Publication)], configurations: Map[Configuration, Seq[Configuration]],
val info: Info) extends Serializable { properties: Seq[(String, String)],
packagingOpt: Option[Type],
publications: Seq[(Configuration, Publication)],
info: Info
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,45 +1,16 @@
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package lmcoursier.definitions package lmcoursier.definitions
final class Publication private (
val name: String, import dataclass.data
val `type`: Type,
val ext: Extension, @data class Publication(
val classifier: Classifier) extends Serializable { name: String,
def attributes: Attributes = Attributes(`type`, classifier) `type`: Type,
def withAttributes(attributes: Attributes): Publication = withType(attributes.`type`).withClassifier(attributes.classifier) ext: Extension,
classifier: Classifier
) {
override def equals(o: Any): Boolean = o match { def attributes: Attributes =
case x: Publication => (this.name == x.name) && (this.`type` == x.`type`) && (this.ext == x.ext) && (this.classifier == x.classifier) Attributes(`type`, classifier)
case _ => false def withAttributes(attributes: Attributes): Publication =
} withType(attributes.`type`)
override def hashCode: Int = { .withClassifier(attributes.classifier)
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,5 +1,7 @@
package lmcoursier.definitions package lmcoursier.definitions
sealed abstract class Reconciliation extends Serializable sealed abstract class Reconciliation extends Serializable
object Reconciliation { object Reconciliation {
case object Default extends Reconciliation case object Default extends Reconciliation
case object Relaxed extends Reconciliation case object Relaxed extends Reconciliation

View File

@ -1,55 +1,14 @@
package lmcoursier.definitions package lmcoursier.definitions
final class Strict private ( import dataclass.data
val include: Set[(String, String)],
val exclude: Set[(String, String)], @data class Strict(
val ignoreIfForcedVersion: Boolean include: Set[(String, String)] = Set(("*", "*")),
exclude: Set[(String, String)] = Set.empty,
ignoreIfForcedVersion: Boolean = true
) { ) {
override def equals(obj: Any): Boolean =
obj match {
case other: Strict =>
include == other.include &&
exclude == other.exclude &&
ignoreIfForcedVersion == other.ignoreIfForcedVersion
case _ =>
false
}
override def hashCode(): Int = {
var code = 17 + "lmcoursier.definitions.Strict".##
code = 37 * code + include.##
code = 37 * code + exclude.##
code = 37 * code + ignoreIfForcedVersion.##
37 * code
}
override def toString: String =
s"Strict($include, $exclude, $ignoreIfForcedVersion)"
private def copy(
include: Set[(String, String)] = include,
exclude: Set[(String, String)] = exclude,
ignoreIfForcedVersion: Boolean = ignoreIfForcedVersion
): Strict =
new Strict(include, exclude, ignoreIfForcedVersion)
def withInclude(include: Set[(String, String)]): Strict =
copy(include = include)
def addInclude(include: (String, String)*): Strict = def addInclude(include: (String, String)*): Strict =
copy(include = this.include ++ include) withInclude(this.include ++ include)
def withExclude(exclude: Set[(String, String)]): Strict =
copy(exclude = exclude)
def addExclude(exclude: (String, String)*): Strict = def addExclude(exclude: (String, String)*): Strict =
copy(exclude = this.exclude ++ exclude) withExclude(this.exclude ++ exclude)
def withIgnoreIfForcedVersion(ignoreIfForcedVersion: Boolean): Strict =
copy(ignoreIfForcedVersion = ignoreIfForcedVersion)
}
object Strict {
def apply(): Strict =
new Strict(Set(("*", "*")), Set.empty, ignoreIfForcedVersion = true)
} }

View File

@ -14,6 +14,11 @@ object Settings {
def sbt10Version = "1.0.2" def sbt10Version = "1.0.2"
private lazy val isAtLeastScala213 = Def.setting {
import Ordering.Implicits._
CrossVersion.partialVersion(scalaVersion.value).exists(_ >= (2, 13))
}
lazy val shared = Seq( lazy val shared = Seq(
resolvers += Resolver.sonatypeRepo("releases"), resolvers += Resolver.sonatypeRepo("releases"),
crossScalaVersions := Seq(scala212), crossScalaVersions := Seq(scala212),
@ -23,7 +28,15 @@ object Settings {
"-deprecation", "-deprecation",
"-language:higherKinds", "-language:higherKinds",
"-language:implicitConversions" "-language:implicitConversions"
) ),
libraryDependencies ++= {
if (isAtLeastScala213.value) Nil
else Seq(compilerPlugin("org.scalamacros" % s"paradise" % "2.1.1" cross CrossVersion.full))
},
scalacOptions ++= {
if (isAtLeastScala213.value) Seq("-Ymacro-annotations")
else Nil
}
) ++ { ) ++ {
val prop = sys.props.getOrElse("publish.javadoc", "").toLowerCase(Locale.ROOT) val prop = sys.props.getOrElse("publish.javadoc", "").toLowerCase(Locale.ROOT)
if (prop == "0" || prop == "false") if (prop == "0" || prop == "false")

View File

@ -1,17 +1,7 @@
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.4.31")
plugins_( addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.3.0")
"com.geirsson" % "sbt-ci-release" % "1.4.31",
"com.typesafe" % "sbt-mima-plugin" % "0.3.0",
"org.scala-sbt" % "sbt-contraband" % "0.4.4"
)
libs ++= Seq(
"org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
)
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "2.0.0-RC4") addSbtPlugin("io.get-coursier" % "sbt-coursier" % "2.0.0-RC4")
addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.0.0-RC4") addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.0.0-RC4")
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
def plugins_(modules: ModuleID*) = modules.map(addSbtPlugin)
def libs = libraryDependencies