Permalink
Browse files

Ensure publishing signed things works fine

  • Loading branch information...
alexarchambault committed Aug 4, 2017
1 parent 930a012 commit d17e9b93b9a5d71abb17420457e3462251369d26
Showing with 158 additions and 13 deletions.
  1. +3 −0 sbt-coursier/src/main/scala-2.10/coursier/SbtCompatibility.scala
  2. +3 −0 sbt-coursier/src/main/scala-2.12/coursier/SbtCompatibility.scala
  3. +2 −5 sbt-coursier/src/main/scala/coursier/CoursierPlugin.scala
  4. +6 −8 sbt-coursier/src/main/scala/coursier/ToSbt.scala
  5. +3 −0 sbt-coursier/src/sbt-test/sbt-coursier-0.13/publish-local-signed/README
  6. +6 −0 sbt-coursier/src/sbt-test/sbt-coursier-0.13/publish-local-signed/build.sbt
  7. +13 −0 sbt-coursier/src/sbt-test/sbt-coursier-0.13/publish-local-signed/project/plugins.sbt
  8. +17 −0 sbt-coursier/src/sbt-test/sbt-coursier-0.13/publish-local-signed/pubring.pgp
  9. +32 −0 sbt-coursier/src/sbt-test/sbt-coursier-0.13/publish-local-signed/secring.pgp
  10. +1 −0 sbt-coursier/src/sbt-test/sbt-coursier-0.13/publish-local-signed/src/main/scala/Foo.scala
  11. +1 −0 sbt-coursier/src/sbt-test/sbt-coursier-0.13/publish-local-signed/test
  12. +3 −0 sbt-pgp-coursier/src/sbt-test/sbt-pgp-coursier/publish-local-signed/README
  13. +6 −0 sbt-pgp-coursier/src/sbt-test/sbt-pgp-coursier/publish-local-signed/build.sbt
  14. +11 −0 sbt-pgp-coursier/src/sbt-test/sbt-pgp-coursier/publish-local-signed/project/plugins.sbt
  15. +17 −0 sbt-pgp-coursier/src/sbt-test/sbt-pgp-coursier/publish-local-signed/pubring.pgp
  16. +32 −0 sbt-pgp-coursier/src/sbt-test/sbt-pgp-coursier/publish-local-signed/secring.pgp
  17. +1 −0 sbt-pgp-coursier/src/sbt-test/sbt-pgp-coursier/publish-local-signed/src/main/scala/Foo.scala
  18. +1 −0 sbt-pgp-coursier/src/sbt-test/sbt-pgp-coursier/publish-local-signed/test
@@ -141,4 +141,7 @@ object SbtCompatibility {
def dependencies = module.modules
}
def needsIvyXmlLocal = sbt.Keys.deliverLocalConfiguration
def needsIvyXml = sbt.Keys.deliverConfiguration
}
@@ -30,4 +30,7 @@ object SbtCompatibility {
full.prefix + scalaVersion + full.suffix
}
def needsIvyXmlLocal = sbt.Keys.publishLocalConfiguration
def needsIvyXml = sbt.Keys.publishConfiguration
}
@@ -5,8 +5,6 @@ import sbt.Keys._
import SbtCompatibility._
import coursier.core.ResolutionProcess
object CoursierPlugin extends AutoPlugin {
override def trigger = allRequirements
@@ -70,7 +68,6 @@ object CoursierPlugin extends AutoPlugin {
task: TaskKey[T],
shadedConfigOpt: Option[(String, String)]
): Setting[Task[T]] =
// not 100% sure that make writeFiles below happen before the actions triggered by task.value...
task := task.dependsOn(Def.task {
val currentProject = {
val proj = coursierProject.value
@@ -97,8 +94,8 @@ object CoursierPlugin extends AutoPlugin {
withClassifiers = true,
sbtClassifiers = true
).value,
makeIvyXmlBefore(publishLocalConfiguration, shadedConfigOpt),
makeIvyXmlBefore(publishConfiguration, shadedConfigOpt),
makeIvyXmlBefore(needsIvyXmlLocal, shadedConfigOpt),
makeIvyXmlBefore(needsIvyXml, shadedConfigOpt),
update := Tasks.updateTask(
shadedConfigOpt,
withClassifiers = false
@@ -1,12 +1,10 @@
package coursier
import java.io.File
import java.util.GregorianCalendar
import java.util.concurrent.ConcurrentHashMap
import coursier.maven.MavenSource
import sbt._
import SbtCompatibility._
object ToSbt {
@@ -50,7 +48,7 @@ object ToSbt {
.orElse(MavenSource.typeDefaultClassifierOpt(artifact.attributes.`type`))
)
// .withConfigurations(Vector())
.withUrl(Some(url(artifact.url)))
.withUrl(Some(sbt.url(artifact.url)))
.withExtraAttributes(module.attributes ++ extraProperties)
}
@@ -72,7 +70,7 @@ object ToSbt {
val callers = dependees.map {
case (dependee, dependeeProj) =>
Caller(
sbt.Caller(
ToSbt.moduleId(dependee, dependeeProj.properties.toMap),
dependeeProj.configurations.keys.toVector.map(ConfigRef(_)),
dependee.module.attributes ++ dependeeProj.properties,
@@ -223,17 +221,17 @@ object ToSbt {
includeSignatures = includeSignatures
)
ConfigurationReport(
sbt.ConfigurationReport(
ConfigRef(config),
reports.toVector,
Vector()
)
}
UpdateReport(
sbt.UpdateReport(
null,
configReports.toVector,
UpdateStats(-1L, -1L, -1L, cached = false),
sbt.UpdateStats(-1L, -1L, -1L, cached = false),
Map.empty
)
}
@@ -0,0 +1,3 @@
Only run with sbt 0.13 here - requires sbt-pgp-coursier with sbt 1.0
A few things from this test were grabbed from https://github.com/sbt/sbt-pgp/tree/431c0a50fc5e91b881ebb154f22cc6a0b209be10/pgp-plugin/src/sbt-test/sbt-pgp/skip
@@ -0,0 +1,6 @@
scalaVersion := "2.12.3"
// seen in https://github.com/sbt/sbt-pgp/blob/431c0a50fc5e91b881ebb154f22cc6a0b209be10/pgp-plugin/src/sbt-test/sbt-pgp/skip/build.sbt
credentials.in(GlobalScope) := Seq(Credentials("", "pgp", "", "test password"))
pgpSecretRing := baseDirectory.value / "secring.pgp"
pgpPublicRing := baseDirectory.value / "pubring.pgp"
@@ -0,0 +1,13 @@
{
val pluginVersion = sys.props.getOrElse(
"plugin.version",
throw new RuntimeException(
"""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin
)
)
addSbtPlugin("io.get-coursier" % "sbt-coursier" % pluginVersion)
}
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.1")
@@ -0,0 +1,17 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: BCPG v1.51
mQENBFVcLH0BCACmERkKh73zr+0nFl7/6WWP3QcNa3msWDlArP6GzQEOmFBNZEtv
1BRSKz1fGl4aZzpNPDh2rNcsjVhJPzwVLUzsJuWgBa2EdYafnsUjQ37V998iFhtZ
ZgbXieJ2yMvaNPPrPjgYBAZFrnQmH0oQDx+GWDd5Y3lQBx0heIJA5YjPN3meDzqZ
FC0qxSVeCPFYaxAFoMn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U3olklnZly8T853NCQxt3hp5FeL4qDMenh9rWEtoDYFPtNPW2tgfYvo4j
pVtwR5ufP66nvfyWIer2n9Emsk/gmMvNa0SQvzekToUeFejCx1obxYph9ZGy1ftG
LEerk/Xc9b+IBkQCYlvTwRGaaC6KJyMTFGTtRohXAo9rk/UMA6B4r96MIuzGtQqy
kiC3oktAVumsZkdF0Q==
=wGX/
-----END PGP PRIVATE KEY BLOCK-----
@@ -0,0 +1 @@
> publishLocalSigned
@@ -0,0 +1,3 @@
See a similar test under sbt-coursier/src/sbt-test/sbt-coursier-0.13/publish-local-signed
A few things from this test were grabbed from https://github.com/sbt/sbt-pgp/tree/431c0a50fc5e91b881ebb154f22cc6a0b209be10/pgp-plugin/src/sbt-test/sbt-pgp/skip
@@ -0,0 +1,6 @@
scalaVersion := "2.12.3"
// seen in https://github.com/sbt/sbt-pgp/blob/431c0a50fc5e91b881ebb154f22cc6a0b209be10/pgp-plugin/src/sbt-test/sbt-pgp/skip/build.sbt
credentials.in(GlobalScope) := Seq(Credentials("", "pgp", "", "test password"))
pgpSecretRing := baseDirectory.value / "secring.pgp"
pgpPublicRing := baseDirectory.value / "pubring.pgp"
@@ -0,0 +1,11 @@
{
val pluginVersion = sys.props.getOrElse(
"plugin.version",
throw new RuntimeException(
"""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin
)
)
addSbtPlugin("io.get-coursier" % "sbt-pgp-coursier" % pluginVersion)
}
@@ -0,0 +1,17 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: BCPG v1.51
mQENBFVcLH0BCACmERkKh73zr+0nFl7/6WWP3QcNa3msWDlArP6GzQEOmFBNZEtv
1BRSKz1fGl4aZzpNPDh2rNcsjVhJPzwVLUzsJuWgBa2EdYafnsUjQ37V998iFhtZ
ZgbXieJ2yMvaNPPrPjgYBAZFrnQmH0oQDx+GWDd5Y3lQBx0heIJA5YjPN3meDzqZ
FC0qxSVeCPFYaxAFoMnNDEohpvGV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T853NCQxt3hp5FeL4qDMenh9rWEtoDYFPtNPW2tgfYvo4j
pVtwR5ufP66nvfyWIer2n9Emsk/gmMvNa0SQvzekToUeFejCx1obxYph9ZGy1ftG
LEerk/Xc9b+IBkQCYlvTwRGaaC6KJyMTFGTtRohXAo9rk/UMA6B4r96MIuzGtQqy
kiC3oktAVumsZkdF0Q==
=wGX/
-----END PGP PRIVATE KEY BLOCK-----
@@ -0,0 +1 @@
> publishLocalSigned

0 comments on commit d17e9b9

Please sign in to comment.