Code Monkey home page Code Monkey logo

semantic-versioning-kmp's Introduction

Kotlin version MavenCentral Snapshot

Build Coverage Quality Tech debt

SEMANTIC VERSIONING KMP

A Kotlin Multiplatform library to work with semantic versioning

Download

implementation("com.javiersc.semver:semver-core:$version")

Usage

A Version must match the following format:

<major>.<minor>.<patch?>-<stage?.name>.<stage?.num>

patch and stage can be null.

Build a Version

There are 3 options to build a Version.

Passing a version: String

Version("1.0.0")

Version("1.0.0-alpha.1")

Version("12.23.34-alpha.45")

Passing a version: String and a stage: String?

Version("1.0.0", "alpha.1")

Version("12.23.34", "alpha.45")

Passing all params; major: Int, minor: Int, patch: Int?, stage: String?, and num: Int?

Version(1, 0, 0)

Version(1, 0, 0, "alpha", 1)

Version(12, 23, 34, "alpha", 45)

Compare two Version

Version("1.0.1") > Version("1.0.0") // true 

Version("1.0.1") < Version("1.0.0") // false

Version("1.0.0") == Version("1.0.0") // true

Increase a Version

Version("2.4.6-alpha.1").inc(Version.Increase.Patch) // 2.4.7 (stage and num are removed)
Version("2.4.6").inc(Version.Increase.Patch) // 2.4.7
Version("2.4.6").inc(Version.Increase.Minor) // 2.5.0 (patch is reset to 0)
Version("2.4.6").inc(Version.Increase.Major) // 3.0.0 (minor and patch are reset to 0)

// minor and patch are reset to 0, stage and num are removed
Version("2.4.6-beta.4").inc(Version.Increase.Major) // 3.0.0

Copy a Version

Version("1.1.0-alpha.1").copy(major = 3) // 3.1.0-alpha.1

semantic-versioning-kmp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

semantic-versioning-kmp's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/apply-format.yaml
  • JavierSegoviaCordoba/reusable-workflows main
.github/workflows/apply-kotlin-upgrade-yarn-lock.yaml
  • JavierSegoviaCordoba/reusable-workflows main
.github/workflows/build-changelog-renovate-bot.yaml
  • JavierSegoviaCordoba/reusable-workflows main
.github/workflows/build-kotlin-dispatcher.yaml
  • JavierSegoviaCordoba/reusable-workflows main
.github/workflows/build-kotlin.yaml
  • JavierSegoviaCordoba/reusable-workflows main
.github/workflows/dump-api.yaml
  • JavierSegoviaCordoba/reusable-workflows main
.github/workflows/generate-version-tag.yaml
  • JavierSegoviaCordoba/reusable-workflows main
.github/workflows/publish-kotlin.yaml
  • JavierSegoviaCordoba/reusable-workflows main
gradle
gradle.properties
settings.gradle.kts
build.gradle.kts
gradle/libs.versions.toml
  • com.javiersc.hubdle 0.7.0
semver-core/build.gradle.kts
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.9

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.