diff --git a/src/main/scala-2.12/PluginCompat.scala b/src/main/scala-2.12/PluginCompat.scala index d4476cc..b649714 100644 --- a/src/main/scala-2.12/PluginCompat.scala +++ b/src/main/scala-2.12/PluginCompat.scala @@ -10,6 +10,7 @@ import sbt.util.Tracked.{ inputChanged, lastOutput } import xsbti.FileConverter private[sbtassembly] object PluginCompat { + type FileRef = java.io.File type Out = java.io.File type MainClass = sbt.Package.MainClass diff --git a/src/main/scala-3/PluginCompat.scala b/src/main/scala-3/PluginCompat.scala index 8027bc6..a1dbe24 100644 --- a/src/main/scala-3/PluginCompat.scala +++ b/src/main/scala-3/PluginCompat.scala @@ -5,10 +5,11 @@ import java.nio.file.{ Path => NioPath } import java.util.jar.{ Manifest => JManifest } import sbt.* import sbt.librarymanagement.ModuleID -import xsbti.{ FileConverter, HashedVirtualFileRef } +import xsbti.{ FileConverter, HashedVirtualFileRef, VirtualFile } object PluginCompat: - type Out = HashedVirtualFileRef + type FileRef = HashedVirtualFileRef + type Out = VirtualFile type JarManifest = PackageOption.JarManifest type MainClass = PackageOption.MainClass type ManifestAttributes = PackageOption.ManifestAttributes @@ -24,7 +25,7 @@ object PluginCompat: conv.toPath(a.data) inline def toFile(a: Attributed[HashedVirtualFileRef])(implicit conv: FileConverter): File = toNioPath(a).toFile() - def toOutput(x: File)(implicit conv: FileConverter): HashedVirtualFileRef = + def toOutput(x: File)(implicit conv: FileConverter): VirtualFile = conv.toVirtualFile(x.toPath()) def toNioPaths(cp: Seq[Attributed[HashedVirtualFileRef]])(implicit conv: FileConverter): Vector[NioPath] = cp.map(toNioPath).toVector diff --git a/src/main/scala/sbtassembly/Assembly.scala b/src/main/scala/sbtassembly/Assembly.scala index a92820f..0051aab 100644 --- a/src/main/scala/sbtassembly/Assembly.scala +++ b/src/main/scala/sbtassembly/Assembly.scala @@ -170,7 +170,7 @@ object Assembly { val jarName: String = s"$name${if (version.nonEmpty) "-" else ""}$version.jar" } - def assemblyTask(key: TaskKey[PluginCompat.Out]): Initialize[Task[PluginCompat.Out]] = Def.task { + def assemblyTask(key: TaskKey[PluginCompat.FileRef]): Initialize[Task[PluginCompat.Out]] = Def.task { val t = (key / test).value val s = (key / streams).value val conv = fileConverter.value diff --git a/src/main/scala/sbtassembly/AssemblyKeys.scala b/src/main/scala/sbtassembly/AssemblyKeys.scala index 3396915..ab84bea 100644 --- a/src/main/scala/sbtassembly/AssemblyKeys.scala +++ b/src/main/scala/sbtassembly/AssemblyKeys.scala @@ -5,11 +5,11 @@ import sbt.Keys.* import sbt.* trait AssemblyKeys { - lazy val assembly = taskKey[PluginCompat.Out]("Builds a deployable über JAR") + lazy val assembly = taskKey[PluginCompat.FileRef]("Builds a deployable über JAR") lazy val assembleArtifact = settingKey[Boolean]("Enables (true) or disables (false) assembling an artifact") lazy val assemblyOption = taskKey[AssemblyOption]("Configuration for making a deployable über JAR") - lazy val assemblyPackageScala = taskKey[PluginCompat.Out]("Produces the Scala artifact") - lazy val assemblyPackageDependency = taskKey[PluginCompat.Out]("Produces the dependency artifact") + lazy val assemblyPackageScala = taskKey[PluginCompat.FileRef]("Produces the Scala artifact") + lazy val assemblyPackageDependency = taskKey[PluginCompat.FileRef]("Produces the dependency artifact") lazy val assemblyJarName = taskKey[String]("name of the über jar") lazy val assemblyDefaultJarName = taskKey[String]("default name of the über jar") lazy val assemblyOutputPath = taskKey[File]("output path of the über jar")