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

Maintain binary compatibility across minor versions #137

Merged
merged 1 commit into from
Jan 15, 2020
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
6 changes: 3 additions & 3 deletions docs/src/main/mdoc/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Vulcan provides Avro schemas, encoders, and decoders between Scala types and typ

- Derivation of schemas, encoders, and decoders for `case class`es and `sealed trait`s.

Documentation is kept up-to-date with new releases, currently documenting v@LATEST_VERSION@ on Scala @DOCS_SCALA_MINOR_VERSION@.
Documentation is kept up-to-date, currently documenting v@LATEST_VERSION@ on Scala @DOCS_SCALA_MINOR_VERSION@.

## Getting Started

Expand Down Expand Up @@ -69,8 +69,8 @@ Stable release artifacts are signed with the [`7AD5 92B5 B105 24E3`](https://key

### Compatibility

Backwards binary-compatibility for the library is guaranteed between patch versions.<br>
For example, `@LATEST_MINOR_VERSION@.x` is backwards binary-compatible with `@LATEST_MINOR_VERSION@.y` for any `x > y`.
Backwards binary-compatibility for the library is guaranteed between minor and patch versions.<br>
Version `@LATEST_MAJOR_VERSION@.a.b` is backwards binary-compatible with `@LATEST_MAJOR_VERSION@.c.d` for any `a > c` or `a = c` and `b > d`.

Please note binary-compatibility is not guaranteed between milestone releases.

Expand Down
7 changes: 6 additions & 1 deletion docs/src/main/scala/vulcan/docs/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ object Main {
s"$major.$minor"
}

def majorVersion(version: String): String = {
val Array(major, _, _) = version.split('.')
major
}

def minorVersionsString(versions: Seq[String]): String = {
val minorVersions = versions.map(minorVersion)
if (minorVersions.size <= 2) minorVersions.mkString(" and ")
Expand All @@ -37,7 +42,7 @@ object Main {
"REFINED_CROSS_SCALA_VERSIONS" -> minorVersionsString(refinedCrossScalaVersions),
"LATEST_VERSION" -> latestVersion,
"LATEST_SNAPSHOT_VERSION" -> latestSnapshotVersion,
"LATEST_MINOR_VERSION" -> minorVersion(latestVersion),
"LATEST_MAJOR_VERSION" -> majorVersion(latestVersion),
"DOCS_SCALA_MINOR_VERSION" -> scalaMinorVersion,
"SCALA_PUBLISH_VERSIONS" -> minorVersionsString(crossScalaVersions),
"API_BASE_URL" -> s"/vulcan/api/vulcan",
Expand Down