Skip to content
Merged
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
12 changes: 12 additions & 0 deletions build-support/build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ void DetermineVersion()
MSBuild(s => s
.SetTargets("Restore", "Rebuild")
.SetConfiguration(Configuration)
.Apply(ExampleVersionSettings)
.SetTargetPath(solutionFile)
.SetNodeReuse(false)
.SetVerbosity(MSBuildVerbosity.Minimal)
Expand Down Expand Up @@ -230,6 +231,17 @@ void DetermineVersion()
.SetVersionPrefix(VersionPrefix)
.SetVersionSuffix(VersionSuffix);

// Several example solutions include the src/Spring projects directly (Spring.Core.csproj and
// friends), so this MSBuild call rebuilds them straight back into build/$(Configuration)/.
// Without the same versions, that rebuild stamps the SDK default 1.0.0.0 over what
// CompileSolution produced, and the next example to reference two Spring assemblies fails
// CS1705 on the mismatch. MSBuildSettings has no VersionPrefix/Suffix setter, hence SetProperty.
Configure<MSBuildSettings> ExampleVersionSettings => _ => _
.SetAssemblyVersion(AssemblyVersion)
.SetFileVersion(VersionPrefix)
.SetProperty("VersionPrefix", VersionPrefix)
.SetProperty("VersionSuffix", VersionSuffix ?? string.Empty);

IEnumerable<Project> GetActiveProjects()
{
var packTargets = Solution.AllProjects
Expand Down