-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Problem/Solution** This cross builds sbt-native-packager for sbt 1.x and 2.0.0-M3. Co-authored-by: João Ferreira <[email protected]>
- Loading branch information
1 parent
06f677b
commit 6b69d6c
Showing
184 changed files
with
1,148 additions
and
958 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
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.10.2 | ||
sbt.version=1.10.7 |
File renamed without changes.
46 changes: 46 additions & 0 deletions
46
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,46 @@ | ||
package com.typesafe.sbt.packager | ||
|
||
import java.nio.file.{Path => NioPath} | ||
import java.util.jar.Attributes | ||
import sbt.* | ||
import xsbti.FileConverter | ||
|
||
object PluginCompat { | ||
type FileRef = java.io.File | ||
type ArtifactPath = java.io.File | ||
type Out = java.io.File | ||
type IncludeArtifact = Artifact => Boolean | ||
|
||
val artifactStr = sbt.Keys.artifact.key | ||
val moduleIDStr = sbt.Keys.moduleID.key | ||
def parseModuleIDStrAttribute(m: ModuleID): ModuleID = m | ||
def moduleIDToStr(m: ModuleID): ModuleID = m | ||
private[packager] def parseArtifactStrAttribute(a: Artifact): Artifact = a | ||
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() | ||
def toFile(a: Attributed[File])(implicit conv: FileConverter): File = | ||
a.data | ||
def toFile(ref: File)(implicit conv: FileConverter): File = | ||
ref | ||
private[packager] def artifactPathToFile(ref: File)(implicit conv: FileConverter): File = | ||
ref | ||
private[packager] def toArtifactPath(f: File)(implicit conv: FileConverter): ArtifactPath = f | ||
private[packager] def toNioPaths(cp: Seq[Attributed[File]])(implicit conv: FileConverter): Vector[NioPath] = | ||
cp.map(_.data.toPath()).toVector | ||
private[packager] def toFiles(cp: Seq[Attributed[File]])(implicit conv: FileConverter): Vector[File] = | ||
cp.map(_.data).toVector | ||
def toFileRefsMapping(mappings: Seq[(File, String)])(implicit conv: FileConverter): Seq[(FileRef, String)] = | ||
mappings | ||
def toFileRef(x: File)(implicit conv: FileConverter): FileRef = | ||
x | ||
private[packager] def getName(ref: File): String = | ||
ref.getName() | ||
private[packager] def getArtifactPathName(ref: File): String = | ||
ref.getName() | ||
private[packager] def classpathAttr = Attributes.Name.CLASS_PATH | ||
private[packager] 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 {} |
60 changes: 60 additions & 0 deletions
60
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,60 @@ | ||
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 | ||
|
||
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) | ||
|
||
private[packager] 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)) | ||
|
||
private[packager] def toNioPath(a: Attributed[HashedVirtualFileRef])(using conv: FileConverter): NioPath = | ||
conv.toPath(a.data) | ||
private[packager] def toNioPath(ref: HashedVirtualFileRef)(using conv: FileConverter): NioPath = | ||
conv.toPath(ref) | ||
def toFile(a: Attributed[HashedVirtualFileRef])(using conv: FileConverter): File = | ||
toNioPath(a).toFile() | ||
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() | ||
private[packager] def toArtifactPath(f: File)(using conv: FileConverter): ArtifactPath = | ||
conv.toVirtualFile(f.toPath()) | ||
private[packager] def toNioPaths(cp: Seq[Attributed[HashedVirtualFileRef]])(using | ||
conv: FileConverter | ||
): Vector[NioPath] = | ||
cp.map(toNioPath).toVector | ||
private[packager] def toFiles(cp: Seq[Attributed[HashedVirtualFileRef]])(using conv: FileConverter): Vector[File] = | ||
toNioPaths(cp).map(_.toFile()) | ||
def toFileRefsMapping(mappings: Seq[(File, String)])(using conv: FileConverter): Seq[(FileRef, String)] = | ||
mappings.map { case (f, name) => toFileRef(f) -> name } | ||
def toFileRef(x: File)(using conv: FileConverter): FileRef = | ||
conv.toVirtualFile(x.toPath()) | ||
private[packager] def getName(ref: FileRef): String = | ||
ref.name() | ||
private[packager] def getArtifactPathName(ref: ArtifactPath): String = | ||
ref.name() | ||
private[packager] def classpathAttr: String = Attributes.Name.CLASS_PATH.toString() | ||
private[packager] def mainclassAttr: String = Attributes.Name.MAIN_CLASS.toString() | ||
} |
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.
Oops, something went wrong.