Releases: davideas/GrabVer
Releases · davideas/GrabVer
Release list
v2.1.0
Compatibility
- Users: Gradle 7.0+ / Java 11+
- Contributors: Gradle 8.x wrapper / JDK 17+
Added
CHANGELOG.mdfile to track all notable changes.- Optional property
incrementBuild(default:true) to prevent constant modifications ofversion.properties- Resolves #26, #29 - Added internal function
hasUserChanges()detection - allows to save file when user manually changes main version values. - Gradle
defaultTasks()included in runTasks evaluation - Resolves #33 - Android Product Flavor support - recognizes flavor tasks like
assembleFreeRelease,bundleProRelease- Resolves #25 - Android detection - checks for
com.android.applicationorcom.android.libraryplugins. ⚠️ grabverVerbosetask (renamed fromgrabverDebug) for verbose logging.- GrabVer tasks are now registered under
versioninggroup. - Gradle wrapper for development/publishing.
Changed
⚠️ PropertyincrementOnnow also triggers save: Custom release task (like deploy/publish) defined viaincrementOn
is now correctly detected as save-task, ensuring version changes are always persisted.⚠️ Task monitoring improvements:
Monitored tasks only track user-invoked tasks, filtering out internal sub-tasks (e.g., AGP'sbundleLib*) from
build output.gradle buildis treated as debug even if AGP executes bothassembleDebugandassembleRelease
internally. Usegradle assembleReleaseexplicitly to trigger release versioning.⚠️ Task Matching Logic with case-sensitive comparison, consistent with Gradle's own behavior.
Separated exact match tasks from prefix+suffix patterns. Suffix patterns (Debug/Release) match Android's
camelCase convention (e.g., assembleFreeRelease, bundleProDebug).- Comprehensive logging - "release" vs "debug" build clarity and better task status display
- Android-specific logging - shows 'Code' messages only for Android projects.
- Modern Gradle API - replaced deprecated
project.task()withproject.tasks.register(). - Independent
settings.gradlefor test modules (composite build testing).
Deprecated
saveOn- will be removed in next major release. UseincrementOninstead.
WithincrementOncovering custom release tasks andincrementBuildcontrolling debug build behavior,
there is no remaining scenario requiring a custom save task. Default save tasks already cover all standard builds.
Fixed
- NPE when user doesn't access versioning values - shows a warning message.
- Version code starting from 0 now correctly produces
code=1on the first release. Previously, a debug build
would savecode=1to the file, causing the first release to skip tocode=2. The version code is now guaranteed
to be ≥ 1 at read time (required by Android), while the file preserves the raw value - Further fix for #15, #17
v2.0.3
v2.0.2
v2.0.1
v2.0.0
Deprecation
- Removed attribute
dependsOn. - Removed task
grabverSkip, became obsolete after new solution. - Removed getter
getFullVersionName(fullVersionName) in favor ofgetFullName(versioning.fullName).
New features
- Resolves #19 - Added optional attribute
incrementOn: accepts a custom task name to trigger the version increase based on the rules (tasks supported by default:assembleRelease,bundleRelease,grabverRelease) - The plugin now evaluates the run tasks in silent mode to automatically skip the new version evaluation and to not print unnecessary logs if no save task was detected. A single warning line is however produced.
Single tasks performed such as clean, test, flyway and all third parties invented plugin tasks out there will not trigger the versioning evaluation. Example:
| Command | Outcome |
|---|---|
gradle clean test |
Evaluation skipped |
gradle javadoc |
Evaluation skipped |
gradle flywayClean |
Evaluation skipped |
gradle clean build |
Evaluation triggered and new values saved |
gradle clean war grabverRelease |
Evaluation triggered, versioning increased and new values saved |
Improvements
- Resolves #21 - First run on Gradle syncing (
gradle <no tasks>) will generate the properties file with default values1.0.0 #1 code=1even without user configuration. In all others cases the properties file is saved when it passes the silent evaluation and the save tasks complete with success. Note: To trigger the evaluation, the user must grab at least one value. - New values are now saved when all tasks have been completed and build is finished.
- When
gradleis executed without tasks (for instance when Gradle is syncing to import the changes in IntelliJ IDEA), the evaluation is skipped and a warning log informs the user. - Added more default save tasks for attribute
saveOn: (now supported by default:build,assembleDebug,assembleRelease,bundleDebug,bundleRelease,grabverRelease,jar,war,explodedWar). - An info log line is produced with the outcome of the execution state showing which task triggered the saving.
- Added colors and bold effects to the logs.
- General code and logs improvements.
Fixes
- Fixes #18 - Android bundle support: the correct task to monitor is
bundleRelease. Code value will increase when this task is in runTasks.
v1.0.1
Improvements
- Deprecated
dependsOnin favor ofsaveOnto give a better idea of what this plugin property does.
Example, to have patch number automatically increased and saved on property file when task name jar is specified, run command line:
gradle jar grabverRelease
having
versioning {
....
saveOn "jar"
}
Fixes
v1.0.0
v0.7.0
- Resolved #8 - Replace Hardcoded Pathseperators (supports unix/win file separator).
- Resolved #9 - When the generate signed apk fails, should not increase the PATCH and the BUILD numbers.
Introduced optional field dependsOn: saving versioning file depends by the task-name specified here (default: compileJava, assembleDebug & assembleRelease. - Resolved #11 - Optionally set directly the patch number: skips auto-increase.