-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
735 additions
and
697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
src/main/scala-2.12/com/typesafe/sbt/packager/PluginCompat.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.typesafe.sbt.packager | ||
|
||
import java.nio.file.{Path => NioPath} | ||
import java.util.jar.Attributes | ||
import sbt.* | ||
import xsbti.{FileConverter, HashedVirtualFileRef, VirtualFile} | ||
|
||
private[packager] object PluginCompat { | ||
type FileRef = java.io.File | ||
type ArtifactPath = java.io.File | ||
type Out = java.io.File | ||
|
||
def toNioPath(a: Attributed[File])(implicit conv: FileConverter): NioPath = | ||
a.data.toPath() | ||
def toFile(a: Attributed[File])(implicit conv: FileConverter): File = | ||
a.data | ||
def artifactPathToFile(ref: File)(implicit conv: FileConverter): File = | ||
ref | ||
def toNioPaths(cp: Seq[Attributed[File]])(implicit conv: FileConverter): Vector[NioPath] = | ||
cp.map(_.data.toPath()).toVector | ||
def toFiles(cp: Seq[Attributed[File]])(implicit conv: FileConverter): Vector[File] = | ||
cp.map(_.data).toVector | ||
|
||
def classpathAttr = Attributes.Name.CLASS_PATH | ||
def mainclassAttr = Attributes.Name.MAIN_CLASS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.typesafe.sbt.packager | ||
|
||
object Compat {} |
56 changes: 56 additions & 0 deletions
56
src/main/scala-3/com/typesafe/sbt/packager/PluginCompat.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.typesafe.sbt.packager | ||
|
||
import java.io.File | ||
import java.nio.file.{ Path => NioPath } | ||
import java.util.jar.Attributes | ||
import sbt.* | ||
import xsbti.{ FileConverter, HashedVirtualFileRef, VirtualFile, VirtualFileRef } | ||
import sbt.internal.RemoteCache | ||
|
||
private[packager] object PluginCompat: | ||
type FileRef = HashedVirtualFileRef | ||
type ArtifactPath = VirtualFileRef | ||
type Out = VirtualFile | ||
type IncludeArtifact = Any => Boolean | ||
|
||
val artifactStr = Keys.artifactStr | ||
val moduleIDStr = Keys.moduleIDStr | ||
def parseModuleIDStrAttribute(str: String): ModuleID = | ||
Classpaths.moduleIdJsonKeyFormat.read(str) | ||
def moduleIDToStr(m: ModuleID): String = | ||
Classpaths.moduleIdJsonKeyFormat.write(m) | ||
|
||
def parseArtifactStrAttribute(str: String): Artifact = | ||
import sbt.librarymanagement.LibraryManagementCodec.ArtifactFormat | ||
import sjsonnew.support.scalajson.unsafe.* | ||
Converter.fromJsonUnsafe[Artifact](Parser.parseUnsafe(str)) | ||
def artifactToStr(art: Artifact): String = | ||
import sbt.librarymanagement.LibraryManagementCodec.ArtifactFormat | ||
import sjsonnew.support.scalajson.unsafe.* | ||
CompactPrinter(Converter.toJsonUnsafe(art)) | ||
|
||
def toNioPath(a: Attributed[HashedVirtualFileRef])(using conv: FileConverter): NioPath = | ||
conv.toPath(a.data) | ||
def toNioPath(ref: HashedVirtualFileRef)(using conv: FileConverter): NioPath = | ||
conv.toPath(ref) | ||
inline def toFile(a: Attributed[HashedVirtualFileRef])(using conv: FileConverter): File = | ||
toNioPath(a).toFile() | ||
inline def toFile(ref: HashedVirtualFileRef)(using conv: FileConverter): File = | ||
toNioPath(ref).toFile() | ||
def artifactPathToFile(ref: VirtualFileRef)(using conv: FileConverter): File = | ||
conv.toPath(ref).toFile() | ||
def toArtifactPath(f: File)(using conv: FileConverter): ArtifactPath = | ||
conv.toVirtualFile(f.toPath()) | ||
def toNioPaths(cp: Seq[Attributed[HashedVirtualFileRef]])(using conv: FileConverter): Vector[NioPath] = | ||
cp.map(toNioPath).toVector | ||
inline def toFiles(cp: Seq[Attributed[HashedVirtualFileRef]])(using conv: FileConverter): Vector[File] = | ||
toNioPaths(cp).map(_.toFile()) | ||
def toFileRef(x: File)(using conv: FileConverter): FileRef = | ||
conv.toVirtualFile(x.toPath()) | ||
def getName(ref: FileRef): String = | ||
ref.name() | ||
def getArtifactPathName(ref: ArtifactPath): String = | ||
ref.name() | ||
def classpathAttr: String = Attributes.Name.CLASS_PATH.toString() | ||
def mainclassAttr: String = Attributes.Name.MAIN_CLASS.toString() | ||
end PluginCompat |
50 changes: 0 additions & 50 deletions
50
src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala
This file was deleted.
Oops, something went wrong.
130 changes: 0 additions & 130 deletions
130
src/main/scala-sbt-0.13/com/typesafe/sbt/packager/MappingsHelper.scala
This file was deleted.
Oops, something went wrong.
90 changes: 0 additions & 90 deletions
90
src/main/scala-sbt-0.13/com/typesafe/sbt/packager/SettingsHelper.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.