Domanda

Is there an SBT task to increment a project's version?

Given an initial configuration of something like the following build.sbt

name := 'My Project'

organization := 'org.example'

version := '0.1.0'

and a versioning nomenclature of major.minor.patch, I was hoping for an SBT task like

> incrementVersionPatch

that would result in a version of 0.1.1.

(Ideally also the corresponding incrementVersionMinor and incrementVersionMajor.)

I feel like this must already exist but cannot find a way to do it.

È stato utile?

Soluzione

I think what you need is sbt-release plugin that "provides a customizable release process that you can add to your project." with "the setting release-version-file, which is set to file("version.sbt") by default and points to $PROJECT_ROOT/version.sbt".

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top