Add Visual Basic support to AssemblyFileInfo task and make Namespace optional in config #471
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request contains one new feature and one breaking change.
First, as I'm sure many of us have VB code in the wild, I've added support for generating AssemblyInfo.vb files for Visual Basic projects. I was unsure whether it was better to call the function CreateVisualBasicAssemblyInfoWithConfig or CreateVBAssemblyInfoWithConfig, so I played it safe and went with the former. I've not added any tests specific to generating the VB file as there were no architectural changes to the attributes, and the existing tests did not cover the differences between the AssemblyInfo file layout between languages.
Second, I've added a breaking change to the AssemblyInfoFileConfig record in that it is now a class. This was done to allow the Namespace field to be optional for code passing an AssemblyInfoFileConfig to the CreateXXAssemblyInfoWithConfig functions, as it's pointless to write a namespace declaration to the AssemblyInfo file if no class is being generated, and it's confusing to require the developer to specify the namespace when they want to specify that no class should be generated to begin with. We could alternatively turn the defaults on their head such that no class is generated by default, but I feel that would silently change the behavior of people's build scripts, where this would only effect those that wish to disable class generation anyway.
Third, I'm still a novice when it comes to F#, so if I've made any poor stylistic choices in my coding please let me know 😉.