gradle-release icon indicating copy to clipboard operation
gradle-release copied to clipboard

Custom version update strategy, for example regex based

Open Vampire opened this issue 4 years ago • 0 comments

I'm currently working on a release workflow for a TypeScript project. There I don't have the version in a properties file, but I read it from package.json for compatibility with the native TypeScript / Node.js tooling. I would still like to be able to use the gradle-release plugin though.

While I can of course just disable the unSnapshotVersion and updateVersion tasks and instead hook in own ones that do the updating, it would be nice if the plugin natively would support it. I see of course, that it cannot support any data language out there, but maybe a regex-based approach could be configurable, so that you can configure a regex to find and update the version in the file. You could for example require that the whole match is the actual version, everything else around can be matched by look-arounds. Or you could require that the first group matches the version or that there is alternatively a named group named version and then you can take the whole match, and replace the group by the new version.

Vampire avatar Aug 08 '20 17:08 Vampire