Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sbt task to increment project version

Tags:

scala

sbt

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.

like image 878
Brian Kent Avatar asked May 15 '14 14:05

Brian Kent


1 Answers

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".

like image 97
Jacek Laskowski Avatar answered Nov 05 '22 02:11

Jacek Laskowski