Skip to content
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

Fixes: #4822 --- Support for arbitrary value in AssemblyInformationalVersionAttribute #5336

Merged
merged 5 commits into from
Jul 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions build/targets/GenerateAssemblyAttributes.targets
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

<PropertyGroup>
<GeneratedFSharpAssemblyVersionFile>$(IntermediateOutputPath)$(MSBuildProjectName).AssemblyVersion$(DefaultLanguageSourceExtension)</GeneratedFSharpAssemblyVersionFile>
<!-- AssemblyInformationalVersionAttribute issues a by-design warning if the value passed isn't of the form #.#.#.#, but we specifically want to suppress this to allow the commit hash to be embedded. -->
<NoWarn Condition="'$(Language)' == 'F#'">2003;$(NoWarn)</NoWarn>
</PropertyGroup>

<PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/fsharp/TypeChecker.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17309,7 +17309,6 @@ let TypeCheckOneImplFile
try IL.parseILVersion version |> ignore; true
with _ -> false
match attrName with
| "System.Reflection.AssemblyInformationalVersionAttribute"
| "System.Reflection.AssemblyFileVersionAttribute" //TODO compile error like c# compiler?
| "System.Reflection.AssemblyVersionAttribute" when not (isValid()) ->
warning(Error(FSComp.SR.fscBadAssemblyVersion(attrName, version), range))
Expand Down
5 changes: 2 additions & 3 deletions tests/fsharp/core/versionAttributes/NoWarn2003.fs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
namespace System
open System.Reflection

[<assembly: AssemblyVersionAttribute("5.0.0")>]

do ()

namespace System
open System.Reflection
#nowarn "2003"

[<assembly: AssemblyInformationalVersion("5.0.0-beta024")>]
[<assembly: AssemblyVersion("5.0.0-beta024")>]

do ()
4 changes: 0 additions & 4 deletions tests/fsharp/core/versionAttributes/out.stderr.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ Test 2=================================================
NoWarn2003_2.fs(8,6): warning FS0988: Main module of program is empty: nothing will happen when it is run
Test 3=================================================

Warn2003_1.fs(5,42): warning FS2003: The attribute System.Reflection.AssemblyInformationalVersionAttribute specified version '5.0.0-beta024', but this value is invalid and has been ignored

Warn2003_1.fs(7,6): warning FS0988: Main module of program is empty: nothing will happen when it is run
Test 4=================================================

Warn2003_2.fs(4,42): warning FS2003: The attribute System.Reflection.AssemblyInformationalVersionAttribute specified version '5.0.0-beta024', but this value is invalid and has been ignored

Warn2003_2.fs(6,6): warning FS0988: Main module of program is empty: nothing will happen when it is run
Test 5=================================================

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// #Regression #Conformance #DeclarationElements #Attributes
//<Expects id="FS2003" status="warning">The attribute System.Reflection.AssemblyInformationalVersionAttribute specified version '6\.5\.4\.3\.2', but this value is invalid and has been ignored</Expects>
//<Expects id="FS2003" status="warning">The attribute System.Reflection.AssemblyFileVersionAttribute specified version '9\.8\.7\.6\.5', but this value is invalid and has been ignored</Expects>

[<assembly:System.Reflection.AssemblyVersion("1.2.3.4")>]
[<assembly:System.Reflection.AssemblyInformationalVersion("6.5.4.3.2")>]
[<assembly:System.Reflection.AssemblyFileVersion("9.8.7.6.5")>]
do
()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// #Regression #Conformance #DeclarationElements #Attributes
//<Expects id="FS2003" status="warning">The attribute System.Reflection.AssemblyInformationalVersionAttribute specified version '6\.5\.\*\.3', but this value is invalid and has been ignored</Expects>
//<Expects id="FS2003" status="warning">The attribute System.Reflection.AssemblyFileVersionAttribute specified version '9\.8\.\*\.6', but this value is invalid and has been ignored</Expects>

[<assembly:System.Reflection.AssemblyVersion("1.2.3.4")>]
[<assembly:System.Reflection.AssemblyInformationalVersion("6.5.*.3")>]
[<assembly:System.Reflection.AssemblyFileVersionAttribute("9.8.*.6")>]
do
()
Expand Down