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

Potential for improvement after #2234 (simplify .targets/.props) #2238

Open
0x53A opened this issue Apr 12, 2017 · 1 comment
Open

Potential for improvement after #2234 (simplify .targets/.props) #2238

0x53A opened this issue Apr 12, 2017 · 1 comment

Comments

@0x53A
Copy link
Contributor

0x53A commented Apr 12, 2017

ref #2234

Description

This is not a bug, just a potential for further simplification.

Repro steps

With

framework: net35, net45, net461
nuget Fody 1.29.4 content:once

paket now generates the following import:

  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v3.5' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.6.1')">
      <PropertyGroup>
        <__paket__Fody_targets>portable-net+sl+win+wpa+wp\Fody</__paket__Fody_targets>
      </PropertyGroup>
    </When>
  </Choose>
 <Import Project="..\packages\Fody\build\$(__paket__Fody_targets).targets" Condition="Exists('..\packages\Fody\build\$(__paket__Fody_targets).targets')" Label="Paket" />

Expected behavior

It should detect that the condition applies to all target frameworks, and just directly import the targets file without this property redirection.

<Import Project="..\packages\Fody\buildportable-net+sl+win+wpa+wp\Fody.targets" Condition="Exists('..\packages\Fody\build\portable-net+sl+win+wpa+wp\Fody.targets')" Label="Paket" />

Known workarounds

Not neccessary, it does work, it could just be nicer.

@0x53A
Copy link
Contributor Author

0x53A commented Apr 12, 2017

I think I need a nuget expert here (HELP @enricosada pretty please?):

Are runtimes (e.g. debian/linux/osx/win) ever relevant w.r.t. importing of targets / props files?

My understanding would be no.

Here I calculate all relevant profiles with regard to the current framework restrictions (e.g. autodetect, or manual):

image

Then I partition the targets files by whether their supported targets list is set equal to the one above:

image

Now in this case, the Fody.targets file supports only the DotNetFrameworks(3.5/4.5/4.6.1), not the runtimes, and so the sets are inequal.

But I think the runtimes are irrelevant to this, and should be ignored in this comparison.

Then it would also generate a nice import for this file.

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

No branches or pull requests

2 participants