Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Update ProjectFile.GetTargetProfile to work with conditional nodes #1227
The output looks correct to me, but I'll need one of you to confirm, as I'm not sure what the output from the paket_bug project is supposed to be. Just testing from an fsx file like so:
#r @"bin\Paket.Core.dll" let proj = Paket.ProjectFile.LoadFromFile @"tests\Paket.Tests\ProjectFile\TestData\ProjectWithConditions.fsprojtest" let profile = proj.GetTargetProfile()
Gets the specified property name from the project, evaluating conditional PropertyGroup nodes as best it can and processing MSBuild placeholder values, e.g. `$(Configuration)`
Did this by renaming the old member to GetPropertyWithDefaults, and adding a new member with the old name; new member passes Map.empty<string,string> to the WithDefaults member.
If a <TargetFrameworkProfile> value can be extracted from the project file and it has a value, that value is used to determine the profile here. If that node isn't specified, or its value is empty, GetTargetProfile now tries to get the <TargetFrameworkVersion> node to determine the correct profile from there.