diff --git a/build.gradle b/build.gradle index 5cd44c0..8785398 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } group = 'dev.lukebemish' -version = '1.2.3' +version = '1.2.4' repositories { mavenCentral() diff --git a/src/main/java/dev/lukebemish/managedversioning/ManagedPublishingExtension.java b/src/main/java/dev/lukebemish/managedversioning/ManagedPublishingExtension.java index d7ffb08..47d9daf 100644 --- a/src/main/java/dev/lukebemish/managedversioning/ManagedPublishingExtension.java +++ b/src/main/java/dev/lukebemish/managedversioning/ManagedPublishingExtension.java @@ -76,7 +76,7 @@ public void mavenRelease(PublishingExtension publishing) { } } - public void mavenPulLRequest(PublishingExtension publishing) { + public void mavenPullRequest(PublishingExtension publishing) { if (System.getenv(Constants.PR_NUMBER) != null) { publishing.repositories(repositories -> { repositories.maven(maven -> { diff --git a/src/main/java/dev/lukebemish/managedversioning/ManagedVersioningExtension.java b/src/main/java/dev/lukebemish/managedversioning/ManagedVersioningExtension.java index e3147c0..42a55fd 100644 --- a/src/main/java/dev/lukebemish/managedversioning/ManagedVersioningExtension.java +++ b/src/main/java/dev/lukebemish/managedversioning/ManagedVersioningExtension.java @@ -51,8 +51,13 @@ public ManagedVersioningExtension(Project project) { spec.getParameters().getArgs().set(List.of("rev-parse", "HEAD")); spec.getParameters().getWorkingDir().set(this.getGitWorkingDir()); }); + var tagName = project.getProviders().of(GitValueSource.class, spec -> { + spec.getParameters().getArgs().set(List.of("describe", "--tags", "--abbrev=0")); + spec.getParameters().getWorkingDir().set(this.getGitWorkingDir()); + }); this.tagHash = project.getProviders().of(GitValueSource.class, spec -> { - spec.getParameters().getArgs().set(List.of("rev-list", "--tags", "--max-count=1")); + spec.getParameters().getArgs().set(List.of("rev-list", "-n", "1")); + spec.getParameters().getArgs().add(tagName); spec.getParameters().getWorkingDir().set(this.getGitWorkingDir()); }); this.getTimestampFormat().convention("yyyy.MM.dd-HH.mm.ss");