diff --git a/src/main/groovy/wooga/gradle/version/VersionCodeSchemes.groovy b/src/main/groovy/wooga/gradle/version/VersionCodeSchemes.groovy index 134d509..0190736 100644 --- a/src/main/groovy/wooga/gradle/version/VersionCodeSchemes.groovy +++ b/src/main/groovy/wooga/gradle/version/VersionCodeSchemes.groovy @@ -25,16 +25,3 @@ enum VersionCodeSchemes { releaseCountBasic, releaseCount } - -/** - * Deprecated, Please use VersionCodeSchemes - */ -@Deprecated -interface VersionCodeScheme { - VersionCodeSchemes none = VersionCodeSchemes.none - VersionCodeSchemes semverBasic = VersionCodeSchemes.semverBasic - VersionCodeSchemes semver = VersionCodeSchemes.semver - VersionCodeSchemes releaseCountBasic = VersionCodeSchemes.releaseCountBasic - VersionCodeSchemes releaseCount = VersionCodeSchemes.releaseCount -} - diff --git a/src/main/groovy/wooga/gradle/version/VersionScheme.java b/src/main/groovy/wooga/gradle/version/VersionScheme.java index c2eaa96..52307d7 100644 --- a/src/main/groovy/wooga/gradle/version/VersionScheme.java +++ b/src/main/groovy/wooga/gradle/version/VersionScheme.java @@ -21,36 +21,6 @@ //This has to be a java class (not groovy) because groovy 2 doesn't support java 8 default interface methods. public interface VersionScheme { - /** - * DEPRECATED, please use {@code VersionSchemes.semver} - */ - @Deprecated - VersionScheme semver = VersionSchemes.semver; - - /** - * DEPRECATED, please use {@code VersionSchemes.semver} - */ - @Deprecated - VersionScheme semver2 = VersionSchemes.semver2; - - /** - * DEPRECATED, please use {@code VersionSchemes.semver} - */ - @Deprecated - VersionScheme staticMarker = VersionSchemes.staticMarker; - - /** - * DEPRECATED, please use {@code VersionSchemes.semver} - */ - @Deprecated - VersionScheme wdk = VersionSchemes.wdk; - - /** - * DEPRECATED, please use {@code VersionSchemes.semver} - */ - @Deprecated - VersionScheme upm = VersionSchemes.upm; - VersionStrategy getDevelopment(); VersionStrategy getSnapshot(); VersionStrategy getPreRelease(); diff --git a/src/main/groovy/wooga/gradle/version/VersionSchemes.groovy b/src/main/groovy/wooga/gradle/version/VersionSchemes.groovy index 6d98d61..fda0dc0 100644 --- a/src/main/groovy/wooga/gradle/version/VersionSchemes.groovy +++ b/src/main/groovy/wooga/gradle/version/VersionSchemes.groovy @@ -54,13 +54,14 @@ enum VersionSchemes implements VersionScheme { WdkNuGetStrategies.SNAPSHOT, WdkNuGetStrategies.PRE_RELEASE, WdkNuGetStrategies.FINAL, WdkNuGetStrategies.PREFLIGHT), + /** * Schema for UPM-based unity3d projects. See UpmStrategies for more details. * IMPORTANT: please note that the pre-release strategy for this schema does not enforces order between versions. */ upm(UpmStrategies.DEVELOPMENT, UpmStrategies.SNAPSHOT, - UpmStrategies.PRE_RELEASE.copyWith(enforcePrecedence: false), //this is supposed to be temporary + UpmStrategies.PRE_RELEASE.copyWith(enforcePrecedence: false), UpmStrategies.FINAL, UpmStrategies.PREFLIGHT) final VersionStrategy development diff --git a/src/main/groovy/wooga/gradle/version/strategies/NetflixOssStrategies.groovy b/src/main/groovy/wooga/gradle/version/strategies/NetflixOssStrategies.groovy deleted file mode 100644 index 17f7d72..0000000 --- a/src/main/groovy/wooga/gradle/version/strategies/NetflixOssStrategies.groovy +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2014-2017 Netflix, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package wooga.gradle.version.strategies - -import wooga.gradle.version.internal.release.opinion.Strategies -import wooga.gradle.version.internal.release.semver.ChangeScope -import wooga.gradle.version.internal.release.semver.PartialSemVerStrategy -import wooga.gradle.version.internal.release.semver.SemVerStrategy -import wooga.gradle.version.internal.release.semver.SemVerStrategyState -import wooga.gradle.version.internal.release.semver.StrategyUtil -import org.gradle.api.Project -import wooga.gradle.version.strategies.operations.NormalPartials - -import java.util.regex.Pattern - -import static wooga.gradle.version.internal.release.semver.StrategyUtil.closure - -/** - * - * WARNING: This class have known issues. If you want this to work, please set NetflixOssStrategies.project with your current project. - * This class was deprecated in the last major and may be removed in the next releases. - */ -@Deprecated -class NetflixOssStrategies { - - @Deprecated - static final PartialSemVerStrategy TRAVIS_BRANCH_MAJOR_X = fromTravisPropertyPattern(~/^(\d+)\.x$/) - @Deprecated - static final PartialSemVerStrategy TRAVIS_BRANCH_MAJOR_MINOR_X = fromTravisPropertyPattern(~/^(\d+)\.(\d+)\.x$/) - static final PartialSemVerStrategy NEAREST_HIGHER_ANY = Strategies.Normal.NEAREST_HIGHER_ANY - private static final scopes = StrategyUtil.one( - Strategies.Normal.USE_SCOPE_STATE, - TRAVIS_BRANCH_MAJOR_X, - TRAVIS_BRANCH_MAJOR_MINOR_X, - NormalPartials.SCOPE_EMBED_IN_BRANCH, - NEAREST_HIGHER_ANY, - Strategies.Normal.useScope(ChangeScope.MINOR) - ) - - static final SemVerStrategy SNAPSHOT = Strategies.SNAPSHOT.copyWith(normalStrategy: scopes) - static final SemVerStrategy DEVELOPMENT = Strategies.DEVELOPMENT.copyWith( - normalStrategy: scopes, - buildMetadataStrategy: Strategies.BuildMetadata.COMMIT_ABBREVIATED_ID) - static final SemVerStrategy PRE_RELEASE = Strategies.PRE_RELEASE.copyWith(normalStrategy: scopes) - static final SemVerStrategy FINAL = Strategies.FINAL.copyWith(normalStrategy: scopes) - - @Deprecated - static final class BuildMetadata { - static final PartialSemVerStrategy DEVELOPMENT_METADATA_STRATEGY = Strategies.BuildMetadata.COMMIT_ABBREVIATED_ID - } - - static Project project - - @Deprecated - static final String TRAVIS_BRANCH_PROP = 'release.travisBranch' - - - /** - * Infers a normal increment based on the branch. Only here to give support for NetflixOssStrategies, will be removed on next major. - * This is deprecated, please use Strategies.Normal.fromMatchingBranchName or Strategies.Normal.fromBranchPattern - * @param project - * @param branchProperty - * @param pattern - * @return - */ - @Deprecated - static PartialSemVerStrategy fromTravisPropertyPattern(Pattern pattern) { - def branchProperty = TRAVIS_BRANCH_PROP - return closure { SemVerStrategyState state -> - if (project.hasProperty(branchProperty)) { - def branch = project.property(branchProperty).toString() - return Strategies.Normal.fromMatchingBranchName(branch, pattern).infer(state) - } - return state - } - } - - /** - * If the nearest any is higher from the nearest normal, sets the - * normal component to the nearest any's normal component. Otherwise - * do nothing. - * - *
- * For example, if the nearest any is {@code 1.2.3-alpha.1} and the - * nearest normal is {@code 1.2.2}, this will infer the normal - * component as {@code 1.2.3}. - *
- */ - @Deprecated - static PartialSemVerStrategy nearestHigherAny() { - return closure { state -> Strategies.Normal.NEAREST_HIGHER_ANY.infer(state) } - } -} diff --git a/src/main/groovy/wooga/gradle/version/strategies/NewSemverV1Strategies.groovy b/src/main/groovy/wooga/gradle/version/strategies/NewSemverV1Strategies.groovy deleted file mode 100644 index d84f485..0000000 --- a/src/main/groovy/wooga/gradle/version/strategies/NewSemverV1Strategies.groovy +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright 2017 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package wooga.gradle.version.strategies - - -import wooga.gradle.version.ReleaseStage -import wooga.gradle.version.internal.release.opinion.Strategies -import wooga.gradle.version.internal.release.semver.* -import wooga.gradle.version.strategies.partials.NormalPartials - -import static wooga.gradle.version.internal.release.semver.StrategyUtil.all -import static wooga.gradle.version.internal.release.semver.StrategyUtil.one - -class NewSemverV1Strategies { - - static final NORMAL_STRATEGY = one( - Strategies.Normal.USE_SCOPE_STATE, - NormalPartials.SCOPE_EMBED_IN_BRANCH, - Strategies.Normal.USE_NEAREST_ANY - ) - - /** - * Returns a version strategy to be used for {@code pre-release}/{@code candidate} builds. - *- * This strategy infers the release version by checking the nearest any release. - * If a {@code pre-release} with the same {@code major}.{@code minor}.{@code patch} version exists, bumps the count part. - *
- * Example new pre release: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.2.0" - * nearestAnyVersion = "" - * inferred = "1.3.0-rc00001" - * } - *- *
- * Example pre release version exists: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.2.0" - * nearestAnyVersion = "1.3.0-rc00001" - * inferred = "1.3.0-rc00002" - * } - *- *
- * Example last final release higher than pre-release: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.3.0" - * nearestAnyVersion = "1.3.0-rc00001" - * inferred = "1.4.0-rc00001" - * } - *- */ - static final SemVerStrategy PRE_RELEASE = Strategies.PRE_RELEASE.copyWith( - normalStrategy: NORMAL_STRATEGY, - preReleaseStrategy: all ( - Strategies.PreRelease.STAGE_FIXED, - Strategies.PreRelease.countIncremented("", 5), - ) - ) - - /** - * Returns a version strategy to be used for {@code final} builds. - *
- * This strategy infers the release version by checking the nearest release. - *
- * Example: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.3.0" - * inferred = "1.4.0" - * } - *- */ - static final SemVerStrategy FINAL = Strategies.FINAL.copyWith(normalStrategy: NORMAL_STRATEGY) - - /** - * Returns a version strategy to be used for {@code development} builds. - *
- * This strategy creates a unique version string based on last commit hash and the - * distance of commits to nearest normal version. - * This version string is not compatible with Paket or - * Nuget - *
- * Example: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.3.0" - * commitHash = "90c90b9" - * distance = 22 - * inferred = "1.3.0-dev.22+90c90b9" - * } - *- */ - static final SemVerStrategy DEVELOPMENT = Strategies.DEVELOPMENT.copyWith( - normalStrategy: NORMAL_STRATEGY, - buildMetadataStrategy: Strategies.BuildMetadata.COMMIT_ABBREVIATED_ID - ) - - /** - * Returns a version strategy to be used for {@code snapshot} builds. - *
- * This strategy creates a snapshot version suitable for Paket and - * Nuget. {@code Nuget} and {@code Paket} don't support - * {@code SNAPSHOT} versions or any numerical values after the {@code patch} component. We trick these package managers - * by creating a unique version based on {@code branch} and the distance of commits to nearest normal version. - * If the branch name contains numerical values, they will be converted into alphanumerical counterparts. - * The {@code master} branch is a special case so it will end up being higher than any other branch build (m>b) - *
- * Example from master branch: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.3.0" - * branch = "master" - * distance = 22 - * inferred = "1.4.0-master00022" - * } - *- *
- * Example from topic branch: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.3.0" - * branch = "feature/fix_22" - * distance = 34 - * inferred = "1.4.0-branchFeatureFixTwoTwo00034" - * } - *- */ - static final SemVerStrategy SNAPSHOT = Strategies.PRE_RELEASE.copyWith( - name: 'snapshot', - stages: ['snapshot','SNAPSHOT'] as SortedSet, - normalStrategy: NORMAL_STRATEGY, - preReleaseStrategy: all(Strategies.PreRelease.PAKET_BRANCH_NAME, - Strategies.PreRelease.countCommitsSinceNormal("", 5)), - createTag: false, - allowDirtyRepo: true, - enforcePrecedence: false, - releaseStage: ReleaseStage.Snapshot - ) -} diff --git a/src/main/groovy/wooga/gradle/version/strategies/NewSemverV2Strategies.groovy b/src/main/groovy/wooga/gradle/version/strategies/NewSemverV2Strategies.groovy deleted file mode 100644 index 826a789..0000000 --- a/src/main/groovy/wooga/gradle/version/strategies/NewSemverV2Strategies.groovy +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright 2017 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package wooga.gradle.version.strategies - -import wooga.gradle.version.VersionScheme -import wooga.gradle.version.ReleaseStage -import wooga.gradle.version.internal.release.opinion.Strategies -import wooga.gradle.version.internal.release.semver.SemVerStrategy -import wooga.gradle.version.strategies.partials.NormalPartials - -import static wooga.gradle.version.internal.release.semver.StrategyUtil.* - - -final class NewSemverV2Strategies { - - static final NORMAL_STRATEGY = one( - Strategies.Normal.USE_SCOPE_STATE, - NormalPartials.SCOPE_FROM_BRANCH, - Strategies.Normal.USE_NEAREST_ANY - ) - - /** - * Returns a version strategy to be used for {@code final} builds. - *
- * This strategy infers the release version by checking the nearest release. - *
- * Example: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.3.0" - * inferred = "1.4.0" - * } - *- */ - static final SemVerStrategy FINAL = Strategies.FINAL.copyWith( - name: 'production', - allowDirtyRepo: true, - normalStrategy: NORMAL_STRATEGY, - stages: ['final','production'] as SortedSet, - releaseStage: ReleaseStage.Final - ) - /** - * Returns a version strategy to be used for {@code pre-release}/{@code candidate} builds. - *
- * This strategy infers the release version by checking the nearest any release. - * If a {@code pre-release} with the same {@code major}.{@code minor}.{@code patch} version exists, bumps the count part. - *
- * Example new pre release: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.2.0" - * nearestAnyVersion = "" - * inferred = "1.3.0-rc.1" - * } - *- *
- * Example pre release version exists: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.2.0" - * nearestAnyVersion = "1.3.0-rc.1" - * inferred = "1.3.0-rc.2" - * } - *- *
- * Example last final release higher than pre-release: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.3.0" - * nearestAnyVersion = "1.3.0-rc.1" - * inferred = "1.4.0-rc.1" - * } - *- */ - static final SemVerStrategy PRE_RELEASE = Strategies.PRE_RELEASE.copyWith( - name: 'pre-release', - normalStrategy: NORMAL_STRATEGY, - stages: ['rc', 'staging'] as SortedSet, - preReleaseStrategy: all(Strategies.PreRelease.STAGE_FIXED, Strategies.PreRelease.COUNT_INCREMENTED), - releaseStage: ReleaseStage.Prerelease, - allowDirtyRepo: true, - ) - - /** - * Returns a version strategy to be used for {@code development} builds. - *
- * This strategy creates a unique version string based on last commit hash and the - * distance of commits to nearest normal version. - * This version string is not compatible with Paket or - * Nuget - *
- * Example: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.3.0" - * commitHash = "90c90b9" - * distance = 22 - * inferred = "1.3.0-dev.22+90c90b9" - * } - *- */ - static final SemVerStrategy DEVELOPMENT = Strategies.DEVELOPMENT.copyWith( - normalStrategy: NORMAL_STRATEGY, - buildMetadataStrategy: Strategies.BuildMetadata.COMMIT_ABBREVIATED_ID, - ) - - /** - * Returns a version strategy to be used for {@code snapshot} builds. - *
- * This strategy creates a snapshot version based on Semver 2.0.0. - * Branch names will be encoded in the pre-release part of the version. - *
- * Example from master branch: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.3.0" - * branch = "master" - * distance = 22 - * inferred = "1.4.0-master.22" - * } - *- *
- * Example from topic branch: - *
- * {@code - * releaseScope = "minor" - * nearestVersion = "1.3.0" - * branch = "feature/fix_22" - * distance = 34 - * inferred = "1.4.0-branch.feature.fix.22.34" - * } - *- */ - static final SemVerStrategy SNAPSHOT = Strategies.SNAPSHOT.copyWith( - stages: ['ci', 'snapshot', 'SNAPSHOT'] as SortedSet, - normalStrategy: NORMAL_STRATEGY, - allowDirtyRepo: true, - preReleaseStrategy: all(Strategies.PreRelease.WITH_BRANCH_NAME, - Strategies.PreRelease.COUNT_COMMITS_SINCE_ANY), - ) - - static final VersionScheme scheme = new VersionScheme() { - final SemVerStrategy development = DEVELOPMENT - final SemVerStrategy snapshot = SNAPSHOT - final SemVerStrategy preRelease = PRE_RELEASE - final SemVerStrategy finalStrategy = FINAL - final SemVerStrategy defaultStrategy = DEVELOPMENT - final List
@@ -102,16 +71,11 @@ class SemverV1Strategies { * */ static final SemVerStrategy PRE_RELEASE = Strategies.PRE_RELEASE.copyWith( - normalStrategy: scopes, - releaseStage: ReleaseStage.Prerelease, - preReleaseStrategy: StrategyUtil.all(closure({ state -> - state = Strategies.PreRelease.STAGE_FIXED.infer(state) - def stage = state.inferredPreRelease - def count = COUNT_INCREMENTED.infer(state).inferredPreRelease - count = count.split(/\./).last() - def integration = "$count".padLeft(5, '0') - state.copyWith(inferredPreRelease: "$stage$integration") - })) + normalStrategy: NORMAL_STRATEGY, + preReleaseStrategy: all ( + Strategies.PreRelease.STAGE_FIXED, + Strategies.PreRelease.countIncremented("", 5), + ) ) /** @@ -128,7 +92,7 @@ class SemverV1Strategies { * } * */ - static final SemVerStrategy FINAL = Strategies.FINAL.copyWith(normalStrategy: scopes) + static final SemVerStrategy FINAL = Strategies.FINAL.copyWith(normalStrategy: NORMAL_STRATEGY) /** * Returns a version strategy to be used for {@code development} builds. @@ -150,8 +114,9 @@ class SemverV1Strategies { * */ static final SemVerStrategy DEVELOPMENT = Strategies.DEVELOPMENT.copyWith( - normalStrategy: scopes, - buildMetadataStrategy: NetflixOssStrategies.BuildMetadata.DEVELOPMENT_METADATA_STRATEGY) + normalStrategy: NORMAL_STRATEGY, + buildMetadataStrategy: Strategies.BuildMetadata.COMMIT_ABBREVIATED_ID + ) /** * Returns a version strategy to be used for {@code snapshot} builds. @@ -181,47 +146,19 @@ class SemverV1Strategies { * nearestVersion = "1.3.0" * branch = "feature/fix_22" * distance = 34 - * inferred = "1.4.0-branchFeatureFixTwoTow00034" + * inferred = "1.4.0-branchFeatureFixTwoTwo00034" * } * */ static final SemVerStrategy SNAPSHOT = Strategies.PRE_RELEASE.copyWith( name: 'snapshot', stages: ['snapshot','SNAPSHOT'] as SortedSet, - releaseStage: ReleaseStage.Snapshot, - normalStrategy: scopes, - preReleaseStrategy: StrategyUtil.all(StrategyUtil.closure({state -> - - String branchName = state.currentBranch.name - - if( branchName == "HEAD" && System.getenv("BRANCH_NAME") ) { - branchName = System.getenv("BRANCH_NAME") - } - - if( branchName != "master") { - String prefix = "branch" - branchName = "$prefix${branchName.capitalize()}" - } - - branchName = branchName.replaceAll(/(\/|-|_)([\w])/) {all, delimiter, firstAfter -> "${firstAfter.capitalize()}" } - branchName = branchName.replaceAll(/\./, "Dot") - branchName = branchName.replaceAll(/0/, "Zero") - branchName = branchName.replaceAll(/1/, "One") - branchName = branchName.replaceAll(/2/, "Two") - branchName = branchName.replaceAll(/3/, "Three") - branchName = branchName.replaceAll(/4/, "Four") - branchName = branchName.replaceAll(/5/, "Five") - branchName = branchName.replaceAll(/6/, "Six") - branchName = branchName.replaceAll(/7/, "Seven") - branchName = branchName.replaceAll(/8/, "Eight") - branchName = branchName.replaceAll(/9/, "Nine") - - def buildSinceAny = state.nearestVersion.distanceFromNormal - def integration = "$buildSinceAny".padLeft(5, '0') - state.copyWith(inferredPreRelease: "$branchName$integration") - })), + normalStrategy: NORMAL_STRATEGY, + preReleaseStrategy: all(Strategies.PreRelease.PAKET_BRANCH_NAME, + Strategies.PreRelease.countCommitsSinceNormal("", 5)), createTag: false, allowDirtyRepo: true, - enforcePrecedence: false + enforcePrecedence: false, + releaseStage: ReleaseStage.Snapshot ) } diff --git a/src/main/groovy/wooga/gradle/version/strategies/SemverV2Strategies.groovy b/src/main/groovy/wooga/gradle/version/strategies/SemverV2Strategies.groovy index de52119..4e20d66 100644 --- a/src/main/groovy/wooga/gradle/version/strategies/SemverV2Strategies.groovy +++ b/src/main/groovy/wooga/gradle/version/strategies/SemverV2Strategies.groovy @@ -17,89 +17,21 @@ package wooga.gradle.version.strategies +import wooga.gradle.version.VersionScheme import wooga.gradle.version.ReleaseStage import wooga.gradle.version.internal.release.opinion.Strategies -import wooga.gradle.version.internal.release.opinion.Strategies.BuildMetadata -import wooga.gradle.version.internal.release.semver.ChangeScope -import wooga.gradle.version.internal.release.semver.PartialSemVerStrategy import wooga.gradle.version.internal.release.semver.SemVerStrategy -import wooga.gradle.version.internal.release.semver.SemVerStrategyState - -import java.util.regex.Pattern +import wooga.gradle.version.strategies.partials.NormalPartials import static wooga.gradle.version.internal.release.semver.StrategyUtil.* -/** - * Deprecated, please use SemverV2WithDefaultStrategies instead. - */ -@Deprecated + final class SemverV2Strategies { - private static final scopes = one( + static final NORMAL_STRATEGY = one( Strategies.Normal.USE_SCOPE_STATE, - Normal.matchBranchPatternAndUseScope(~/feature(?:\/|-).+$/, ChangeScope.MINOR), - Normal.matchBranchPatternAndUseScope(~/hotfix(?:\/|-).+$/, ChangeScope.PATCH), - Normal.matchBranchPatternAndUseScope(~/fix(?:\/|-).+$/, ChangeScope.MINOR), - Strategies.Normal.ENFORCE_GITFLOW_BRANCH_MAJOR_X, - Strategies.Normal.ENFORCE_BRANCH_MAJOR_X, - Strategies.Normal.ENFORCE_GITFLOW_BRANCH_MAJOR_MINOR_X, - Strategies.Normal.ENFORCE_BRANCH_MAJOR_MINOR_X, - Strategies.Normal.USE_NEAREST_ANY, - Strategies.Normal.useScope(ChangeScope.MINOR) - ) - - static final class Normal { - static PartialSemVerStrategy matchBranchPatternAndUseScope(Pattern pattern, ChangeScope scope) { - return closure { SemVerStrategyState state -> - def m = state.currentBranch.name =~ pattern - if (m.matches()) { - return incrementNormalFromScope(state, scope) - } - - return state - } - } - } - - static final class PreRelease { - static PartialSemVerStrategy STAGE_BRANCH_NAME = closure { SemVerStrategyState state -> - String branchName = state.currentBranch.name - String prefix = "branch" - - if (branchName == "HEAD" && System.getenv("BRANCH_NAME")) { - branchName = System.getenv("BRANCH_NAME") - } - - if (!branchName.matches(state.mainBranchPattern)) { - branchName = "$prefix.${branchName.toLowerCase()}" - } - //Split at branch delimiter /-_+ and replace with . - branchName = branchName.replaceAll(/((\/|-|_|\.)+)([\w])/) { all, delimiterAll, delimiter , firstAfter -> ".${firstAfter}" } - //Remove all hanging /-_+ - branchName = branchName.replaceAll(/[-\/_\+]+$/) { "" } - //parse all digits and replace with unpadded value e.g. 001 -> 1 - branchName = branchName.replaceAll(/([\w\.])([0-9]+)/) { all, s, delimiter -> - if(s == ".") { - s = "" - } - - "${s}.${Integer.parseInt(delimiter).toString()}" - } - def inferred = state.inferredPreRelease ? "${state.inferredPreRelease}.${branchName}" : "${branchName}" - state.copyWith(inferredPreRelease: inferred) - } - } - - static final SemVerStrategy DEFAULT = new SemVerStrategy( - name: '', - stages: [] as SortedSet, - allowDirtyRepo: true, - normalStrategy: scopes, - preReleaseStrategy: Strategies.PreRelease.NONE, - buildMetadataStrategy: BuildMetadata.NONE, - createTag: true, - enforcePrecedence: true, - releaseStage: ReleaseStage.Unknown + NormalPartials.SCOPE_FROM_BRANCH, + Strategies.Normal.USE_NEAREST_ANY ) /** @@ -116,12 +48,13 @@ final class SemverV2Strategies { * } * */ - static final SemVerStrategy FINAL = DEFAULT.copyWith( + static final SemVerStrategy FINAL = Strategies.FINAL.copyWith( name: 'production', + allowDirtyRepo: true, + normalStrategy: NORMAL_STRATEGY, stages: ['final','production'] as SortedSet, releaseStage: ReleaseStage.Final ) - /** * Returns a version strategy to be used for {@code pre-release}/{@code candidate} builds. *
@@ -158,11 +91,13 @@ final class SemverV2Strategies { * } * */ - static final SemVerStrategy PRE_RELEASE = DEFAULT.copyWith( + static final SemVerStrategy PRE_RELEASE = Strategies.PRE_RELEASE.copyWith( name: 'pre-release', + normalStrategy: NORMAL_STRATEGY, stages: ['rc', 'staging'] as SortedSet, preReleaseStrategy: all(Strategies.PreRelease.STAGE_FIXED, Strategies.PreRelease.COUNT_INCREMENTED), - releaseStage: ReleaseStage.Prerelease + releaseStage: ReleaseStage.Prerelease, + allowDirtyRepo: true, ) /** @@ -185,8 +120,8 @@ final class SemverV2Strategies { * */ static final SemVerStrategy DEVELOPMENT = Strategies.DEVELOPMENT.copyWith( - normalStrategy: scopes, - buildMetadataStrategy: NetflixOssStrategies.BuildMetadata.DEVELOPMENT_METADATA_STRATEGY + normalStrategy: NORMAL_STRATEGY, + buildMetadataStrategy: Strategies.BuildMetadata.COMMIT_ABBREVIATED_ID, ) /** @@ -217,12 +152,11 @@ final class SemverV2Strategies { * } * */ - static final SemVerStrategy SNAPSHOT = DEFAULT.copyWith( - name: 'snapshot', + static final SemVerStrategy SNAPSHOT = Strategies.SNAPSHOT.copyWith( stages: ['ci', 'snapshot', 'SNAPSHOT'] as SortedSet, - createTag: false, - preReleaseStrategy: all(PreRelease.STAGE_BRANCH_NAME, Strategies.PreRelease.COUNT_COMMITS_SINCE_ANY), - enforcePrecedence: false, - releaseStage: ReleaseStage.Snapshot + normalStrategy: NORMAL_STRATEGY, + allowDirtyRepo: true, + preReleaseStrategy: all(Strategies.PreRelease.WITH_BRANCH_NAME, + Strategies.PreRelease.COUNT_COMMITS_SINCE_ANY), ) } diff --git a/src/main/groovy/wooga/gradle/version/strategies/StaticMarkerStrategies.groovy b/src/main/groovy/wooga/gradle/version/strategies/StaticMarkerStrategies.groovy index 87df13e..5848af4 100644 --- a/src/main/groovy/wooga/gradle/version/strategies/StaticMarkerStrategies.groovy +++ b/src/main/groovy/wooga/gradle/version/strategies/StaticMarkerStrategies.groovy @@ -194,6 +194,6 @@ class StaticMarkerStrategies { static final SemVerStrategy PREFLIGHT = SNAPSHOT.copyWith( releaseStage: ReleaseStage.Preflight, stages: ['pre', 'preflight', 'adhoc'] as SortedSet, - preReleaseStrategy: all(Strategies.PreRelease.STAGE_FIXED, SemverV2Strategies.PreRelease.STAGE_BRANCH_NAME, Strategies.PreRelease.COUNT_COMMITS_SINCE_MARKER), + preReleaseStrategy: all(Strategies.PreRelease.STAGE_FIXED, Strategies.PreRelease.WITH_BRANCH_NAME, Strategies.PreRelease.COUNT_COMMITS_SINCE_MARKER), ) } diff --git a/src/main/groovy/wooga/gradle/version/strategies/WdkStrategies.groovy b/src/main/groovy/wooga/gradle/version/strategies/WdkStrategies.groovy deleted file mode 100644 index 5ae98af..0000000 --- a/src/main/groovy/wooga/gradle/version/strategies/WdkStrategies.groovy +++ /dev/null @@ -1,10 +0,0 @@ -package wooga.gradle.version.strategies - -import wooga.gradle.version.strategies.opinion.WdkNuGetStrategies - -/** - * Deprecated: please use WdkNuGetStrategies instead - */ -@Deprecated -class WdkStrategies extends WdkNuGetStrategies { -} diff --git a/src/main/groovy/wooga/gradle/version/strategies/operations/NormalPartials.groovy b/src/main/groovy/wooga/gradle/version/strategies/operations/NormalPartials.groovy deleted file mode 100644 index 9411513..0000000 --- a/src/main/groovy/wooga/gradle/version/strategies/operations/NormalPartials.groovy +++ /dev/null @@ -1,81 +0,0 @@ -package wooga.gradle.version.strategies.operations - -import org.gradle.api.Project -import wooga.gradle.version.internal.release.opinion.Strategies -import wooga.gradle.version.internal.release.semver.ChangeScope -import wooga.gradle.version.internal.release.semver.PartialSemVerStrategy -import wooga.gradle.version.internal.release.semver.SemVerStrategyState -import wooga.gradle.version.strategies.NetflixOssStrategies - -import java.util.regex.Pattern - -import static wooga.gradle.version.internal.release.semver.StrategyUtil.closure -import static wooga.gradle.version.internal.release.semver.StrategyUtil.one - -class NormalPartials { - - static final SCOPE_GITFLOW_BRANCH_TYPE = one( - scopeForBranchPattern(~/hotfix(?:\/|-).+$/, ChangeScope.PATCH), - scopeForBranchPattern(~/feature(?:\/|-).+$/, ChangeScope.MINOR), - scopeForBranchPattern(~/fix(?:\/|-).+$/, ChangeScope.MINOR), - ) - - static final SCOPE_EMBED_IN_BRANCH = one( - Strategies.Normal.ENFORCE_GITFLOW_BRANCH_MAJOR_X, - Strategies.Normal.ENFORCE_GITFLOW_BRANCH_MAJOR_MINOR_X, - Strategies.Normal.ENFORCE_BRANCH_MAJOR_X, - Strategies.Normal.ENFORCE_BRANCH_MAJOR_MINOR_X, - ) - - static final SCOPE_FROM_BRANCH = one( - SCOPE_GITFLOW_BRANCH_TYPE, - SCOPE_EMBED_IN_BRANCH - ) - - @Deprecated - static final PartialSemVerStrategy TRAVIS_BRANCH_MAJOR_X = fromBranchProperty(~/^(\d+)\.x$/) - @Deprecated - static final PartialSemVerStrategy TRAVIS_BRANCH_MAJOR_MINOR_X = fromBranchProperty(~/^(\d+)\.(\d+)\.x$/) - - /** - * If the nearest any is higher from the nearest normal, sets the - * normal component to the nearest any's normal component. Otherwise - * do nothing. - * - *
- * For example, if the nearest any is {@code 1.2.3-alpha.1} and the - * nearest normal is {@code 1.2.2}, this will infer the normal - * component as {@code 1.2.3}. - *
- */ - static final PartialSemVerStrategy NEAREST_HIGHER_ANY = closure { state -> - def nearest = state.nearestVersion - if (nearest.any.lessThanOrEqualTo(nearest.normal)) { - return state - } else { - return state.copyWith(inferredNormal: nearest.any.normalVersion) - } - } - - static PartialSemVerStrategy scopeForBranchPattern(Pattern pattern, ChangeScope scope) { - return closure { SemVerStrategyState state -> - def m = state.currentBranch.name =~ pattern - if (m.matches()) { - return Strategies.Normal.useScope(scope).infer(state) - } - return state - } - } - - static PartialSemVerStrategy fromBranchProperty(Project project = NetflixOssStrategies.project, - String branchProperty = NetflixOssStrategies.TRAVIS_BRANCH_PROP, - Pattern pattern) { - return closure { SemVerStrategyState state -> - if (project.hasProperty(branchProperty)) { - def branch = project.property(branchProperty).toString() - return Strategies.Normal.fromMatchingBranchName(branch, pattern).infer(state) - } - return state - } - } -} diff --git a/src/main/groovy/wooga/gradle/version/strategies/opinion/LegacyNuGetStrategies.groovy b/src/main/groovy/wooga/gradle/version/strategies/opinion/LegacyNuGetStrategies.groovy index f03c44e..ac65df0 100644 --- a/src/main/groovy/wooga/gradle/version/strategies/opinion/LegacyNuGetStrategies.groovy +++ b/src/main/groovy/wooga/gradle/version/strategies/opinion/LegacyNuGetStrategies.groovy @@ -6,10 +6,10 @@ import wooga.gradle.version.internal.release.semver.ChangeScope import wooga.gradle.version.internal.release.semver.PartialSemVerStrategy import wooga.gradle.version.internal.release.semver.SemVerStrategy import wooga.gradle.version.internal.release.semver.StrategyUtil -import wooga.gradle.version.strategies.NewSemverV1Strategies +import wooga.gradle.version.strategies.SemverV1Strategies /** - * NuGet/Paket compatible strategies. Uses NewSemverV1Strategies as basis, + * NuGet/Paket compatible strategies. Uses SemverV1Strategies as basis, * plus using PATCH as a fallback if no change scope is provided. */ class LegacyNuGetStrategies { @@ -20,28 +20,28 @@ class LegacyNuGetStrategies { static final ChangeScope DEFAULT_SCOPE = ChangeScope.PATCH /** - * Similar to NewSemverV1Strategies.DEVELOPMENT, but its scope defaults to DEFAULT_SCOPE when no scope is provide + * Similar to SemverV1Strategies.DEVELOPMENT, but its scope defaults to DEFAULT_SCOPE when no scope is provide */ - static final SemVerStrategy DEVELOPMENT = NewSemverV1Strategies.DEVELOPMENT.copyWith( - normalStrategy: chainDefaultScope(NewSemverV1Strategies.DEVELOPMENT) + static final SemVerStrategy DEVELOPMENT = SemverV1Strategies.DEVELOPMENT.copyWith( + normalStrategy: chainDefaultScope(SemverV1Strategies.DEVELOPMENT) ) /** - * Similar to NewSemverV1Strategies.SNAPSHOT, but its scope defaults to DEFAULT_SCOPE when no scope is provide + * Similar to SemverV1Strategies.SNAPSHOT, but its scope defaults to DEFAULT_SCOPE when no scope is provide */ - static final SemVerStrategy SNAPSHOT = NewSemverV1Strategies.SNAPSHOT.copyWith( - normalStrategy: chainDefaultScope(NewSemverV1Strategies.SNAPSHOT) + static final SemVerStrategy SNAPSHOT = SemverV1Strategies.SNAPSHOT.copyWith( + normalStrategy: chainDefaultScope(SemverV1Strategies.SNAPSHOT) ) /** - * Similar to NewSemverV1Strategies.PRE_RELEASE, but its scope defaults to DEFAULT_SCOPE when no scope is provide + * Similar to SemverV1Strategies.PRE_RELEASE, but its scope defaults to DEFAULT_SCOPE when no scope is provide */ - static final SemVerStrategy PRE_RELEASE = NewSemverV1Strategies.PRE_RELEASE.copyWith( - normalStrategy: chainDefaultScope(NewSemverV1Strategies.PRE_RELEASE) + static final SemVerStrategy PRE_RELEASE = SemverV1Strategies.PRE_RELEASE.copyWith( + normalStrategy: chainDefaultScope(SemverV1Strategies.PRE_RELEASE) ) /** - * Similar to NewSemverV1Strategies.FINAL, but its scope defaults to DEFAULT_SCOPE when no scope is provide + * Similar to SemverV1Strategies.FINAL, but its scope defaults to DEFAULT_SCOPE when no scope is provide */ - static final SemVerStrategy FINAL = NewSemverV1Strategies.FINAL.copyWith( - normalStrategy: chainDefaultScope(NewSemverV1Strategies.FINAL) + static final SemVerStrategy FINAL = SemverV1Strategies.FINAL.copyWith( + normalStrategy: chainDefaultScope(SemverV1Strategies.FINAL) ) private static PartialSemVerStrategy chainDefaultScope(SemVerStrategy base, ChangeScope scope = DEFAULT_SCOPE) { diff --git a/src/main/groovy/wooga/gradle/version/strategies/opinion/SemverV2WithDefaultStrategies.groovy b/src/main/groovy/wooga/gradle/version/strategies/opinion/SemverV2WithDefaultStrategies.groovy index 6a4ff72..7635e34 100644 --- a/src/main/groovy/wooga/gradle/version/strategies/opinion/SemverV2WithDefaultStrategies.groovy +++ b/src/main/groovy/wooga/gradle/version/strategies/opinion/SemverV2WithDefaultStrategies.groovy @@ -5,7 +5,7 @@ import wooga.gradle.version.internal.release.semver.ChangeScope import wooga.gradle.version.internal.release.semver.PartialSemVerStrategy import wooga.gradle.version.internal.release.semver.SemVerStrategy import wooga.gradle.version.internal.release.semver.StrategyUtil -import wooga.gradle.version.strategies.NewSemverV2Strategies +import wooga.gradle.version.strategies.SemverV2Strategies /** * SemverV2 strategies that uses MINOR as a fallback in case a change scope is not provided. @@ -26,8 +26,8 @@ class SemverV2WithDefaultStrategies { * } * */ - static final SemVerStrategy FINAL = NewSemverV2Strategies.FINAL.copyWith( - normalStrategy: chainDefaultScope(NewSemverV2Strategies.FINAL) + static final SemVerStrategy FINAL = SemverV2Strategies.FINAL.copyWith( + normalStrategy: chainDefaultScope(SemverV2Strategies.FINAL) ) /** * Returns a version strategy to be used for {@code pre-release}/{@code candidate} builds. @@ -65,8 +65,8 @@ class SemverV2WithDefaultStrategies { * } * */ - static final SemVerStrategy PRE_RELEASE = NewSemverV2Strategies.PRE_RELEASE.copyWith( - normalStrategy: chainDefaultScope(NewSemverV2Strategies.PRE_RELEASE) + static final SemVerStrategy PRE_RELEASE = SemverV2Strategies.PRE_RELEASE.copyWith( + normalStrategy: chainDefaultScope(SemverV2Strategies.PRE_RELEASE) ) /** @@ -88,8 +88,8 @@ class SemverV2WithDefaultStrategies { * } * */ - static final SemVerStrategy DEVELOPMENT = NewSemverV2Strategies.DEVELOPMENT.copyWith( - normalStrategy: chainDefaultScope(NewSemverV2Strategies.DEVELOPMENT), + static final SemVerStrategy DEVELOPMENT = SemverV2Strategies.DEVELOPMENT.copyWith( + normalStrategy: chainDefaultScope(SemverV2Strategies.DEVELOPMENT), ) /** @@ -120,8 +120,8 @@ class SemverV2WithDefaultStrategies { * } * */ - static final SemVerStrategy SNAPSHOT = NewSemverV2Strategies.SNAPSHOT.copyWith( - normalStrategy: chainDefaultScope(NewSemverV2Strategies.SNAPSHOT), + static final SemVerStrategy SNAPSHOT = SemverV2Strategies.SNAPSHOT.copyWith( + normalStrategy: chainDefaultScope(SemverV2Strategies.SNAPSHOT), ) private static PartialSemVerStrategy chainDefaultScope(SemVerStrategy base, ChangeScope scope = ChangeScope.MINOR) { diff --git a/src/main/groovy/wooga/gradle/version/strategies/opinion/UpmStrategies.groovy b/src/main/groovy/wooga/gradle/version/strategies/opinion/UpmStrategies.groovy index 023f59b..0f8d609 100644 --- a/src/main/groovy/wooga/gradle/version/strategies/opinion/UpmStrategies.groovy +++ b/src/main/groovy/wooga/gradle/version/strategies/opinion/UpmStrategies.groovy @@ -4,27 +4,27 @@ package wooga.gradle.version.strategies.opinion import wooga.gradle.version.ReleaseStage import wooga.gradle.version.internal.release.opinion.Strategies import wooga.gradle.version.internal.release.semver.* -import wooga.gradle.version.strategies.NewSemverV2Strategies +import wooga.gradle.version.strategies.SemverV2Strategies import static wooga.gradle.version.internal.release.semver.StrategyUtil.* /** - * UPM-Specific strategies aimed at WDKs. Based on NewSemverV2Strategies, + * UPM-Specific strategies aimed at WDKs. Based on SemverV2Strategies, * plus the same default stage as the older LegacyNuGetStrategies. */ class UpmStrategies { /** - * Same as NewSemverV2Strategies.DEVELOPMENT plus LegacyNuGetStrategies.DEFAULT_SCOPE as a default in case no change scope is provided. + * Same as SemverV2Strategies.DEVELOPMENT plus LegacyNuGetStrategies.DEFAULT_SCOPE as a default in case no change scope is provided. */ - static final SemVerStrategy DEVELOPMENT = NewSemverV2Strategies.DEVELOPMENT.copyWith( - normalStrategy: chainDefaultScope(NewSemverV2Strategies.DEVELOPMENT) + static final SemVerStrategy DEVELOPMENT = SemverV2Strategies.DEVELOPMENT.copyWith( + normalStrategy: chainDefaultScope(SemverV2Strategies.DEVELOPMENT) ) /** - * Same as NewSemverV2Strategies.SNAPSHOT plus LegacyNuGetStrategies.DEFAULT_SCOPE as a default in case no change scope is provided. + * Same as SemverV2Strategies.SNAPSHOT plus LegacyNuGetStrategies.DEFAULT_SCOPE as a default in case no change scope is provided. */ - static final SemVerStrategy SNAPSHOT = NewSemverV2Strategies.SNAPSHOT.copyWith( - normalStrategy: chainDefaultScope(NewSemverV2Strategies.SNAPSHOT) + static final SemVerStrategy SNAPSHOT = SemverV2Strategies.SNAPSHOT.copyWith( + normalStrategy: chainDefaultScope(SemverV2Strategies.SNAPSHOT) ) /** * Returns a version strategy to be used for {@code preflight} builds. @@ -43,26 +43,26 @@ class UpmStrategies { inferred = "1.4.0-pre.202201011010" } */ - static final SemVerStrategy PREFLIGHT = NewSemverV2Strategies.SNAPSHOT.copyWith( + static final SemVerStrategy PREFLIGHT = SemverV2Strategies.SNAPSHOT.copyWith( releaseStage: ReleaseStage.Preflight, stages: ['pre', 'preflight'] as SortedSet, - normalStrategy: chainDefaultScope(NewSemverV2Strategies.SNAPSHOT), + normalStrategy: chainDefaultScope(SemverV2Strategies.SNAPSHOT), preReleaseStrategy: all( Strategies.PreRelease.STAGE_FIXED, Strategies.PreRelease.withTimestamp(".") ), ) /** - * Same as NewSemverV2Strategies.PRE_RELEASE plus LegacyNuGetStrategies.DEFAULT_SCOPE as a default in case no change scope is provided. + * Same as SemverV2Strategies.PRE_RELEASE plus LegacyNuGetStrategies.DEFAULT_SCOPE as a default in case no change scope is provided. */ - static final SemVerStrategy PRE_RELEASE = NewSemverV2Strategies.PRE_RELEASE.copyWith( - normalStrategy: chainDefaultScope(NewSemverV2Strategies.PRE_RELEASE) + static final SemVerStrategy PRE_RELEASE = SemverV2Strategies.PRE_RELEASE.copyWith( + normalStrategy: chainDefaultScope(SemverV2Strategies.PRE_RELEASE) ) /** - * Same as NewSemverV2Strategies.FINAL plus LegacyNuGetStrategies.DEFAULT_SCOPE as a default in case no change scope is provided. + * Same as SemverV2Strategies.FINAL plus LegacyNuGetStrategies.DEFAULT_SCOPE as a default in case no change scope is provided. */ - static final SemVerStrategy FINAL = NewSemverV2Strategies.FINAL.copyWith( - normalStrategy: chainDefaultScope(NewSemverV2Strategies.FINAL) + static final SemVerStrategy FINAL = SemverV2Strategies.FINAL.copyWith( + normalStrategy: chainDefaultScope(SemverV2Strategies.FINAL) ) private static PartialSemVerStrategy chainDefaultScope(SemVerStrategy base, diff --git a/src/test/groovy/wooga/gradle/version/NewSemverV1StrategySpec.groovy b/src/test/groovy/wooga/gradle/version/SemverV1StrategySpec.groovy similarity index 96% rename from src/test/groovy/wooga/gradle/version/NewSemverV1StrategySpec.groovy rename to src/test/groovy/wooga/gradle/version/SemverV1StrategySpec.groovy index 9d98099..69798ed 100644 --- a/src/test/groovy/wooga/gradle/version/NewSemverV1StrategySpec.groovy +++ b/src/test/groovy/wooga/gradle/version/SemverV1StrategySpec.groovy @@ -4,16 +4,16 @@ import nebula.test.ProjectSpec import org.ajoberstar.grgit.Grgit import spock.lang.Unroll import wooga.gradle.version.internal.release.semver.SemVerStrategy -import wooga.gradle.version.strategies.NewSemverV1Strategies +import wooga.gradle.version.strategies.SemverV1Strategies -class NewSemverV1StrategySpec extends ProjectSpec { +class SemverV1StrategySpec extends ProjectSpec { public static final String PLUGIN_NAME = 'net.wooga.version' static final VersionScheme semverV1Scheme = new VersionScheme() { - final SemVerStrategy development = NewSemverV1Strategies.DEVELOPMENT - final SemVerStrategy snapshot = NewSemverV1Strategies.SNAPSHOT - final SemVerStrategy preRelease = NewSemverV1Strategies.PRE_RELEASE - final SemVerStrategy finalStrategy = NewSemverV1Strategies.FINAL + final SemVerStrategy development = SemverV1Strategies.DEVELOPMENT + final SemVerStrategy snapshot = SemverV1Strategies.SNAPSHOT + final SemVerStrategy preRelease = SemverV1Strategies.PRE_RELEASE + final SemVerStrategy finalStrategy = SemverV1Strategies.FINAL final SemVerStrategy defaultStrategy = development final List