Skip to content

Commit

Permalink
Merge pull request #535 from eed3si9n/wip/type
Browse files Browse the repository at this point in the history
Update the types
  • Loading branch information
eed3si9n authored Oct 6, 2024
2 parents be1a81c + 627862b commit ec377e5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
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

0 comments on commit ec377e5

Please sign in to comment.