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

Parameterize product version #8031

Merged
merged 3 commits into from
Jan 6, 2020

Conversation

KevinRansom
Copy link
Member

@KevinRansom KevinRansom commented Dec 20, 2019

The product Language and version for each branch are specified in eng/versions.props.

With this change we will use those versions to set the vsix properties used to display labels in visual studio.

This fixes: #8018

This was insanely more tricky than I thought. Basically it blew up my Christmas, which makes me very sad indeed.

The really tough part was coming up with something that didn't wreck the good work done by the xlf translations stuff.

In the end I decided to:

  1. Add a build task that copies and substitutes the values.
  2. Overrode the BeforeResGen build target which runs immediately before ResGen is run.
    3.. Transform the files that have been copied to the obj\flavour\tfm directory into the resources directory.
  3. As well as that I copy the resources from src\Resources to obj\flavour\tfm\resources\Resources, otherwise resgen will not find them (it relies on relative paths).
  4. Modify the paths of the files passed to resgen to point to the transformed files.

@abelbraaksma
Copy link
Contributor

abelbraaksma commented Dec 20, 2019

I assume this doesn't solve the appearance of 'beta' in the version string for RTM releases, as that's a Microsoft-wide policy (I've come to understand that c# exhibits the same problem, see #7726)?

Just curious ;)

@cartermp
Copy link
Contributor

@abelbraaksma Nope.

@abelbraaksma
Copy link
Contributor

@abelbraaksma Nope.

Haha, very concise! I noticed in the other thread. Sorry for the noise ;).

@@ -464,10 +464,10 @@
<value>Customizes the environment to maximize code editor screen space and improve the visibility of F# commands and tool windows.</value>
</data>
<data name="ProductDetails" xml:space="preserve">
<value>Microsoft Visual F# Tools 10.4 for F# 4.6</value>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the hackery in the project file. I'd rather ProjectSystem.fsproj get reverted and these strings updated to: Microsoft Visual F# Tools {0} for F# {1}, then call string.Format() with the values FSharp.BuildProperties.fsProductVersion/fsLanguageVersion as generated here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brettfo,

I feel you … unfortunately these values are read by vs from the resource strings. We just tell VS the resource IDs it then grabs the resources and displays them. Here.

We can put the build targets in FSharpBuild.Directory.Build.targets in order to remove the hackery from the project. The bit I'm still trying to figure out, is how to not break xlf, and yet update the localized versions of vspackage ... all in all it is quite touchy.

<Link>RegisterFsharpPackage.pkgdef</Link>
</Content>

<NoneSubstituteText Include="..\RegisterFsharpPackage.pkgdef" CopyToOutputDirectory="PreserveNewest">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably won't work unless we specially handle @(ContentSubstituteText), otherwise the VSSDK probably won't find the .pkgdef in the @(None) collection.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brettfo I believe the VSSDK picks the packagedefs out of the output directory and since the NoneSubstituteText puts the transformed file there, all is good..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brettfo, Okay fixed it.

@KevinRansom KevinRansom force-pushed the parameterizeproductversion branch 2 times, most recently from f0e37d4 to c8507f3 Compare January 4, 2020 21:46
@cartermp cartermp merged commit 75ae876 into dotnet:master Jan 6, 2020
cartermp added a commit to cartermp/fsharp that referenced this pull request Jan 7, 2020
# This is the 1st commit message:

ref -> mutable in more places in the compiler

# The commit message dotnet#2 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191229.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19629.1

# The commit message dotnet#3 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191230.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19630.1

# The commit message dotnet#4 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191231.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19631.1

# The commit message dotnet#5 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20200101.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20051.1

# The commit message dotnet#6 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191216.5 (dotnet#8079)
#
# - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19616.5

# The commit message dotnet#7 will be skipped:

# dispose fsi at the end of a scripting session (dotnet#8084)
#

# The commit message dotnet#8 will be skipped:

# Added static link tests and extended CompilerAssert (dotnet#8101)
#
# * Changed CompilerAssert to static class. Added Compile/Execute methods that take a Compilation description. Added static link tests
# 
# * Hiding compilation description internals
# 
# * Added another test to check for sanity
# 
# * Making a few optional parameters
# 
# * Hiding internals of CompilationReference

# The commit message dotnet#9 will be skipped:

# Parameterize product version (dotnet#8031)
#
# * Parameterize Product details
# 
# * fcs
# 
# * Repack pkgdef
cartermp added a commit that referenced this pull request Jan 7, 2020
…8063)

* # This is a combination of 9 commits.
# This is the 1st commit message:

ref -> mutable in more places in the compiler

# The commit message #2 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191229.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19629.1

# The commit message #3 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191230.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19630.1

# The commit message #4 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191231.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19631.1

# The commit message #5 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20200101.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20051.1

# The commit message #6 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191216.5 (#8079)
#
# - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19616.5

# The commit message #7 will be skipped:

# dispose fsi at the end of a scripting session (#8084)
#

# The commit message #8 will be skipped:

# Added static link tests and extended CompilerAssert (#8101)
#
# * Changed CompilerAssert to static class. Added Compile/Execute methods that take a Compilation description. Added static link tests
# 
# * Hiding compilation description internals
# 
# * Added another test to check for sanity
# 
# * Making a few optional parameters
# 
# * Hiding internals of CompilationReference

# The commit message #9 will be skipped:

# Parameterize product version (#8031)
#
# * Parameterize Product details
# 
# * fcs
# 
# * Repack pkgdef

* no ilread
brettfo added a commit to brettfo/fsharp that referenced this pull request Jan 8, 2020
@KevinRansom KevinRansom deleted the parameterizeproductversion branch January 15, 2020 23:02
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
* Parameterize Product details

* fcs

* Repack pkgdef
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
…otnet#8063)

* # This is a combination of 9 commits.
# This is the 1st commit message:

ref -> mutable in more places in the compiler

# The commit message #2 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191229.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19629.1

# The commit message #3 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191230.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19630.1

# The commit message #4 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191231.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19631.1

# The commit message #5 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20200101.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20051.1

# The commit message #6 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191216.5 (dotnet#8079)
#
# - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19616.5

# The commit message #7 will be skipped:

# dispose fsi at the end of a scripting session (dotnet#8084)
#

# The commit message #8 will be skipped:

# Added static link tests and extended CompilerAssert (dotnet#8101)
#
# * Changed CompilerAssert to static class. Added Compile/Execute methods that take a Compilation description. Added static link tests
# 
# * Hiding compilation description internals
# 
# * Added another test to check for sanity
# 
# * Making a few optional parameters
# 
# * Hiding internals of CompilationReference

# The commit message #9 will be skipped:

# Parameterize product version (dotnet#8031)
#
# * Parameterize Product details
# 
# * fcs
# 
# * Repack pkgdef

* no ilread
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
…otnet#8063)

* # This is a combination of 9 commits.
# This is the 1st commit message:

ref -> mutable in more places in the compiler

# The commit message #2 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191229.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19629.1

# The commit message #3 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191230.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19630.1

# The commit message #4 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191231.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19631.1

# The commit message #5 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20200101.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20051.1

# The commit message #6 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191216.5 (dotnet#8079)
#
# - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19616.5

# The commit message #7 will be skipped:

# dispose fsi at the end of a scripting session (dotnet#8084)
#

# The commit message #8 will be skipped:

# Added static link tests and extended CompilerAssert (dotnet#8101)
#
# * Changed CompilerAssert to static class. Added Compile/Execute methods that take a Compilation description. Added static link tests
# 
# * Hiding compilation description internals
# 
# * Added another test to check for sanity
# 
# * Making a few optional parameters
# 
# * Hiding internals of CompilationReference

# The commit message #9 will be skipped:

# Parameterize product version (dotnet#8031)
#
# * Parameterize Product details
# 
# * fcs
# 
# * Repack pkgdef

* no ilread
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
…otnet#8063)

* # This is a combination of 9 commits.
# This is the 1st commit message:

ref -> mutable in more places in the compiler

# The commit message #2 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191229.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19629.1

# The commit message #3 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191230.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19630.1

# The commit message #4 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191231.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19631.1

# The commit message #5 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20200101.1
#
# - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20051.1

# The commit message #6 will be skipped:

# Update dependencies from https://github.com/dotnet/arcade build 20191216.5 (dotnet#8079)
#
# - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19616.5

# The commit message #7 will be skipped:

# dispose fsi at the end of a scripting session (dotnet#8084)
#

# The commit message #8 will be skipped:

# Added static link tests and extended CompilerAssert (dotnet#8101)
#
# * Changed CompilerAssert to static class. Added Compile/Execute methods that take a Compilation description. Added static link tests
# 
# * Hiding compilation description internals
# 
# * Added another test to check for sanity
# 
# * Making a few optional parameters
# 
# * Hiding internals of CompilationReference

# The commit message #9 will be skipped:

# Parameterize product version (dotnet#8031)
#
# * Parameterize Product details
# 
# * fcs
# 
# * Repack pkgdef

* no ilread
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Product version in Visual Studio incorrectly says F# 4.6, not F# 4.7
4 participants