Skip to content

Commit b2f51fb

Browse files
committed
major: Remove default setting for defaultInferredScope
Fixes #195
1 parent a4490a8 commit b2f51fb

File tree

10 files changed

+35
-7
lines changed

10 files changed

+35
-7
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ reckon {
141141
// snapshotFromProp()
142142
// END LEGACY
143143
144-
// omit this to use the default of 'minor'
144+
// required as of 0.18.0 (previously defaulted to 'minor')
145145
defaultInferredScope = 'patch'
146146
147-
// omit this to use the deafult of 'patch'
147+
// omit this to use the default of 'patch'
148148
// if you use branches like maintenance/1.2.x, set this to 'minor'
149149
// if you use branches like maintenance/2.x, set this to 'major'
150150
parallelBranchScope = 'minor'

reckon-core/src/main/java/org/ajoberstar/reckon/core/Reckoner.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public static final class Builder {
157157
private VcsInventorySupplier inventorySupplier;
158158
private ScopeCalculator scopeCalc;
159159
private StageCalculator stageCalc;
160-
private Scope defaultInferredScope = Scope.MINOR;
160+
private Scope defaultInferredScope;
161161
private Scope parallelBranchScope = Scope.PATCH;
162162
private Set<String> stages;
163163
private String defaultStage;

reckon-core/src/test/java/org/ajoberstar/reckon/core/ReckonerIntegTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ private String reckonStage(Scope scope, String stage) {
7171
.scopeCalc(i -> Optional.ofNullable(scope))
7272
.stageCalc((i, v) -> Optional.ofNullable(stage))
7373
.stages("beta", "milestone", "rc", "final")
74+
.defaultInferredScope(Scope.MINOR)
7475
.build()
7576
.reckon()
7677
.toString();
@@ -82,6 +83,7 @@ private String reckonSnapshot(Scope scope, String stage) {
8283
.git(git.getRepository())
8384
.scopeCalc(i -> Optional.ofNullable(scope))
8485
.stageCalc((i, v) -> Optional.ofNullable(stage))
86+
.defaultInferredScope(Scope.MINOR)
8587
.snapshots()
8688
.build()
8789
.reckon()

reckon-core/src/test/java/org/ajoberstar/reckon/core/ReckonerTest.java

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public void stagesLowercased(String stage) {
4545
.scopeCalc(i -> Optional.empty())
4646
.stages("beTA", "miLEStone", "RC", "Final")
4747
.stageCalc(StageCalculator.ofUserString((i, v) -> Optional.of(stage)))
48+
.defaultInferredScope(Scope.MINOR)
4849
.build()
4950
.reckon();
5051
}
@@ -361,6 +362,7 @@ public void doubleConflictingParallelIncrementsHigherScope() {
361362
.parallelBranchScope(Scope.MINOR)
362363
.scopeCalc(i -> Optional.ofNullable(Scope.PATCH))
363364
.stageCalc((i, v) -> Optional.ofNullable("final"))
365+
.defaultInferredScope(Scope.MINOR)
364366
.stages("beta", "milestone", "rc", "final")
365367
.build();
366368

@@ -586,6 +588,7 @@ private String reckonStage(VcsInventory inventory, Scope scope, String stage) {
586588
.vcs(() -> inventory)
587589
.scopeCalc(i -> Optional.ofNullable(scope))
588590
.stageCalc((i, v) -> Optional.ofNullable(stage))
591+
.defaultInferredScope(Scope.MINOR)
589592
.stages("beta", "milestone", "rc", "final")
590593
.build()
591594
.reckon()
@@ -598,6 +601,7 @@ private String reckonSnapshot(VcsInventory inventory, Scope scope, String stage)
598601
.vcs(() -> inventory)
599602
.scopeCalc(i -> Optional.ofNullable(scope))
600603
.stageCalc((i, v) -> Optional.ofNullable(stage))
604+
.defaultInferredScope(Scope.MINOR)
601605
.snapshots()
602606
.build()
603607
.reckon()

reckon-gradle/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dependencies {
3333

3434
// testing
3535
compatTestImplementation(gradleTestKit())
36+
compatTestImplementation("org.eclipse.jgit:org.eclipse.jgit:[6.0,7.0[")
3637
compatTestImplementation("org.spockframework:spock-core:2.3-groovy-3.0")
3738
}
3839

reckon-gradle/gradle.lockfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
# Manual edits can break the build and are not advised.
33
# This file is expected to be part of source control.
44
com.github.zafarkhaja:java-semver:0.9.0=runtimeClasspath,testRuntimeClasspath
5-
com.googlecode.javaewah:JavaEWAH:1.1.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
5+
com.googlecode.javaewah:JavaEWAH:1.1.13=compatTestCompileClasspath,compatTestRuntimeClasspath,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
66
org.apache.commons:commons-lang3:3.12.0=runtimeClasspath,testRuntimeClasspath
77
org.apiguardian:apiguardian-api:1.1.2=compatTestCompileClasspath
88
org.codehaus.groovy:groovy:3.0.12=compatTestCompileClasspath,compatTestRuntimeClasspath
9-
org.eclipse.jgit:org.eclipse.jgit:6.5.0.202303070854-r=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
9+
org.eclipse.jgit:org.eclipse.jgit:6.5.0.202303070854-r=compatTestCompileClasspath,compatTestRuntimeClasspath,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
1010
org.hamcrest:hamcrest:2.2=compatTestCompileClasspath,compatTestRuntimeClasspath
1111
org.junit.platform:junit-platform-commons:1.9.0=compatTestCompileClasspath,compatTestRuntimeClasspath
1212
org.junit.platform:junit-platform-engine:1.9.0=compatTestCompileClasspath,compatTestRuntimeClasspath
1313
org.junit:junit-bom:5.9.0=compatTestCompileClasspath,compatTestRuntimeClasspath
1414
org.opentest4j:opentest4j:1.2.0=compatTestCompileClasspath,compatTestRuntimeClasspath
15-
org.slf4j:slf4j-api:1.7.30=compileClasspath,testCompileClasspath
15+
org.slf4j:slf4j-api:1.7.30=compatTestCompileClasspath,compatTestRuntimeClasspath,compileClasspath,testCompileClasspath
1616
org.slf4j:slf4j-api:2.0.7=runtimeClasspath,testRuntimeClasspath
1717
org.spockframework:spock-core:2.3-groovy-3.0=compatTestCompileClasspath,compatTestRuntimeClasspath
1818
empty=annotationProcessor,compatTestAnnotationProcessor,signatures,testAnnotationProcessor

reckon-gradle/src/compatTest/groovy/org/ajoberstar/reckon/gradle/BaseCompatTest.groovy

+10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ plugins {
4141
}
4242
4343
reckon {
44+
defaultInferredScope = 'minor'
4445
scopeFromProp()
4546
stageFromProp('alpha','beta', 'final')
4647
}
@@ -91,6 +92,7 @@ plugins {
9192
println version
9293
9394
reckon {
95+
defaultInferredScope = 'minor'
9496
scopeFromProp()
9597
stageFromProp('alpha','beta', 'final')
9698
}
@@ -142,6 +144,7 @@ plugins {
142144
}
143145
144146
reckon {
147+
defaultInferredScope = 'minor'
145148
scopeFromProp()
146149
snapshotFromProp()
147150
}
@@ -165,6 +168,7 @@ plugins {
165168
}
166169
167170
reckon {
171+
defaultInferredScope = 'minor'
168172
scopeFromProp()
169173
stageFromProp('alpha','beta', 'final')
170174
}
@@ -190,6 +194,7 @@ plugins {
190194
}
191195
192196
reckon {
197+
defaultInferredScope = 'minor'
193198
stages('alpha','beta', 'final')
194199
scopeCalc = calcScopeFromProp().or(calcScopeFromCommitMessages())
195200
stageCalc = calcStageFromProp()
@@ -216,6 +221,7 @@ plugins {
216221
}
217222
218223
reckon {
224+
defaultInferredScope = 'minor'
219225
stages('alpha','beta', 'final')
220226
scopeCalc = calcScopeFromProp().or(calcScopeFromCommitMessages())
221227
stageCalc = calcStageFromProp()
@@ -242,6 +248,7 @@ plugins {
242248
}
243249
244250
reckon {
251+
defaultInferredScope = 'minor'
245252
scopeFromProp()
246253
stageFromProp('alpha','beta', 'final')
247254
remote = 'other-remote'
@@ -270,6 +277,7 @@ plugins {
270277
}
271278
272279
reckon {
280+
defaultInferredScope = 'minor'
273281
scopeFromProp()
274282
stageFromProp('alpha','beta', 'final')
275283
@@ -301,6 +309,7 @@ plugins {
301309
}
302310
303311
reckon {
312+
defaultInferredScope = 'minor'
304313
scopeFromProp()
305314
stageFromProp('alpha','beta', 'final')
306315
tagMessage = version.map(v -> "Version " + v)
@@ -329,6 +338,7 @@ plugins {
329338
}
330339
331340
reckon {
341+
defaultInferredScope = 'minor'
332342
scopeFromProp()
333343
stageFromProp('alpha', 'beta', 'final')
334344
}

reckon-gradle/src/compatTest/groovy/org/ajoberstar/reckon/gradle/CompositeBuildCompatTest.groovy

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ plugins {
2929
}
3030
3131
reckon {
32+
defaultInferredScope = 'minor'
3233
scopeFromProp()
3334
stageFromProp('beta', 'final')
3435
}
@@ -52,6 +53,7 @@ plugins {
5253
}
5354
5455
reckon {
56+
defaultInferredScope = 'minor'
5557
scopeFromProp()
5658
stageFromProp('beta', 'final')
5759
}

reckon-gradle/src/compatTest/groovy/org/ajoberstar/reckon/gradle/SettingsCompatTest.groovy

+9
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ plugins {
4444
}
4545
4646
reckon {
47+
defaultInferredScope = 'minor'
4748
scopeFromProp()
4849
stageFromProp('alpha','beta', 'final')
4950
}
@@ -118,6 +119,7 @@ plugins {
118119
}
119120
120121
reckon {
122+
defaultInferredScope = 'minor'
121123
scopeFromProp()
122124
snapshotFromProp()
123125
}
@@ -141,6 +143,7 @@ plugins {
141143
}
142144
143145
reckon {
146+
defaultInferredScope = 'minor'
144147
scopeFromProp()
145148
stageFromProp('alpha','beta', 'final')
146149
}
@@ -166,6 +169,7 @@ plugins {
166169
}
167170
168171
reckon {
172+
defaultInferredScope = 'minor'
169173
stages('alpha','beta', 'final')
170174
scopeCalc = calcScopeFromProp().or(calcScopeFromCommitMessages())
171175
stageCalc = calcStageFromProp()
@@ -192,6 +196,7 @@ plugins {
192196
}
193197
194198
reckon {
199+
defaultInferredScope = 'minor'
195200
stages('alpha','beta', 'final')
196201
scopeCalc = calcScopeFromProp().or(calcScopeFromCommitMessages())
197202
stageCalc = calcStageFromProp()
@@ -218,6 +223,7 @@ plugins {
218223
}
219224
220225
reckon {
226+
defaultInferredScope = 'minor'
221227
scopeFromProp()
222228
stageFromProp('alpha','beta', 'final')
223229
remote = 'other-remote'
@@ -246,6 +252,7 @@ plugins {
246252
}
247253
248254
reckon {
255+
defaultInferredScope = 'minor'
249256
scopeFromProp()
250257
stageFromProp('alpha','beta', 'final')
251258
@@ -277,6 +284,7 @@ plugins {
277284
}
278285
279286
reckon {
287+
defaultInferredScope = 'minor'
280288
scopeFromProp()
281289
stageFromProp('alpha','beta', 'final')
282290
tagMessage = version.map(v -> "Version " + v)
@@ -305,6 +313,7 @@ plugins {
305313
}
306314
307315
reckon {
316+
defaultInferredScope = 'minor'
308317
scopeFromProp()
309318
stageFromProp('alpha', 'beta', 'final')
310319
}

reckon-gradle/src/main/java/org/ajoberstar/reckon/gradle/ReckonExtension.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private Version reckonVersion() {
185185
try {
186186
reckoner = reckonerBuilder.build();
187187
} catch (Exception e) {
188-
throw new ReckonConfigurationException("Failed to configure Reckon.", e);
188+
throw new ReckonConfigurationException("Failed to configure Reckon: " + e.getMessage(), e);
189189
}
190190

191191
var version = reckoner.reckon();

0 commit comments

Comments
 (0)