-
-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot parse AssemblyInfo.cs files generated by MonoDevelop #943
Comments
@pvwichen found what's casuing it, file above adds an space between attribute and parentheses which apparently breaks the parser. I created a gist with a small test case here as reference when sorting issue. Basically: using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("AssemblyTitle")]
[assembly: AssemblyDescription ("AssemblyDescription")]
[assembly: AssemblyConfiguration ("Configuration")]
[assembly: AssemblyCompany ("Company")]
[assembly: AssemblyProduct ("Product")]
[assembly: AssemblyCopyright ("Copyright")]
[assembly: AssemblyTrademark ("Trademark")]
[assembly: AssemblyCulture ("en-US")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")] will fail but this will succeed: using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("AssemblyTitle")]
[assembly: AssemblyDescription("AssemblyDescription")]
[assembly: AssemblyConfiguration("Configuration")]
[assembly: AssemblyCompany("Company")]
[assembly: AssemblyProduct("Product")]
[assembly: AssemblyCopyright("Copyright")]
[assembly: AssemblyTrademark("Trademark")]
[assembly: AssemblyCulture("en-US")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")] Test case will output
|
@pvwichen this was a simple change to the regular expression that is used to extract the data. I have created a PR to correct this, and to add some more tests around how it is parsed. |
GH943: Correcting AssemblyInfo Parsing
@pvwichen this should be fixed in the next release of Cake, 0.13.0. |
What You Are Seeing?
When using the alias
ParseAssemblyInfo
, it returns null values if theAssemblyInfo.cs
file was generated by MonoDevelop even though the file appears to be valid.MonoDevelop is adding an extra space between the attribute name and the opening parenthesis.
[assembly: AssemblyTitle ("AssemblyTitle")]
What is Expected?
When using
ParseAssemblyInfo
, its regular expressions should allow for whitespace between the attribute name and opening parenthesis.I can create a pull request if accepted.
What version of Cake are you using?
Cake 0.12.0
Are you running on a 32 or 64 bit system?
64-bit
What environment are you running on? Windows? Linux? Mac?
Windows, Linux, Mac
Are you running on a CI Server? If so, which one?
Jenkins, TeamCity
How Did You Get This To Happen? (Steps to Reproduce)
Use
ParseAssemblyInfo
to parse an AssemblyInfo.cs file containing:AssemblyDescription
will be null.The text was updated successfully, but these errors were encountered: