Current compiler version in versionsinfo

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
wriedmann
Posts: 3649
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Current compiler version in versionsinfo

Post by wriedmann »

Hello,

in my VO programs I'm using the following in the VersionsInfo ressource:

Code: Select all

resource VS_VERSION_INFO VERSIONINFO
 FILEVERSION 		1,25,18,__version__
 PRODUCTVERSION 	1,25,18,__version__
.....
The __version__ will be replaced by the compiler version.
I would like to see something also in X# - so I can see from the explorer with which version the binary was compiled.
I need that not only for the ressource (I remember the discussion from a few days ago...), but also for the AssemblyInfo part.
Specially now with the very active development, something like this seems important to me.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4241
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Current compiler version in versionsinfo

Post by robert »

Wolfgang,

I'll see what I can do. But I can't do it 100% identical to VO:
VO operates quite differently from X# in this area: it stores the resource in the repo and when it writes the repo to disk for the RC compiler it actually does a case insensitive search/replace and replaces the version.

We are already working with external files and we are building a commandline for the resource compiler in our XSharp.Build.dll that has the task to build native resources. This command line "simply" #includes all .rc files in a response file.
You can see this in https://github.com/X-Sharp/XSharpPublic ... urceGen.cs

I can probably add a #define __VERSION__ 1.2.3.4 in the reponse file for the resource compiler. But... that #define will be case sensitive. So I could also add #define __version__ 1.2.3.4. But that would not work for defines in mixed case.

Is that OK with you ?

Btw: did you know that if you compile an app that is not Core we also add an attribute to that assembly with the compiler version and dialect:

[assembly: CompilerVersion("X# 2.0.2.0 - dialect:Vulcan")]

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
wriedmann
Posts: 3649
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Current compiler version in versionsinfo

Post by wriedmann »

Hi Robert,
can probably add a #define __VERSION__ 1.2.3.4 in the reponse file for the resource compiler. But... that #define will be case sensitive. So I could also add #define __version__ 1.2.3.4. But that would not work for defines in mixed case.
thank you very much! Upper case is enough, if we know that. I would not add also a lower case replace because it creates only confusion, I think.
Btw: did you know that if you compile an app that is not Core we also add an attribute to that assembly with the compiler version and dialect:

[assembly: CompilerVersion("X# 2.0.2.0 - dialect:Vulcan")]
No, I didn't knew that.
But how can I see that? The file properties in Windows Explorer don't show these attributes, unfortunately.
Therefore I need the VersionInfo resource and not the newer AssemblyInfo.

Thank you for this wonderful tool - I'm very happy with X#!

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4241
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Current compiler version in versionsinfo

Post by robert »

Wolfgang,

1) Please create an issue (feature request) for this on Github. Click the [Tickets] button on the top of this page to go to Github. That way you'll be kept informed about the progress.
2) Indeed to see the Compilerversion attribute you need to open the assembly with IlSpy or Reflector.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
wriedmann
Posts: 3649
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Current compiler version in versionsinfo

Post by wriedmann »

Hi Robert,

done, thank you very much!

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply