diff --git a/core/src/main/contraband-scala/sbt/librarymanagement/MakePomConfiguration.scala b/core/src/main/contraband-scala/sbt/librarymanagement/MakePomConfiguration.scala new file mode 100644 index 000000000..5570f01c6 --- /dev/null +++ b/core/src/main/contraband-scala/sbt/librarymanagement/MakePomConfiguration.scala @@ -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) +} diff --git a/core/src/main/contraband/librarymanagement2.json b/core/src/main/contraband/librarymanagement2.json new file mode 100644 index 000000000..2c9d3d6cf --- /dev/null +++ b/core/src/main/contraband/librarymanagement2.json @@ -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" + } + ] +} diff --git a/core/src/main/scala/sbt/librarymanagement/MakePomConfiguration.scala b/core/src/main/scala/sbt/librarymanagement/MakePomConfiguration.scala index aec1c2a07..1b5edbb9c 100644 --- a/core/src/main/scala/sbt/librarymanagement/MakePomConfiguration.scala +++ b/core/src/main/scala/sbt/librarymanagement/MakePomConfiguration.scala @@ -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) + ) }