|
5 | 5 | import org.gradle.api.DefaultTask; |
6 | 6 | import org.gradle.api.tasks.*; |
7 | 7 | import org.gradle.api.tasks.options.Option; |
| 8 | +import team.yi.tools.semanticgitlog.VersionStrategies; |
8 | 9 | import team.yi.tools.semanticgitlog.config.GitlogSettings; |
9 | 10 | import team.yi.tools.semanticgitlog.git.GitRepo; |
10 | 11 | import team.yi.tools.semanticgitlog.model.ReleaseLog; |
@@ -33,6 +34,7 @@ public abstract class BaseTask extends DefaultTask { |
33 | 34 | private String toCommit; |
34 | 35 | private String untaggedName; |
35 | 36 | private Boolean isUnstable; |
| 37 | + private VersionStrategies strategy; |
36 | 38 | private Boolean forceNextVersion; |
37 | 39 | private String lastVersion; |
38 | 40 | private String preRelease; |
@@ -203,6 +205,20 @@ public void setIsUnstable(final Boolean isUnstable) { |
203 | 205 | this.isUnstable = isUnstable; |
204 | 206 | } |
205 | 207 |
|
| 208 | + @Input |
| 209 | + @Optional |
| 210 | + public VersionStrategies getStrategy() { |
| 211 | + return this.strategy; |
| 212 | + } |
| 213 | + |
| 214 | + @Option( |
| 215 | + option = "strategy", |
| 216 | + description = "Release strategy. Optional values: `strict`, `slow`. Default is `strict`." |
| 217 | + ) |
| 218 | + public void setStrategy(final VersionStrategies strategy) { |
| 219 | + this.strategy = strategy; |
| 220 | + } |
| 221 | + |
206 | 222 | @Input |
207 | 223 | @Optional |
208 | 224 | public Boolean getForceNextVersion() { |
@@ -360,6 +376,7 @@ protected final GitlogSettings gitlogSettings() { |
360 | 376 |
|
361 | 377 | .untaggedName(this.untaggedName) |
362 | 378 | .isUnstable(this.isUnstable) |
| 379 | + .strategy(this.strategy) |
363 | 380 | .forceNextVersion(this.forceNextVersion) |
364 | 381 |
|
365 | 382 | .lastVersion(lastVersion) |
|
0 commit comments