From d028083319ab98aeaf09f93569a54134fd78c37b Mon Sep 17 00:00:00 2001 From: "Stephen M. Coakley" Date: Tue, 12 Dec 2017 15:45:35 -0600 Subject: [PATCH] fix: syntax incorrect for tags with dashes in them --- build.gradle | 2 +- src/main/java/com/widen/versioning/VersionGenerator.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index bffd277..8a933ee 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'groovy' id 'java-gradle-plugin' id 'maven-publish' - id 'com.widen.versioning' version '0.1.0' + id 'com.widen.versioning' version '0.2.0' } group 'widen' diff --git a/src/main/java/com/widen/versioning/VersionGenerator.java b/src/main/java/com/widen/versioning/VersionGenerator.java index 6380762..6192af8 100644 --- a/src/main/java/com/widen/versioning/VersionGenerator.java +++ b/src/main/java/com/widen/versioning/VersionGenerator.java @@ -46,7 +46,7 @@ public static String generateFromString(String describe, Settings settings) { return null; } - String version = describe.replaceFirst("-", "+"); + String version = describe.replaceFirst("-(\\d+-g.)", "+$1"); if (settings.tagPrefix != null && version.startsWith(settings.tagPrefix)) { version = version.substring(settings.tagPrefix.length());