Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade to SBT 1.2.8 #8

Merged
merged 1 commit into from
Oct 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ scriptedLaunchOpts := {

scriptedBufferLog := false

Global / onChangedBuildSource := ReloadOnSourceChanges
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not supported in 1.2.8.


description := "SBT plugin for publishing maven compatible POM for SBT plugins"
developers := List(
Developer(
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.2
sbt.version=1.2.8
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
addSbtPlugin("com.scalawilliam.esbeetee" % "sbt-vspp" % "0.4.11")
//addSbtPlugin("com.scalawilliam.esbeetee" % "sbt-vspp" % "0.4.11")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there was an SBT 1.2.8-compatible version, I wouldn't be doing this in the first place :)

You'll need to publish an 1.2.8-compatible version and re-enable that dependency.


addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.8")

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")
33 changes: 17 additions & 16 deletions src/main/scala/sbtconsistent/SbtConsistentPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sbtconsistent

import sbt.{Def, *}
import sbt.Keys.*
import sbt.{Def, _}
import sbt.Keys._

object SbtConsistentPlugin extends AutoPlugin {
// override def requires = sbt.plugins.SbtPlugin
Expand All @@ -16,9 +16,9 @@ object SbtConsistentPlugin extends AutoPlugin {
lazy val consistentPluginArtifacts = taskKey[Map[Artifact, File]]("Packages all artifacts for consistently publishing.")
}

import autoImport.*
import autoImport._

override lazy val globalSettings: Seq[Setting[?]] = Seq(
override lazy val globalSettings: Seq[Setting[_]] = Seq(
moduleIdTransformer := Seq(
(m: ModuleID) => {
val sbtV = (pluginCrossBuild / sbtBinaryVersion).value
Expand All @@ -31,7 +31,7 @@ object SbtConsistentPlugin extends AutoPlugin {
),
)

override lazy val projectSettings: Seq[Setting[?]] = Seq(
override lazy val projectSettings: Seq[Setting[_]] = Seq(

sbtCrossArtifactName := {
val artifactName = artifact.value.name
Expand Down Expand Up @@ -69,17 +69,18 @@ object SbtConsistentPlugin extends AutoPlugin {
// add the new pom to the list of artifact to be published.
artifacts += (makeProperPom / artifact).value,

consistentPluginArtifacts :=
(if (sbtPlugin.value) {
Map(
(Compile / packageBin / artifact).value.withName(sbtCrossArtifactName.value) -> (Compile / packageBin).value,
(Compile / packageDoc / artifact).value.withName(sbtCrossArtifactName.value) -> (Compile / packageDoc).value,
(Compile / packageSrc / artifact).value.withName(sbtCrossArtifactName.value) -> (Compile / packageSrc).value,
(makeProperPom / artifact).value -> makeProperPom.value)
} else {
Map.empty[Artifact, File]
}),

consistentPluginArtifacts := Def.taskDyn {
(if (sbtPlugin.value) Def.task {
Map(
(Compile / packageBin / artifact).value.withName(sbtCrossArtifactName.value) -> (Compile / packageBin).value,
(Compile / packageDoc / artifact).value.withName(sbtCrossArtifactName.value) -> (Compile / packageDoc).value,
(Compile / packageSrc / artifact).value.withName(sbtCrossArtifactName.value) -> (Compile / packageSrc).value,
(makeProperPom / artifact).value -> makeProperPom.value)

} else Def.task {
Map.empty[Artifact, File]
})
}.value,
packagedArtifacts ++= consistentPluginArtifacts.value,
)

Expand Down