Repository navigation
build: let FAKE write the assembly information as MSBuild properties - #42
Merged
Merged
Conversation
Merged
2 of 6 tasks
xperiandri
force-pushed
the
build/sequential-test-compilation
branch
from
October 19, 2026 14:40
7bc75e7 to
47db96d
Compare
xperiandri
force-pushed
the
build/assembly-info-props
branch
from
October 19, 2026 14:40
5795c21 to
758443d
Compare
6 tasks done
5 of 6 tasks
The release step of the build script wrote the assembly attributes into AssemblyInfo.fs, and Directory.Build.props set GenerateAssemblyInfo to false so that the SDK did not generate them a second time. Every other assembly attribute then needed a source file, or a property and a target. The GenerateAssemblyInfo target now writes src/AssemblyInfo.Build.props with Product, AssemblyVersion, FileVersion and InformationalVersion, and the AssemblyMetadata items ReleaseDate, ReleaseChannel and GitHash. src/Directory.Build.props imports it, GenerateAssemblyInfo is no longer false, and the SDK generates the attributes. A project sets what is specific to it (its title, for example) in its own project file. The SDK appends no source revision to the informational version, because the git hash is in the metadata. AssemblyInfo.fs keeps the module AssemblyVersionInformation with the literals, but no attributes. The release commit stages both files. The package Fake.DotNet.AssemblyInfoFile is not needed any more. The values in the checked-in files are those of the last release, as before. The assembly has the attributes of before and the four that the SDK generates by default: AssemblyCompany, AssemblyConfiguration, AssemblyDescription and the AssemblyMetadata RepositoryUrl. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
xperiandri
force-pushed
the
build/assembly-info-props
branch
from
October 19, 2026 14:46
758443d to
4562f5a
Compare
Open
5 of 6 tasks
xperiandri
added a commit
that referenced
this pull request
Oct 19, 2026
…42) Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
xperiandri
added a commit
that referenced
this pull request
Oct 20, 2026
…42) Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed Changes
A review comment on #40 asks that FAKE generates
AssemblyInfo.Build.props, imported bysrc\Directory.Build.props, and that a project updates its specific properties at project level, so that the properties which switch the assembly attributes of the SDK off are not needed (comment). This pull request does that. The other open pull requests are stacked on it. It builds on #41, which is merged: the test project no longer fails at random with FS0073 in the compiler (dotnet/fsharp#20812).GenerateAssemblyInfotarget of the build script writessrc/AssemblyInfo.Build.props: the propertiesProduct,AssemblyVersion,FileVersionandInformationalVersionfrom the latest entry ofCHANGELOG.md, and theAssemblyMetadataitemsReleaseDate,ReleaseChannelandGitHash. It setsIncludeSourceRevisionInInformationalVersiontofalse, because the git hash is in the metadata, so the informational version stays1.0.0.src/Directory.Build.propsimports the file when it exists, andDirectory.Build.propsno longer setsGenerateAssemblyInfotofalse: the SDK generates the assembly attributes from the properties and the items. A project sets what is specific to it in its own project file. The library needs nothing there, because the title defaults to the assembly name.AssemblyInfo.fskeeps the moduleAssemblyVersionInformationwith the literals and has no attributes any more. FAKE writes it for every F# project insrc. The release commit stages it andAssemblyInfo.Build.props.Fake.DotNet.AssemblyInfoFileis removed from the build project and fromDirectory.Packages.props: the target writes the XML itself, and the F# file by a template, because the package cannot write the module without the attributes.Types of changes
What types of changes does your code introduce to FSharp.Collections.Immutable?
Put an
xin the boxes that applyNone of these: a change of the build.
Checklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
The assembly attributes were listed by reflection on the library of both target frameworks, built before and after this change. They are the same, and the SDK adds four that it generates by default:
AssemblyCompanyAuthorsinDirectory.Build.props)AssemblyConfigurationReleaseorDebugAssemblyDescriptionAssemblyMetadataRepositoryUrl, the repository URL (PublishRepositoryUrlis on)Unchanged:
AssemblyVersion1.0.0.0,AssemblyFileVersionandAssemblyInformationalVersion1.0.0,AssemblyProductandAssemblyTitle(FSharp.Collections.Immutable), and theAssemblyMetadataitemsReleaseDate,ReleaseChannelandGitHash. Both target frameworks build, and all 2447 tests per target framework pass.The checked-in files hold the values of the last release (the git hash
59d59515…), as the generated source file did. Runningdotnet run --project ./build/build.fsproj -- -t GenerateAssemblyInfo -swritesAssemblyInfo.Build.propsandAssemblyInfo.fsagain; the result differs from the checked-in files in the git hash only (the one of the current commit). The release run writes them before the release commit.#40 declares
InternalsVisibleToas a project item. With the SDK generating the attributes the item works as it is, so #40 loses its properties and its target when it is rebased on this pull request.🤖 Generated with Claude Code