Skip to content

Commit

Permalink
[RequireGradleProperty] Use rule.message when rule.regexMessage is no…
Browse files Browse the repository at this point in the history
…t present. Fixes #14
  • Loading branch information
aalmiray committed Oct 30, 2020
1 parent d59621d commit f46eb86
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ abstract class AbstractPropertyEnforcerRule extends AbstractStandardEnforcerRule

if (regex.present && !propValue.toString().matches(regex.get())) {
if (!regexMessage.present) {
regexMessage.set(getName() + ' "' + getPropertyName() +
'" does not match the regular expression "' + regex.get() + '".')
if (!message.present) {
regexMessage.set(getName() + ' "' + getPropertyName() +
'" does not match the regular expression "' + regex.get() + '".')
} else {
regexMessage.set(message.get())
}
}
if (displayValue.get()) {
regexMessage.set(regexMessage.get() + ' Value is "' + propValue + '".')
Expand Down

0 comments on commit f46eb86

Please sign in to comment.