Skip to content

Commit

Permalink
Merge pull request #196 from dwijnand/build-and-publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Feb 1, 2021
2 parents 5214ab8 + 49a8373 commit 463749d
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 167 deletions.
41 changes: 13 additions & 28 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
val dynverRoot = project.in(file("."))
val dynverP = LocalProject("dynver")
aggregateProjects(dynverP, sbtdynver)
aggregateProjects(dynverLib, sbtdynver)

inThisBuild(List(
organization := "com.dwijnand",
Expand Down Expand Up @@ -29,45 +28,31 @@ inThisBuild(List(
Test / parallelExecution := true,
))

val dynver = project.settings(
val dynverLib = LocalProject("dynver")
val dynver = project.settings(
libraryDependencies += "org.eclipse.jgit" % "org.eclipse.jgit" % "5.10.0.202012080955-r" % Test,
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.15.2" % Test,

resolvers += Resolver.sbtPluginRepo("releases"), // for prev artifacts, not repo1 b/c of mergly publishing
publishSettings,
publishMavenStyle := false, // so it's resolved out of sbt-plugin-releases as a dep of sbt-dynver
)

val sbtdynver = project.dependsOn(dynverP).enablePlugins(SbtPlugin).settings(
name := "sbt-dynver",

scriptedLaunchOpts ++= Seq("-Xmx1024M", "-XX:MaxPermSize=256M", "-Dplugin.version=" + version.value),
val sbtdynver = project.dependsOn(dynverLib).enablePlugins(SbtPlugin).settings(
name := "sbt-dynver",
scriptedBufferLog := true,
scriptedDependencies := Seq(dynver / publishLocal, publishLocal).dependOn.value,

scriptedLaunchOpts += s"-Dplugin.version=${version.value}",
scriptedLaunchOpts += s"-Dsbt.boot.directory=${file(sys.props("user.home")) / ".sbt" / "boot"}",
publishSettings,
)

lazy val publishSettings = Def.settings(
mimaSettings,
bintrayPackage := "sbt-dynver", // keep publishing to the same place
bintrayRepository := "sbt-plugins",
MimaSettings.mimaSettings,
bintrayPackage := "sbt-dynver", // keep publishing to the same place
bintrayRepository := "sbt-plugins",
bintray / resolvers := Nil, // disable getting my bintray repo through my local credentials; be like CI
)

import com.typesafe.tools.mima.core._
lazy val mimaSettings = Seq(
mimaPreviousArtifacts := Set(projID.value.withRevision("5.0.0-M2")),
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[Problem]("*.impl.*"), // impl is for internal implementation details
),
)

lazy val projID = Def.setting {
// Using projectID something is wrong... Looks for dynver_2.12 but artifacts are name=dynver
val sbtBv = (pluginCrossBuild / sbtBinaryVersion).value
val sbv = (pluginCrossBuild / scalaBinaryVersion).value
val mid = organization.value %% moduleName.value % "0.0.0"
if (sbtPlugin.value) Defaults.sbtPluginExtra(mid, sbtBv, sbv) else mid
}

mimaPreviousArtifacts := Set.empty
publish / skip := true

Expand Down
17 changes: 0 additions & 17 deletions notes/1.0.0.markdown

This file was deleted.

19 changes: 0 additions & 19 deletions notes/1.1.0.markdown

This file was deleted.

8 changes: 0 additions & 8 deletions notes/1.1.1.markdown

This file was deleted.

9 changes: 0 additions & 9 deletions notes/1.2.0.markdown

This file was deleted.

8 changes: 0 additions & 8 deletions notes/1.3.0.markdown

This file was deleted.

15 changes: 0 additions & 15 deletions notes/2.0.0.markdown

This file was deleted.

8 changes: 0 additions & 8 deletions notes/2.1.0.markdown

This file was deleted.

36 changes: 0 additions & 36 deletions notes/3.0.0.markdown

This file was deleted.

15 changes: 0 additions & 15 deletions notes/3.1.0.markdown

This file was deleted.

4 changes: 0 additions & 4 deletions notes/about.markdown

This file was deleted.

28 changes: 28 additions & 0 deletions project/MimaSettings.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import sbt._, Keys._
import sbt.Classpaths.pluginProjectID

import com.typesafe.tools.mima.core._
import com.typesafe.tools.mima.core.ProblemFilters.exclude
import com.typesafe.tools.mima.plugin.MimaPlugin.autoImport._

object MimaSettings {
// clear out mimaBinaryIssueFilters when changing this
val mimaPreviousVersion = "5.0.0-M2"

val projID = Def.setting {
// Using projectID something is wrong... Looks for dynver_2.12 but artifacts are name=dynver
// Even pluginProjectID.value.withExplicitArtifacts(Vector())) doesn't work here..?
val sbtBv = (pluginCrossBuild / sbtBinaryVersion).value
val sbv = (pluginCrossBuild / scalaBinaryVersion).value
val mid = organization.value %% moduleName.value % version.value
if (sbtPlugin.value) Defaults.sbtPluginExtra(mid, sbtBv, sbv) else mid
}

val mimaSettings = Def.settings (
mimaPreviousArtifacts := Set.empty, // Set(projID.value.withRevision(mimaPreviousVersion)),
mimaReportSignatureProblems := true,
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[Problem]("*.impl.*"), // KEEP: impl is for internal implementation details
),
)
}

0 comments on commit 463749d

Please sign in to comment.