VISTA: CEIE Custom Versioning Model (v4.0)

VISTA is the CEIE 4.0 Gradle plugin that implements a Custom Versioning Model, automating project version calculation, application, and rollback within the Gradle build lifecycle. It integrates semantic versioning, Git metadata, and user‑defined override files to provide precise control over version management.

Prerequisites

  • Gradle: Version 7.0 or higher (Gradle Wrapper recommended).
  • JDK: JavaĀ 11 or higher, to support Kotlin-based plugins and tasks.
  • Git: VersionĀ 2.x+ for extracting commit metadata.
  • version.properties (optional): File in project root to specify explicit version overrides.

Plugin Installation

Apply the VISTA plugin via the Gradle Plugins DSL in your settings.gradle.kts or build.gradle.kts:

plugins {
                      id("io.ceie.vista") version "4.0.0"
                    }
                    

The plugin is published to the central Gradle Plugin Portal and automatically downloaded during the build initialization phase.

Configuration

Configure VISTA by declaring a vista extension in your build.gradle.kts:

vista {
                      // Path to an optional version.properties file
                      versionFile.set(file("version.properties"))
                    
                      // Automatic semantic version increments based on Git commits
                      autoIncrement.set(true)
                    
                      // Versioning strategy: "semantic" | "calendar" | "custom"
                      strategy.set("semantic")
                    
                      // Prefix for Git-generated tags (e.g., "v" to produce "v1.2.3")
                      tagPrefix.set("v")
                    
                      // Property name to inject computed version into project.version
                      propertyName.set("projectVersion")
                    }
                    

- versionFile: Allows explicit version overrides when present.
- autoIncrement: Enables automatic bumping based on commit types (feat, fix, BREAKINGĀ CHANGE).
- strategy: ā€œsemanticā€ uses Conventional Commits; other strategies may be defined by user extensions.

Version Properties

When present, version.properties in the project root defines an explicit version:

version=2.3.0
                        buildMetadata=20250419.1234
                        

VISTA reads this file before Git analysis and respects the version value, allowing manual overrides for hotfixes or emergency releases.

Provided Tasks

  • vistaGenerateVersion Calculates the next version and writes to version.properties (if enabled).
  • vistaApplyVersion Sets project.version to the computed or overridden version before compilation.
  • vistaRelease Tags the Git repository with the computed version tag (e.g., ā€œv2.3.0ā€) and pushes the tag to origin.
  • vistaRollback Reverts version.properties and Git tags to the previous stable version.

Build Integration

The plugin hooks into the standard lifecycle:

  1. During initialize, vistaGenerateVersion runs if autoIncrement is enabled.
  2. Before compileJava (or equivalent), vistaApplyVersion injects project.version.
  3. After build, vistaRelease can be executed in CI pipelines to tag releases.

CI Pipeline Example (GitHub Actions)

jobs:
                            release:
                              runs-on: ubuntu-latest
                              steps:
                                - uses: actions/checkout@v2
                                - uses: actions/setup-java@v3
                                  with:
                                    distribution: 'temurin'
                                    java-version: '11'
                                - name: Generate and Apply Version
                                  run: ./gradlew vistaGenerateVersion vistaApplyVersion
                                - name: Build
                                  run: ./gradlew build
                                - name: Tag Release
                                  run: ./gradlew vistaRelease
                          

Best Practices

  • Enforce Conventional Commit messages (feat/ fix/ BREAKINGĀ CHANGE) to drive semantic versioning.
  • Commit version.properties changes only via vistaGenerateVersion to maintain auditability.
  • Protect main branches and require PR reviews before tagging releases.
  • Use vistaRollback for emergency rollbacks, preserving continuity of version history.

Troubleshooting

  • Incorrect Version Calculation: Verify commit message formats and strategy setting.
  • Task Not Found: Ensure the plugin ID and version are correctly declared in plugins block.
  • Git Tag Push Fails: Confirm that authentication tokens are available in CI and that origin is writable.

VISTA (CEIE 4.0) delivers enterprise‑grade versioning automation within Gradle, ensuring consistent, traceable, and reversible release management.