Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the types #535

Merged
merged 1 commit into from
Oct 6, 2024
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
1 change: 1 addition & 0 deletions src/main/scala-2.12/PluginCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions src/main/scala-3/PluginCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/sbtassembly/Assembly.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/sbtassembly/AssemblyKeys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading