xavtool

Xplat Automating Version Tool

View the Project on GitHub gabrielrobert/xavtool

Header

Xplat Automating Version Tool

Build status Build Status

Command-line utility to automatically increase iOS / Android / UWP applications version written in Go. It follows Semantic Versioning.

Installation

Windows:

Using Chocolatey:

$ choco install xavtool -version 1.2.1
$ xavtool --version

Using scoop:

$ scoop bucket add gabrielrobert-bucket https://github.com/gabrielrobert/scoop-bucket
$ scoop install xavtool

macOS:

Using brew:

$ brew install gabrielrobert/tap/xavtool
$ xavtool --version

Binaries

Download executables on the release page.

From source:

$ go build
$ go test -v
$ go install
$ xavtool --version

Usage

$ xavtool

NAME:
   xavtool - Command-line utility to automatically increase applications version

USAGE:
   xavtool [global options] command [command options] [arguments...]

VERSION:
   1.2.1

AUTHOR:
   Gabriel Robert <g.robert092@gmail.com>

COMMANDS:
     current, c    List current versions
     increment, i  Increment to next version
     set, s        Set the current project version
     help, h       Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

increment

$ xavtool increment --help

NAME:
   xavtool increment - Increment to next version

USAGE:
   xavtool increment [command options] [arguments...]

OPTIONS:
   --type value, -t value  major, minor, patch (default: "minor")

set

$ xavtool set --help

NAME:
   xavtool set - Set the current project version

USAGE:
   xavtool set [arguments...]

Typical flow

$ xavtool current
1.0.1 - androidApp (...\test\AndroidManifest.xml)
1.0.1 - iOSApp (...\test\Info.plist)
1.0.1.0 - uwpApp (...\test\Package.appxmanifest)

$ git flow release start '1.1.0'

$ xavtool i
1.0.1: New version: 1.1.0 (...\test\AndroidManifest.xml)
1.0.1: New version: 1.1.0 (...\test\Info.plist)
1.0.1.0: New version: 1.1.0.0 (...\test\Package.appxmanifest)

$ git commit -am "Version bump to 1.1.0"
$ git flow release finish -p

It will update these files:

Results

Info.plist (iOS)

Only these values will be edited:

1) CFBundleShortVersionString (new version) 2) CFBundleVersion (new version)

Before:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <!-- ... -->
        <key>CFBundleShortVersionString</key>
        <string>1.0.1</string>
        <key>CFBundleVersion</key>
        <string>1.0.1</string>
        <!-- ... -->
    </dict>
</plist>

After:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <!-- ... -->
        <key>CFBundleShortVersionString</key>
        <string>1.1.0</string>
        <key>CFBundleVersion</key>
        <string>1.1.0</string>
        <!-- ... -->
    </dict>
</plist>

AndroidManifest.xml (Android)

Only these values will be edited:

1) manifest/@android:versionName (new version) 2) manifest/@android:versionCode (integer computed this way: (major * 1000000) + (minor * 10000) + (patch * 100))

Before:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.xavtool" 
    android:versionCode="1000100"
    android:versionName="1.0.1">
    <!-- ... -->
</manifest>

After:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android" 
        package="com.example.xavtool" 
        android:versionCode="1010000" 
        android:versionName="1.1.0">
    <!-- ... -->
</manifest>

Package.appxmanifest (UWP)

Only these values will be edited:

1) Package/Identity/@Version (new version with a revision number set to 0)

Before:

<?xml version="1.0" encoding="utf-8"?>
<Package
    xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
    xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
    xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
    
    <!-- ... -->
    <Identity Name="95748d56-342b-4dae-93f5-aeda0587a1c0" Publisher="CN=gabrielrobert" Version="1.0.1.0"/>
    <!-- ... -->
    
</Package>

After:

<?xml version="1.0" encoding="utf-8"?>
<Package
    xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
    xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
    xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
    
    <!-- ... -->
    <Identity Name="95748d56-342b-4dae-93f5-aeda0587a1c0" Publisher="CN=gabrielrobert" Version="1.1.0.0"/>
    <!-- ... -->
    
</Package>

config.xml (Cordova)

Only these values will be edited:

1) widget/@version (new version) 2) widget/@ios-CFBundleVersion (new version) 3) widget/@android-versionCode (integer computed this way: (major * 1000000) + (minor * 10000) + (patch * 100))

Before:

<?xml version="1.0" encoding="utf-8"?>
<widget 
    id="com.example.xavtool" 
    android-versionCode="1000100" 
    ios-CFBundleVersion="1.0.1" 
    version="1.0.1" 
    xmlns="http://www.w3.org/ns/widgets"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <!-- ... -->
</widget>

After:

<?xml version="1.0" encoding="utf-8"?>
<widget 
    id="com.example.xavtool" 
    android-versionCode="1010000" 
    ios-CFBundleVersion="1.1.0" 
    version="1.1.0" 
    xmlns="http://www.w3.org/ns/widgets"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <!-- ... -->
</widget>

Support

Please open an issue for support.

Contributing

Please contribute using Github Flow. Create a branch, add commits, and open a pull request.