@@ -26,11 +26,15 @@ public async Task CreateSingleSourceFileAsync()
2626 var stringBuilder = new StringBuilder ( ) ;
2727
2828 if ( _options . IncludeVersionComment )
29+ {
30+ Console . WriteLine ( "Appending version header..." ) ;
2931 stringBuilder . AppendLine ( "/* ------------------------------" )
3032 . AppendLine ( $ " Light.GuardClauses { typeof ( SourceFileMerger ) . Assembly . GetName ( ) . Version . ToString ( 3 ) } ")
3133 . AppendLine ( " ------------------------------" )
3234 . AppendLine ( ) ;
33-
35+ }
36+
37+ Console . WriteLine ( "Creating default file layout..." ) ;
3438 stringBuilder . AppendLineIf ( ! _options . IncludeVersionComment , "/*" )
3539 . AppendLine ( $@ "License information for Light.GuardClauses
3640
@@ -76,8 +80,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
7680{ ( _options . IncludeJetBrainsAnnotationsUsing ? "using JetBrains.Annotations;" + Environment . NewLine : string . Empty ) } using { _options . BaseNamespace } .Exceptions;
7781using { _options . BaseNamespace } .FrameworkExtensions;
7882
79- // ReSharper disable StaticMemberInGenericType
80-
8183namespace { _options . BaseNamespace }
8284{{
8385}}
@@ -146,6 +148,7 @@ namespace JetBrains.Annotations
146148 . ToDictionary ( f => f . Name ) ;
147149
148150 // Start with Check.CommonAssertions before all other files to prepare the Check class
151+ Console . WriteLine ( "Merging source files of the Check class..." ) ;
149152 var currentFile = allSourceFiles [ "Check.CommonAssertions.cs" ] ;
150153
151154 var sourceSyntaxTree = CSharpSyntaxTree . ParseText ( await currentFile . ReadContentAsync ( ) ) ;
@@ -155,6 +158,7 @@ namespace JetBrains.Annotations
155158 checkClassDeclaration = checkClassDeclaration . WithModifiers ( checkClassDeclaration . Modifiers . Remove ( checkClassDeclaration . Modifiers . First ( token => token . Kind ( ) == SyntaxKind . PartialKeyword ) ) ) ;
156159
157160 // Process all other files
161+ Console . WriteLine ( "Merging remaining files..." ) ;
158162 foreach ( var fileName in allSourceFiles . Keys )
159163 {
160164 if ( fileName == "Check.CommonAssertions.cs" )
@@ -227,10 +231,12 @@ namespace JetBrains.Annotations
227231 // Make types internal if necessary
228232 if ( _options . ChangePublicTypesToInternalTypes )
229233 {
234+ Console . WriteLine ( "Types are changed from public to internal..." ) ;
230235 var changedTypeDeclarations = new Dictionary < BaseTypeDeclarationSyntax , BaseTypeDeclarationSyntax > ( ) ;
231236
232237 foreach ( var typeDeclaration in targetRoot . DescendantNodes ( ) . Where ( node => node . Kind ( ) == SyntaxKind . ClassDeclaration ||
233- node . Kind ( ) == SyntaxKind . StructDeclaration )
238+ node . Kind ( ) == SyntaxKind . StructDeclaration ||
239+ node . Kind ( ) == SyntaxKind . EnumDeclaration )
234240 . Cast < BaseTypeDeclarationSyntax > ( ) )
235241 {
236242 var publicModifier = typeDeclaration . Modifiers [ 0 ] ;
@@ -245,6 +251,9 @@ namespace JetBrains.Annotations
245251
246252 else if ( typeDeclaration is StructDeclarationSyntax structDeclaration )
247253 changedTypeDeclarations [ structDeclaration ] = structDeclaration . WithModifiers ( adjustedModifiers ) ;
254+
255+ else if ( typeDeclaration is EnumDeclarationSyntax enumDeclaration )
256+ changedTypeDeclarations [ enumDeclaration ] = enumDeclaration . WithModifiers ( adjustedModifiers ) ;
248257 }
249258
250259 targetRoot = targetRoot . ReplaceNodes ( changedTypeDeclarations . Keys , ( originalNode , _ ) => changedTypeDeclarations [ originalNode ] ) ;
@@ -253,11 +262,16 @@ namespace JetBrains.Annotations
253262 // Remove preprocessor directives if necessary
254263 var targetFileContent = targetRoot . ToFullString ( ) ;
255264 if ( _options . RemovePreprocessorDirectives )
265+ {
266+ Console . WriteLine ( "Preprocessor directives are removed..." ) ;
256267 targetFileContent = new UndefineTransformation ( ) . Undefine ( targetFileContent , _options . DefinedPreprocessorSymbols ) . ToString ( ) ;
268+ }
257269
270+ Console . WriteLine ( "File is cleaned up..." ) ;
258271 targetFileContent = CleanupStep . Cleanup ( targetFileContent , _options . RemoveContractAnnotations ) . ToString ( ) ;
259272
260273 // Write the target file
274+ Console . WriteLine ( "File is written to disk..." ) ;
261275 await File . WriteAllTextAsync ( _options . TargetFile , targetFileContent ) ;
262276 }
263277 }
0 commit comments