[model] add formatted project version properties. Resolves
@@ -360,8 +360,20 @@ public class Project implements Domain, ExtraProperties {
}
break;
default:
+ addExtraProperty(Constants.KEY_VERSION_NUMBER, v);
// noop
}
+
+ String vn = (String) getExtraProperties().get(Constants.KEY_VERSION_NUMBER);
+ String ev = getEffectiveVersion();
+ addExtraProperty(Constants.KEY_VERSION_WITH_UNDERSCORES, v.replace(".", "_").replace("-", "_"));
+ addExtraProperty(Constants.KEY_VERSION_WITH_DASHES, v.replace(".", "-").replace("_", "-"));
+ addExtraProperty(Constants.KEY_VERSION_NUMBER_WITH_UNDERSCORES, vn.replace(".", "_").replace("-", "_"));
+ addExtraProperty(Constants.KEY_VERSION_NUMBER_WITH_DASHES, vn.replace(".", "-").replace("_", "-"));
+ if (isNotBlank(ev)) {
+ addExtraProperty(Constants.KEY_EFFECTIVE_VERSION_WITH_UNDERSCORES, ev.replace(".", "_").replace("-", "_"));
+ addExtraProperty(Constants.KEY_EFFECTIVE_VERSION_WITH_DASHES, ev.replace(".", "-").replace("_", "-"));
+ }
}
public static class Snapshot implements Domain {
