Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/scala/sbtbuildinfo/BuildInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ object BuildInfo {
}

private def ident(scoped: Scoped): String = ident(scoped.scope, scoped.key)
private def ident(scoped: ScopedKey[_]): String = ident(scoped.scope, scoped.key)
private def ident(scoped: ScopedKey[?]): String = ident(scoped.scope, scoped.key)

private def ident(scope: Scope, attrKey: AttributeKey[_]): String = {
private def ident(scope: Scope, attrKey: AttributeKey[?]): String = {
val config = scope.config.toOption map (_.name) filter (_ != "compile")
val inTask = scope.task.toOption map (_.label)
val key = attrKey.label.split("-").toList match {
Expand All @@ -73,7 +73,7 @@ object BuildInfo {
Seq(config, inTask, Some(key)).flatten mkString "_"
}

private def ident(task: Task[_]): String =
private def ident(task: Task[?]): String =
taskName(task) match {
case Some(name) => name
case None =>
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/sbtbuildinfo/BuildInfoKeys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trait BuildInfoKeys {
lazy val buildInfoObject = settingKey[String]("The name for the generated object.")
lazy val buildInfoPackage = settingKey[String]("The name for the generated package.")
lazy val buildInfoUsePackageAsPath = settingKey[Boolean]("If true, the generated object is placed in the folder of the package instead of \"sbt-buildinfo\".")
lazy val buildInfoKeys = settingKey[Seq[PluginCompat.Entry[_]]]("Entries for build info.")
lazy val buildInfoKeys = settingKey[Seq[PluginCompat.Entry[?]]]("Entries for build info.")
lazy val buildInfoBuildNumber = taskKey[Int]("The build number.")
lazy val buildInfoOptions = settingKey[Seq[BuildInfoOption]]("Options for generating the build info.")
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/sbtbuildinfo/BuildInfoPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sbt.Plugins.Basic
import sbt.util.CacheImplicits.{ *, given }

object BuildInfoPlugin extends AutoPlugin {
type BuildInfoKey = PluginCompat.Entry[_]
type BuildInfoKey = PluginCompat.Entry[?]

override def requires = plugins.JvmPlugin

Expand Down Expand Up @@ -39,7 +39,7 @@ object BuildInfoPlugin extends AutoPlugin {
buildInfoRenderFactory := (if(scalaVersion.value.startsWith("3")) Scala3CaseObjectRenderer.apply else ScalaCaseObjectRenderer.apply)
)

override def projectSettings: Seq[Def.Setting[_]] = buildInfoScopedSettings(Compile) ++ buildInfoDefaultSettings
override def projectSettings: Seq[Def.Setting[?]] = buildInfoScopedSettings(Compile) ++ buildInfoDefaultSettings

def buildNumberTask(dir: File, increment: Int): Int = {
val file: File = dir / "buildinfo.properties"
Expand All @@ -61,7 +61,7 @@ object BuildInfoPlugin extends AutoPlugin {

import TupleSyntax._

def buildInfoScopedSettings(conf: Configuration): Seq[Def.Setting[_]] = inConfig(conf)(Seq(
def buildInfoScopedSettings(conf: Configuration): Seq[Def.Setting[?]] = inConfig(conf)(Seq(
buildInfo := Def.uncached((
RichRichTaskable11((
buildInfoRenderer,
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/sbtbuildinfo/JavaRenderer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ abstract class JavaRenderer(pkg: String, cl: String, makeStatic: Boolean) extend
case node: scala.xml.NodeSeq if node.toString().trim.nonEmpty => node.toString()
case node: scala.xml.NodeSeq => scala.xml.NodeSeq.Empty.toString()
case (k, _v) => "new java.util.AbstractMap.SimpleImmutableEntry<>(%s, %s)" format (quote(k), quote(_v))
case mp: Map[_, _] => mp.toList.map(quote(_)).mkString("internalAsMap(", ", ", ")")
case seq: collection.Seq[_] =>
case mp: Map[?, ?] => mp.toList.map(quote(_)).mkString("internalAsMap(", ", ", ")")
case seq: collection.Seq[?] =>
seq.map(quote).mkString("java.util.Collections.unmodifiableList(java.util.Arrays.asList(", ", ", "))")
case op: Option[_] =>
case op: Option[?] =>
op map { x => "java.util.Optional.of(" + quote(x) + ")" } getOrElse { "java.util.Optional.empty()" }
case url: java.net.URL => "internalAsUrl(%s)" format quote(url.toString)
case uri: java.net.URI => "internalAsUri(%s)" format quote(uri.toString)
case file: java.io.File => "new java.io.File(%s)" format quote(file.toString)
case attr: sbt.Attributed[_] => quote(attr.data)
case attr: sbt.Attributed[?] => quote(attr.data)
case date: java.time.LocalDate => "java.time.LocalDate.parse(%s)" format quote(date.toString)
case instant: java.time.Instant => "java.time.Instant.parse(%s)" format quote(instant.toString)
case s => "\"%s\"" format encodeStringLiteral(s.toString)
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/sbtbuildinfo/ScalaRenderer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ abstract class ScalaRenderer extends BuildInfoRenderer {
case node: scala.xml.NodeSeq if node.toString().trim.nonEmpty => node.toString()
case _: scala.xml.NodeSeq => "scala.xml.NodeSeq.Empty"
case (k, _v) => "(%s -> %s)" format(quote(k), quote(_v))
case mp: Map[_, _] => mp.toList.map(quote(_)).mkString("Map(", ", ", ")")
case seq: collection.Seq[_] => seq.map(quote).mkString("scala.collection.immutable.Seq(", ", ", ")")
case op: Option[_] => op map { x => "scala.Some(" + quote(x) + ")" } getOrElse {"scala.None"}
case mp: Map[?, ?] => mp.toList.map(quote(_)).mkString("Map(", ", ", ")")
case seq: collection.Seq[?] => seq.map(quote).mkString("scala.collection.immutable.Seq(", ", ", ")")
case op: Option[?] => op map { x => "scala.Some(" + quote(x) + ")" } getOrElse {"scala.None"}
case url: java.net.URL => "new java.net.URI(%s).toURL" format quote(url.toString)
case uri: java.net.URI => "new java.net.URI(%s)" format quote(uri.toString)
case file: java.io.File => "new java.io.File(%s)" format quote(file.toString)
case attr: sbt.Attributed[_] => quote(attr.data)
case attr: sbt.Attributed[?] => quote(attr.data)
case date: java.time.LocalDate => "java.time.LocalDate.parse(%s)" format quote(date.toString)
case instant: java.time.Instant => "java.time.Instant.parse(%s)" format quote(instant.toString)
case s => "\"%s\"" format encodeStringLiteral(s.toString)
Expand Down