version

package version

Members list

Packages

package version.errors
package version.sbt
package version.semver

Type members

Classlikes

Provides universal policy constructors for CompatibilityPolicy.

Provides universal policy constructors for CompatibilityPolicy.

Attributes

Companion
trait
Source
CompatibilityPolicy.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Policy for determining API/binary compatibility between two versions.

Policy for determining API/binary compatibility between two versions.

Compatibility is a policy applied to versions, not an inherent property of the version itself. Multiple policies can exist for the same version type (following sbt's pattern: Strict, SemVer, EarlySemVer, PackVer).

Each scheme provides a default policy in its companion (found via implicit scope). Users override locally:

given CompatibilityPolicy[SemVer] = SemVer.compatibility.early
v1.isCompatibleWith(v2)  // uses early policy

Type parameters

V

The version type.

Attributes

Companion
object
Source
CompatibilityPolicy.scala
Supertypes
class Object
trait Matchable
class Any
final case class ComponentDescriptor(name: String, role: ComponentRole)

Describes a single version component position within a scheme.

Describes a single version component position within a scheme.

Pairs the component's name (e.g., "major", "minor", "patch") with its semantic ComponentRole. Each scheme declares its layout as an IArray[ComponentDescriptor], making it structurally impossible for names and roles to fall out of sync.

Value parameters

name

The component name used in commit-message keywords and display.

role

The semantic role of this component position.

Attributes

Companion
object
Source
ComponentDescriptor.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Provides instances for ComponentDescriptor.

Provides instances for ComponentDescriptor.

Attributes

Companion
class
Source
ComponentDescriptor.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Describes the semantic role of a version component position within a scheme.

Describes the semantic role of a version component position within a scheme.

Drives predictable keyword behaviour across schemes. For example, version: breaking in a commit message resolves to the component(s) with Breaking role, regardless of which scheme is in use.

Each scheme declares a layout: IArray[ComponentRole] mapping positions to roles. For multiple same-role positions (e.g., PVP has two Breaking), role-based keywords resolve to the last position with that role. Users who need a specific position use the component name directly.

Attributes

Companion
object
Source
ComponentRole.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ComponentRole

Attributes

Companion
enum
Source
ComponentRole.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class DevelopmentMetadata(branch: Option[String], commitSha: Option[String], commitCount: Option[Int], commitTime: Option[Long], prNumber: Option[Int], isDirty: Boolean)

Resolution context describing the state of the repository for development version construction.

Resolution context describing the state of the repository for development version construction.

This is a pure data aggregate carrying information from the resolution engine to a scheme's ResolvableScheme.developmentVersion implementation. The scheme uses this to construct a development version in its own format (e.g., SemVer uses -SNAPSHOT+metadata).

commitTime carries the basis commit's committer time in seconds since the Unix epoch (UTC). The scheme may render this in a sortable form so that snapshots of the same base sort chronologically as raw strings.

Attributes

Companion
object
Source
ResolvableScheme.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
ResolvableScheme.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Formatter[V <: Version]

Rendering strategy for a version of scheme V.

Rendering strategy for a version of scheme V.

Each scheme provides its own formatter instances in its companion (for example, SemVer.Formatter.Standard and SemVer.Formatter.Full). Scheme-specific configuration (such as SHA truncation for SemVer) lives on those instances, not on this trait.

Attributes

Source
Formatter.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Full
object Standard
transparent trait ResettableVersionComponent[T] extends VersionComponent[T]

Extends VersionComponent for components that have a defined reset value (typically the minimum value).

Extends VersionComponent for components that have a defined reset value (typically the minimum value).

Attributes

Source
VersionComponent.scala
Supertypes
trait VersionComponent[T]
trait Eq[T]
trait OpaqueType[T, Int]
class Object
trait Matchable
class Any
Show all
Known subtypes
object Major
object Minor
object Patch

Attributes

Companion
trait
Source
ResolvableScheme.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait ResolvableScheme[V <: Version] extends VersionArithmetic[V]

Full Git-based version resolution contract for schemes that support the complete resolution workflow.

Full Git-based version resolution contract for schemes that support the complete resolution workflow.

Extends VersionArithmetic because resolution requires component manipulation (incrementing after keyword parsing). A single given ResolvableScheme[V] in a scheme's companion satisfies VersionScheme[V], VersionArithmetic[V], and ResolvableScheme[V] via subtyping.

Type parameters

V

The version type.

Attributes

Companion
object
Source
ResolvableScheme.scala
Supertypes
trait VersionScheme[V]
class Object
trait Matchable
class Any
Known subtypes
object Utc

Renders a Unix epoch-seconds instant as a UTC timestamp without a java.time dependency - Scala Native ships only an Instant stub - using Howard Hinnant's civil-from-days algorithm.

Renders a Unix epoch-seconds instant as a UTC timestamp without a java.time dependency - Scala Native ships only an Instant stub - using Howard Hinnant's civil-from-days algorithm.

Attributes

Source
Utc.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Utc.type
trait Version

Family marker for any value that represents a version under some scheme.

Family marker for any value that represents a version under some scheme.

The only contract carried at this layer is a canonical string representation. All other operations (parsing, ordering, component manipulation, Git-based resolution, configurable rendering) live on VersionScheme, VersionArithmetic, ResolvableScheme, and Formatter and are dispatched by the per-scheme instance.

Attributes

Companion
object
Source
Version.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class SemVer
object Version

Provides companion aliases for Version.

Provides companion aliases for Version.

Attributes

Companion
trait
Source
Version.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Version.type
trait VersionArithmetic[V <: Version] extends VersionScheme[V]

Component manipulation for version schemes that support programmatic increment and set operations.

Component manipulation for version schemes that support programmatic increment and set operations.

Separated from ResolvableScheme because not all arithmetic-capable schemes support Git-based resolution (e.g., .NET Official supports increment/set but has no pre-release concept for resolution).

Type parameters

V

The version type.

Attributes

Companion
object
Source
VersionArithmetic.scala
Supertypes
trait VersionScheme[V]
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Source
VersionArithmetic.scala
Supertypes
class Object
trait Matchable
class Any
Self type
transparent trait VersionComponent[T] extends OpaqueType[T, Int], Eq[T]

Capability trait for opaque version components backed by Int.

Capability trait for opaque version components backed by Int.

Extends boilerplate.OpaqueType with version-specific semantics:

  • Minimum and maximum value validation
  • Increment operation with saturation at upper bound
  • Standard ordering

Subclasses override maximumValue for scheme-specific bounds (e.g., .NET components use 65535 for UInt16).

Type parameters

T

The opaque type itself.

Attributes

Source
VersionComponent.scala
Supertypes
trait Eq[T]
trait OpaqueType[T, Int]
class Object
trait Matchable
class Any
Known subtypes
object Major
object Minor
object Patch

Provides factory methods and combinators for VersionResolver.

Provides factory methods and combinators for VersionResolver.

Attributes

Companion
class
Source
VersionResolver.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class VersionResolver[V <: Version](scheme: ResolvableScheme[V], tagParser: String => Option[V], formatter: Option[Formatter[V]])

Bundles every scheme-typed piece of configuration the version pipeline needs: the ResolvableScheme instance, a Git tag parser, and the optional rendering Formatter.

Bundles every scheme-typed piece of configuration the version pipeline needs: the ResolvableScheme instance, a Git tag parser, and the optional rendering Formatter.

Bundling guarantees the three pieces share a single V parameter at the type level, so consumers cannot pair a scheme with a mismatched tag parser or formatter.

Instances may be constructed via VersionResolver.

Attributes

Companion
object
Source
VersionResolver.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object VersionScheme

Attributes

Companion
trait
Source
VersionScheme.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait VersionScheme[V <: Version]

Core contract for a versioning scheme.

Core contract for a versioning scheme.

Every version type provides an instance of this trait in its companion object, enabling scheme selection via Scala 3 implicit scope. When a type V appears as a type parameter, the compiler finds VersionScheme[V] in V's companion - no explicit import of givens required.

The ordering member is a plain def (not given) because implicit search does not recursively extract given members from given instances. Each scheme companion provides a standalone given Ordering[V] for direct implicit resolution, and this def for extraction by generic code.

Type parameters

V

The version type.

Attributes

Companion
object
Source
VersionScheme.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes