-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from eed3si9n/wip/cross-build
Cross build to sbt 2.x
- Loading branch information
Showing
15 changed files
with
241 additions
and
146 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package sbt | ||
package sbtpgp | ||
|
||
import sbt.{ librarymanagement => lm } | ||
import sbt.internal.{ librarymanagement => ilm } | ||
import Keys._ | ||
import com.jsuereth.sbtpgp.PgpKeys._ | ||
import com.jsuereth.sbtpgp.gpgExtension | ||
|
||
object Compat { | ||
val IvyActions = ilm.IvyActions | ||
type IvySbt = ilm.IvySbt | ||
type IvyScala = lm.ScalaModuleInfo | ||
type UpdateConfiguration = lm.UpdateConfiguration | ||
type UnresolvedWarning = lm.UnresolvedWarning | ||
type UnresolvedWarningConfiguration = lm.UnresolvedWarningConfiguration | ||
val UnresolvedWarningConfiguration = lm.UnresolvedWarningConfiguration | ||
|
||
val ivyScala = Keys.scalaModuleInfo | ||
|
||
def pgpRequires: Plugins = sbt.plugins.IvyPlugin | ||
|
||
def subConfiguration(m: ModuleID, confs: Boolean): ModuleID = | ||
m.withConfigurations( | ||
if (confs) m.configurations | ||
else None | ||
) | ||
|
||
def subExplicitArtifacts(m: ModuleID, artifacts: Vector[Artifact]): ModuleID = | ||
m.withExplicitArtifacts(artifacts) | ||
|
||
// This hack to access private[sbt] | ||
def updateEither( | ||
module: IvySbt#Module, | ||
configuration: UpdateConfiguration, | ||
uwconfig: UnresolvedWarningConfiguration, | ||
logicalClock: LogicalClock, | ||
depDir: Option[File], | ||
log: Logger | ||
): Either[UnresolvedWarning, UpdateReport] = | ||
IvyActions.updateEither(module, configuration, uwconfig, log) | ||
|
||
val signedArtifacts = TaskKey[Map[Artifact, File]]( | ||
"signed-artifacts", | ||
"Packages all artifacts for publishing and maps the Artifact definition to the generated file." | ||
) | ||
|
||
def signingSettings0: Seq[Setting[_]] = Seq( | ||
// conditional | ||
signedArtifacts := { | ||
if (!(pgpSigner / skip).value) { | ||
val artifacts = packagedArtifacts.value | ||
val r = pgpSigner.value | ||
val s = streams.value | ||
artifacts flatMap { | ||
case (art, file) => | ||
Seq( | ||
art -> file, | ||
art.withExtension(art.extension + gpgExtension) -> r | ||
.sign(file, new File(file.getAbsolutePath + gpgExtension), s) | ||
) | ||
} | ||
} else packagedArtifacts.value | ||
} | ||
) | ||
|
||
def toFile(x: File, c: xsbti.FileConverter): File = x | ||
} |
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,72 @@ | ||
package sbt | ||
package sbtpgp | ||
|
||
import sbt.{ librarymanagement => lm } | ||
import sbt.internal.{ librarymanagement => ilm } | ||
import Keys._ | ||
import com.jsuereth.sbtpgp.PgpKeys._ | ||
import com.jsuereth.sbtpgp.gpgExtension | ||
|
||
object Compat { | ||
val IvyActions = ilm.IvyActions | ||
type IvySbt = ilm.IvySbt | ||
type IvyScala = lm.ScalaModuleInfo | ||
type UpdateConfiguration = lm.UpdateConfiguration | ||
type UnresolvedWarning = lm.UnresolvedWarning | ||
type UnresolvedWarningConfiguration = lm.UnresolvedWarningConfiguration | ||
val UnresolvedWarningConfiguration = lm.UnresolvedWarningConfiguration | ||
|
||
val ivyScala = Keys.scalaModuleInfo | ||
|
||
def pgpRequires: Plugins = sbt.plugins.IvyPlugin | ||
|
||
def subConfiguration(m: ModuleID, confs: Boolean): ModuleID = | ||
m.withConfigurations( | ||
if (confs) m.configurations | ||
else None | ||
) | ||
|
||
def subExplicitArtifacts(m: ModuleID, artifacts: Vector[Artifact]): ModuleID = | ||
m.withExplicitArtifacts(artifacts) | ||
|
||
// This hack to access private[sbt] | ||
def updateEither( | ||
module: IvySbt#Module, | ||
configuration: UpdateConfiguration, | ||
uwconfig: UnresolvedWarningConfiguration, | ||
logicalClock: LogicalClock, | ||
depDir: Option[File], | ||
log: Logger | ||
): Either[UnresolvedWarning, UpdateReport] = | ||
IvyActions.updateEither(module, configuration, uwconfig, log) | ||
|
||
val signedArtifacts = taskKey[Map[Artifact, xsbti.HashedVirtualFileRef]]( | ||
"Packages all artifacts for publishing and maps the Artifact definition to the generated file." | ||
) | ||
|
||
def signingSettings0: Seq[Setting[_]] = Seq( | ||
// conditional | ||
signedArtifacts := { | ||
if (!(pgpSigner / skip).value) { | ||
val artifacts = packagedArtifacts.value | ||
val r = pgpSigner.value | ||
val s = streams.value | ||
val c = fileConverter.value | ||
artifacts.flatMap { | ||
case (art, file) => | ||
val p = c.toPath(file) | ||
val signed = c.toVirtualFile( | ||
r.sign(p.toFile(), new File(p.toFile().getAbsolutePath + gpgExtension), s).toPath() | ||
) | ||
Seq( | ||
art -> file, | ||
art.withExtension(art.extension + gpgExtension) -> signed | ||
) | ||
} | ||
} else packagedArtifacts.value | ||
} | ||
) | ||
|
||
def toFile(vf: xsbti.HashedVirtualFileRef, c: xsbti.FileConverter): File = | ||
c.toPath(vf).toFile() | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.