diff --git a/src/main/scala-2.12/com/typesafe/sbt/packager/PluginCompat.scala b/src/main/scala-2.12/com/typesafe/sbt/packager/PluginCompat.scala index 1aec9bf4a..d77117090 100644 --- a/src/main/scala-2.12/com/typesafe/sbt/packager/PluginCompat.scala +++ b/src/main/scala-2.12/com/typesafe/sbt/packager/PluginCompat.scala @@ -11,20 +11,20 @@ object PluginCompat { type Out = java.io.File type IncludeArtifact = Artifact => Boolean - private[packager] val artifactStr = sbt.Keys.artifact.key - private[packager] val moduleIDStr = sbt.Keys.moduleID.key + val artifactStr = sbt.Keys.artifact.key + val moduleIDStr = sbt.Keys.moduleID.key private[packager] def parseModuleIDStrAttribute(m: ModuleID): ModuleID = m - private[packager] def moduleIDToStr(m: ModuleID): ModuleID = m + def moduleIDToStr(m: ModuleID): ModuleID = m private[packager] def parseArtifactStrAttribute(a: Artifact): Artifact = a - private[packager] def artifactToStr(art: Artifact): Artifact = art + def artifactToStr(art: Artifact): Artifact = art private[packager] def toNioPath(a: Attributed[File])(implicit conv: FileConverter): NioPath = a.data.toPath() private[packager] def toNioPath(ref: File)(implicit conv: FileConverter): NioPath = ref.toPath() - private[packager] def toFile(a: Attributed[File])(implicit conv: FileConverter): File = + def toFile(a: Attributed[File])(implicit conv: FileConverter): File = a.data - private[packager] def toFile(ref: File)(implicit conv: FileConverter): File = + def toFile(ref: File)(implicit conv: FileConverter): File = ref private[packager] def artifactPathToFile(ref: File)(implicit conv: FileConverter): File = ref @@ -33,11 +33,9 @@ object PluginCompat { cp.map(_.data.toPath()).toVector private[packager] def toFiles(cp: Seq[Attributed[File]])(implicit conv: FileConverter): Vector[File] = cp.map(_.data).toVector - private[packager] def toFileRefsMapping(mappings: Seq[(File, String)])(implicit - conv: FileConverter - ): Seq[(FileRef, String)] = + def toFileRefsMapping(mappings: Seq[(File, String)])(implicit conv: FileConverter): Seq[(FileRef, String)] = mappings - private[packager] def toFileRef(x: File)(implicit conv: FileConverter): FileRef = + def toFileRef(x: File)(implicit conv: FileConverter): FileRef = x private[packager] def getName(ref: File): String = ref.getName() diff --git a/src/main/scala-3/com/typesafe/sbt/packager/PluginCompat.scala b/src/main/scala-3/com/typesafe/sbt/packager/PluginCompat.scala index 301f735f5..494de10fb 100644 --- a/src/main/scala-3/com/typesafe/sbt/packager/PluginCompat.scala +++ b/src/main/scala-3/com/typesafe/sbt/packager/PluginCompat.scala @@ -13,18 +13,18 @@ object PluginCompat { type Out = VirtualFile type IncludeArtifact = Any => Boolean - private[packager] val artifactStr = Keys.artifactStr - private[packager] val moduleIDStr = Keys.moduleIDStr - private[packager] def parseModuleIDStrAttribute(str: String): ModuleID = + val artifactStr = Keys.artifactStr + val moduleIDStr = Keys.moduleIDStr + def parseModuleIDStrAttribute(str: String): ModuleID = Classpaths.moduleIdJsonKeyFormat.read(str) - private[packager] def moduleIDToStr(m: ModuleID): String = + def moduleIDToStr(m: ModuleID): String = Classpaths.moduleIdJsonKeyFormat.write(m) private[packager] def parseArtifactStrAttribute(str: String): Artifact = import sbt.librarymanagement.LibraryManagementCodec.ArtifactFormat import sjsonnew.support.scalajson.unsafe.* Converter.fromJsonUnsafe[Artifact](Parser.parseUnsafe(str)) - private[packager] def artifactToStr(art: Artifact): String = + def artifactToStr(art: Artifact): String = import sbt.librarymanagement.LibraryManagementCodec.ArtifactFormat import sjsonnew.support.scalajson.unsafe.* CompactPrinter(Converter.toJsonUnsafe(art)) @@ -33,9 +33,9 @@ object PluginCompat { conv.toPath(a.data) private[packager] def toNioPath(ref: HashedVirtualFileRef)(using conv: FileConverter): NioPath = conv.toPath(ref) - private[packager] def toFile(a: Attributed[HashedVirtualFileRef])(using conv: FileConverter): File = + def toFile(a: Attributed[HashedVirtualFileRef])(using conv: FileConverter): File = toNioPath(a).toFile() - private[packager] def toFile(ref: HashedVirtualFileRef)(using conv: FileConverter): File = + def toFile(ref: HashedVirtualFileRef)(using conv: FileConverter): File = toNioPath(ref).toFile() private[packager] def artifactPathToFile(ref: VirtualFileRef)(using conv: FileConverter): File = conv.toPath(ref).toFile() @@ -47,11 +47,9 @@ object PluginCompat { cp.map(toNioPath).toVector private[packager] def toFiles(cp: Seq[Attributed[HashedVirtualFileRef]])(using conv: FileConverter): Vector[File] = toNioPaths(cp).map(_.toFile()) - private[packager] def toFileRefsMapping(mappings: Seq[(File, String)])(using - conv: FileConverter - ): Seq[(FileRef, String)] = + def toFileRefsMapping(mappings: Seq[(File, String)])(using conv: FileConverter): Seq[(FileRef, String)] = mappings.map { case (f, name) => toFileRef(f) -> name } - private[packager] def toFileRef(x: File)(using conv: FileConverter): FileRef = + def toFileRef(x: File)(using conv: FileConverter): FileRef = conv.toVirtualFile(x.toPath()) private[packager] def getName(ref: FileRef): String = ref.name()