@@ -152,51 +152,59 @@ public class BuildVersion
152
152
context . Information ( "There is a tag." ) ;
153
153
}
154
154
155
- // create SolutionVersion.cs file...
156
- var assemblyInfoSettings = new AssemblyInfoSettings {
157
- ComVisible = BuildParameters . ProductComVisible ,
158
- CLSCompliant = BuildParameters . ProductClsCompliant ,
159
- Company = BuildParameters . ProductCompany ,
160
- Version = fileVersion ,
161
- FileVersion = fileVersion ,
162
- InformationalVersion = informationalVersion ,
163
- Product = BuildParameters . ProductName ,
164
- Description = BuildParameters . ProductDescription ,
165
- Trademark = BuildParameters . ProductTrademark ,
166
- Copyright = BuildParameters . ProductCopyright
167
- } ;
168
-
169
- if ( BuildParameters . ProductCustomAttributes != null )
155
+ if ( BuildParameters . ShouldGenerateSolutionVersionCSharpFile )
170
156
{
171
- assemblyInfoSettings . CustomAttributes = BuildParameters . ProductCustomAttributes ;
172
- }
173
- else
174
- {
175
- assemblyInfoSettings . CustomAttributes = new List < AssemblyInfoCustomAttribute > ( ) ;
157
+ context . Information ( "Generating SolutionVersion.cs file..." ) ;
158
+
159
+ var assemblyInfoSettings = new AssemblyInfoSettings {
160
+ ComVisible = BuildParameters . ProductComVisible ,
161
+ CLSCompliant = BuildParameters . ProductClsCompliant ,
162
+ Company = BuildParameters . ProductCompany ,
163
+ Version = fileVersion ,
164
+ FileVersion = fileVersion ,
165
+ InformationalVersion = informationalVersion ,
166
+ Product = BuildParameters . ProductName ,
167
+ Description = BuildParameters . ProductDescription ,
168
+ Trademark = BuildParameters . ProductTrademark ,
169
+ Copyright = BuildParameters . ProductCopyright
170
+ } ;
176
171
177
- if ( BuildParameters . ShouldStrongNameOutputAssemblies )
172
+ if ( BuildParameters . ProductCustomAttributes != null )
178
173
{
179
- var assemblyKeyFileAttribute = new AssemblyInfoCustomAttribute
174
+ assemblyInfoSettings . CustomAttributes = BuildParameters . ProductCustomAttributes ;
175
+ }
176
+ else
177
+ {
178
+ assemblyInfoSettings . CustomAttributes = new List < AssemblyInfoCustomAttribute > ( ) ;
179
+
180
+ if ( BuildParameters . ShouldStrongNameOutputAssemblies )
180
181
{
181
- Name = "AssemblyKeyFile" ,
182
- Value = BuildParameters . StrongNameKeyPath . Replace ( "\\ " , "\\ \\ " ) ,
182
+ var assemblyKeyFileAttribute = new AssemblyInfoCustomAttribute
183
+ {
184
+ Name = "AssemblyKeyFile" ,
185
+ Value = BuildParameters . StrongNameKeyPath . Replace ( "\\ " , "\\ \\ " ) ,
186
+ NameSpace = "System.Reflection"
187
+ } ;
188
+
189
+ assemblyInfoSettings . CustomAttributes . Add ( assemblyKeyFileAttribute ) ;
190
+ }
191
+
192
+ var obfuscateAssemblyAttribute = new AssemblyInfoCustomAttribute
193
+ {
194
+ Name = "ObfuscateAssembly" ,
195
+ Value = BuildParameters . ObfuscateAssembly ,
183
196
NameSpace = "System.Reflection"
184
197
} ;
185
198
186
- assemblyInfoSettings . CustomAttributes . Add ( assemblyKeyFileAttribute ) ;
199
+ assemblyInfoSettings . CustomAttributes . Add ( obfuscateAssemblyAttribute ) ;
187
200
}
188
201
189
- var obfuscateAssemblyAttribute = new AssemblyInfoCustomAttribute
190
- {
191
- Name = "ObfuscateAssembly" ,
192
- Value = BuildParameters . ObfuscateAssembly ,
193
- NameSpace = "System.Reflection"
194
- } ;
195
-
196
- assemblyInfoSettings . CustomAttributes . Add ( obfuscateAssemblyAttribute ) ;
202
+ context . CreateAssemblyInfo ( BuildParameters . Paths . Files . SolutionInfoFilePath , assemblyInfoSettings ) ;
203
+ }
204
+ else
205
+ {
206
+ context . Information ( "Skipping generation of SolutionVersion.cs file." ) ;
197
207
}
198
-
199
- context . CreateAssemblyInfo ( BuildParameters . Paths . Files . SolutionInfoFilePath , assemblyInfoSettings ) ;
200
208
201
209
context . Information ( "Calculated Major.Minor.Patch: {0}" , majorMinorPatch ) ;
202
210
context . Information ( "Calculated Sem Version: {0}" , semVersion ) ;
0 commit comments