gabrielrobert / xavtool

Xplat Automating Version Tool
https://gabrielrobert.github.io/xavtool/
MIT License
35 stars 2 forks source link

Major.Minor.Patch.Revision format #11

Closed jerone closed 6 years ago

jerone commented 6 years ago

When running the tool at an Windows app, it throws an exception because the version is recognized by SemVer. Windows uses a fourth number as revision, which does not exists in SemVer.

Version = A version string in quad notation, "Major.Minor.Build.Revision" [..]

https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-identity#syntax

Click to see the exception ``` panic: Invalid Semantic Version goroutine 1 [running]: main.check(0x5ea420, 0x14d06220) /home/travis/gopath/src/github.com/gabrielrobert/xavtool/helpers.go:47 +0x36 main.parse(0x14db1c78, 0x7, 0x14d060d0) /home/travis/gopath/src/github.com/gabrielrobert/xavtool/version.go:30 +0x45 main.incrementMinor(0x14db1c78, 0x7, 0x4, 0x5c1e39) /home/travis/gopath/src/github.com/gabrielrobert/xavtool/version.go:17 +0x36 main.increment(0x14d122c0, 0x14d06300, 0x14d122c0) /home/travis/gopath/src/github.com/gabrielrobert/xavtool/actions.go:55 +0x53d github.com/urfave/cli.HandleAction(0x5925e0, 0x5cf72c, 0x14d122c0, 0x0, 0x14d2c270) /home/travis/gopath/src/github.com/urfave/cli/app.go:501 +0xa2 github.com/urfave/cli.Command.Run(0x5c2baa, 0x9, 0x0, 0x0, 0x14d063b8, 0x1, 0x1, 0x5c748a, 0x19, 0x0, ...) /home/travis/gopath/src/github.com/urfave/cli/command.go:165 +0x3d7 github.com/urfave/cli.(*App).Run(0x14d02380, 0x14d0e0b0, 0x2, 0x2, 0x0, 0x0) /home/travis/gopath/src/github.com/urfave/cli/app.go:259 +0x5cc main.main() /home/travis/gopath/src/github.com/gabrielrobert/xavtool/main.go:19 +0x3a8 ```


The same goes for iOS. The documentation mentions the use of a suffix for development. It gives some examples, but the final format is left to the developer. We use the Major.Minor.Patch.Revision format for that. E.g. 1.0.2.3.

And for Android, you already reserved room for an extra revision number. E.g. 1000203.

P.s. I love this tool; it normalizes one of the boring task in Xamarin.

gabrielrobert commented 6 years ago

Very interesting, I will take a look at it very soon.

gabrielrobert commented 6 years ago

@jerone, just updated xavtool regarding this issue.

1) xavtool will generate a revision-based version for UWP. It will ignore the last sequence and just put '0' for all versions. This is something accepted in the semver community.

2) xavtool will be able to parse that kind of version by ignoring existing revision.

3) xavtool will not handle revision for iOS applications. As stated in your link:

When you release the new version of your app, remove the suffix.

Allowing revision edition through xavtool doesn't follow our semver philosophy. However, if you use it, it will be parsed and removed after a set/increment command.

Just pushed this: #13

P.s. Thank you for your time, really appreciated. I'm very open to any remarks/ideas :) Feel free to reopen this case if you think I'm not right.

jerone commented 6 years ago

Great! I'll try next week when I have to release a new version again đŸ˜‹

jerone commented 6 years ago

Sorry for the late response. Planning changed, so I'm doing this from home :)

No exceptions anymore.

If it's not too much work or out of the scope of this tool, we would like to set the revision version also. We use that number for internal testing and don't show it to users. I know this goes against Semver philosophy.

Proposal

Thus using xavtool -s 1.0.2.3 would set:

Platform Version Internal Version
Android 1.0.2 1000203
iOS 1.0.2 1.0.2.3
UWP 1.0.2.3 -

Using it without reversion number (normal Semver) xavtool -s 1.0.2 would set:

Platform Version Internal Version
Android 1.0.2 1000200
iOS 1.0.2 1.0.2
UWP 1.0.2.0 -