@@ -42,82 +42,6 @@ public static class ConfigExtensions
42
42
43
43
public static bool IsReleaseBranch ( this Config config , string branchName ) => config . GetConfigForBranch ( branchName ) ? . IsReleaseBranch ?? false ;
44
44
45
- public static EffectiveConfiguration CalculateEffectiveConfiguration ( this Config configuration , BranchConfig currentBranchConfig )
46
- {
47
- var name = currentBranchConfig . Name ;
48
- if ( ! currentBranchConfig . VersioningMode . HasValue )
49
- throw new Exception ( $ "Configuration value for 'Versioning mode' for branch { name } has no value. (this should not happen, please report an issue)") ;
50
- if ( ! currentBranchConfig . Increment . HasValue )
51
- throw new Exception ( $ "Configuration value for 'Increment' for branch { name } has no value. (this should not happen, please report an issue)") ;
52
- if ( ! currentBranchConfig . PreventIncrementOfMergedBranchVersion . HasValue )
53
- throw new Exception ( $ "Configuration value for 'PreventIncrementOfMergedBranchVersion' for branch { name } has no value. (this should not happen, please report an issue)") ;
54
- if ( ! currentBranchConfig . TrackMergeTarget . HasValue )
55
- throw new Exception ( $ "Configuration value for 'TrackMergeTarget' for branch { name } has no value. (this should not happen, please report an issue)") ;
56
- if ( ! currentBranchConfig . TracksReleaseBranches . HasValue )
57
- throw new Exception ( $ "Configuration value for 'TracksReleaseBranches' for branch { name } has no value. (this should not happen, please report an issue)") ;
58
- if ( ! currentBranchConfig . IsReleaseBranch . HasValue )
59
- throw new Exception ( $ "Configuration value for 'IsReleaseBranch' for branch { name } has no value. (this should not happen, please report an issue)") ;
60
-
61
- if ( ! configuration . AssemblyVersioningScheme . HasValue )
62
- throw new Exception ( "Configuration value for 'AssemblyVersioningScheme' has no value. (this should not happen, please report an issue)" ) ;
63
- if ( ! configuration . AssemblyFileVersioningScheme . HasValue )
64
- throw new Exception ( "Configuration value for 'AssemblyFileVersioningScheme' has no value. (this should not happen, please report an issue)" ) ;
65
- if ( ! configuration . CommitMessageIncrementing . HasValue )
66
- throw new Exception ( "Configuration value for 'CommitMessageIncrementing' has no value. (this should not happen, please report an issue)" ) ;
67
- if ( ! configuration . LegacySemVerPadding . HasValue )
68
- throw new Exception ( "Configuration value for 'LegacySemVerPadding' has no value. (this should not happen, please report an issue)" ) ;
69
- if ( ! configuration . BuildMetaDataPadding . HasValue )
70
- throw new Exception ( "Configuration value for 'BuildMetaDataPadding' has no value. (this should not happen, please report an issue)" ) ;
71
- if ( ! configuration . CommitsSinceVersionSourcePadding . HasValue )
72
- throw new Exception ( "Configuration value for 'CommitsSinceVersionSourcePadding' has no value. (this should not happen, please report an issue)" ) ;
73
- if ( ! configuration . TagPreReleaseWeight . HasValue )
74
- throw new Exception ( "Configuration value for 'TagPreReleaseWeight' has no value. (this should not happen, please report an issue)" ) ;
75
-
76
- var versioningMode = currentBranchConfig . VersioningMode . Value ;
77
- var tag = currentBranchConfig . Tag ;
78
- var tagNumberPattern = currentBranchConfig . TagNumberPattern ;
79
- var incrementStrategy = currentBranchConfig . Increment . Value ;
80
- var preventIncrementForMergedBranchVersion = currentBranchConfig . PreventIncrementOfMergedBranchVersion . Value ;
81
- var trackMergeTarget = currentBranchConfig . TrackMergeTarget . Value ;
82
- var preReleaseWeight = currentBranchConfig . PreReleaseWeight ?? 0 ;
83
-
84
- var nextVersion = configuration . NextVersion ;
85
- var assemblyVersioningScheme = configuration . AssemblyVersioningScheme . Value ;
86
- var assemblyFileVersioningScheme = configuration . AssemblyFileVersioningScheme . Value ;
87
- var assemblyInformationalFormat = configuration . AssemblyInformationalFormat ;
88
- var assemblyVersioningFormat = configuration . AssemblyVersioningFormat ;
89
- var assemblyFileVersioningFormat = configuration . AssemblyFileVersioningFormat ;
90
- var gitTagPrefix = configuration . TagPrefix ;
91
- var majorMessage = configuration . MajorVersionBumpMessage ;
92
- var minorMessage = configuration . MinorVersionBumpMessage ;
93
- var patchMessage = configuration . PatchVersionBumpMessage ;
94
- var noBumpMessage = configuration . NoBumpMessage ;
95
- var commitDateFormat = configuration . CommitDateFormat ;
96
- var updateBuildNumber = configuration . UpdateBuildNumber ?? true ;
97
- var tagPreReleaseWeight = configuration . TagPreReleaseWeight . Value ;
98
-
99
- var commitMessageVersionBump = currentBranchConfig . CommitMessageIncrementing ?? configuration . CommitMessageIncrementing . Value ;
100
- return new EffectiveConfiguration (
101
- assemblyVersioningScheme , assemblyFileVersioningScheme , assemblyInformationalFormat , assemblyVersioningFormat , assemblyFileVersioningFormat , versioningMode , gitTagPrefix ,
102
- tag , nextVersion , incrementStrategy ,
103
- currentBranchConfig . Regex ,
104
- preventIncrementForMergedBranchVersion ,
105
- tagNumberPattern , configuration . ContinuousDeploymentFallbackTag ,
106
- trackMergeTarget ,
107
- majorMessage , minorMessage , patchMessage , noBumpMessage ,
108
- commitMessageVersionBump ,
109
- configuration . LegacySemVerPadding . Value ,
110
- configuration . BuildMetaDataPadding . Value ,
111
- configuration . CommitsSinceVersionSourcePadding . Value ,
112
- configuration . Ignore . ToFilters ( ) ,
113
- currentBranchConfig . TracksReleaseBranches . Value ,
114
- currentBranchConfig . IsReleaseBranch . Value ,
115
- commitDateFormat ,
116
- updateBuildNumber ,
117
- preReleaseWeight ,
118
- tagPreReleaseWeight ) ;
119
- }
120
-
121
45
public static string GetBranchSpecificTag ( this EffectiveConfiguration configuration , ILog log , string ? branchFriendlyName , string ? branchNameOverride )
122
46
{
123
47
var tagToUse = configuration . Tag ?? "{BranchName}" ;
0 commit comments