Skip to content

Commit

Permalink
Make sure versions are starting with a digit
Browse files Browse the repository at this point in the history
  • Loading branch information
melix committed Jul 18, 2024
1 parent 08a28c7 commit cdb4868
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ class MicronautBasePlugin implements Plugin<Project> {
}

private void configureProjectVersion(Project project) {
project.version = project.providers.gradleProperty("projectVersion").orElse("undefined").get()
def version = project.providers.gradleProperty("projectVersion").orElse("undefined").get()
if (version.isEmpty() || !Character.isDigit(version.charAt(0))) {
throw new IllegalArgumentException("Version '" + version + "' is not a valid Micronaut version. It must start with a digit.")
}
project.version = version
}

}

0 comments on commit cdb4868

Please sign in to comment.