Skip to content

Commit

Permalink
minor: Add settings plugin
Browse files Browse the repository at this point in the history
To ensure that we reckon can get configured before anyone else will
use the project versions, we're adding a settings plugin. As long as
no one applies another settings plugin that happens to also interact
with versions this should resolve any other issues that woud crop up.

Fixes #173
  • Loading branch information
ajoberstar committed Aug 14, 2022
1 parent b85f526 commit ac489a7
Show file tree
Hide file tree
Showing 5 changed files with 487 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,21 @@ Reckon can alternately use SNAPSHOT versions instead of the stage concept.

#### Apply the plugin

**IMPORTANT:** It is recommended to apply reckon as a Settings plugin (in settings.gradle/settings.gradle.kts) to ensure it is configured before any other plugin tries to use the project version.

```groovy
// if applying in settings.gradle(.kts)
plugins {
id 'org.ajoberstar.reckon.settings' version '<version>'
}
// if applying in build.gradle(.kts)
plugins {
id 'org.ajoberstar.reckon' version '<version>'
}
// in either case
reckon {
// START As of 0.16.0
// what stages are allowed
Expand Down
6 changes: 6 additions & 0 deletions reckon-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,11 @@ gradlePlugin {
description = "Infer a project's version from your Git repository."
implementationClass = "org.ajoberstar.reckon.gradle.ReckonPlugin"
}
create("settings") {
id = "org.ajoberstar.reckon.settings"
displayName = "Reckon Settings Plugin"
description = "Infer a build's version from your Git repository."
implementationClass = "org.ajoberstar.reckon.gradle.ReckonSettingsPlugin"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import org.ajoberstar.grgit.Grgit
import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.BuildResult

// Composite builds were added in 3.1
@IgnoreIf({ System.properties['compat.gradle.version'] == '3.0' })
class CompositeBuildCompatTest extends Specification {
@TempDir File tempDir
File project1Dir
Expand Down
Loading

0 comments on commit ac489a7

Please sign in to comment.