DEFAULT

The scheme used when no scheme is set.

Layout: 1 | major(3) | minor(3) | patch(2) | rebuild(1).

1.4.0            ->  1001004000
1.4.0 rebuild 1 -> 1001004001
1.4.1 -> 1001004010
1.5.0 -> 1001005000

Ten numbers per version. The ceiling is 1999999999, comfortably under Google Play's 2100000000 cap. A version bump always outranks every rebuild of the version before it, so rebuild never needs resetting.

Limits: major and minor 0..999, patch 0..99, rebuild 0..9. Going over fails the build instead of producing a silently wrong number, and the message shows you how to bring your own scheme.

Need 100 rebuilds per version? Move a digit, at the cost of capping major at 99:

// 1.4.0 -> "1010040000", 1.4.0 rebuild 42 -> "1010040042"
scheme { v ->
fun pad(value: Int, width: Int) = value.toString().padStart(width, '0')
"1" + pad(v.major, 2) + pad(v.minor, 3) + pad(v.patch, 2) + pad(v.rebuild, 2)
}