-
Notifications
You must be signed in to change notification settings - Fork 525
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
Add PaketReference MSBuild item in projects instead of paket.references #2606
Comments
Yes we are interested in in this. Like making it work in addition to the
existing references files.
Am 11.08.2017 16:22 schrieb "Lukas Rieger" <[email protected]>:
… Instead of having the references in a second file paket.references, I
would like to include them into the project file.
This could look like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PaketReference Include="FSharp.Core" />
<PaketReference Include="xunit" Group="Test" />
</ItemGroup>
<ItemGroup>
<Compile Include="Library.fs" />
</ItemGroup>
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
*Advantages:*
- Similar to the Nuget PackageReference, so maybe easier to explain to
someone coming from nuget (just replace all PackageReferences with
PaketReferences, and remove the explicit versions, because the versions are
handled by paket)
- It can be dynamically programmed. For example let's say I want to
include some Analyzer in all my C# projects.
** Currently I need to explicitly add it to all paket.reference files.
The most I could do is to then write a unit test that verifies that yes,
all projects really import it. If I create a new project, and forget it,
the UT fails.
** With this feature, I could solve this via MSBuild programming and
e.g. a Directory.props
- The new project format is nice and pretty (well, relative for xml)
readable. So why split it up into two files?
- You could do a conditional reference (this would solve #2596
<#2596>) via <PaketReference
Include="FSharp.Core" Group="netcore" Condition=" '$(TargetFramework)' !=
'net35' " />
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2606>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNJY9RX-3lG_06X59Ge9A8dwjC5ciks5sXGO0gaJpZM4O0uK_>
.
|
We still need to keep references files around since it provides support for
other features that are not yet in csproj.
PR with PoC code very welcome
Am 11.08.2017 16:25 schrieb "Steffen Forkmann" <[email protected]>:
… Yes we are interested in in this. Like making it work in addition to the
existing references files.
Am 11.08.2017 16:22 schrieb "Lukas Rieger" ***@***.***>:
> Instead of having the references in a second file paket.references, I
> would like to include them into the project file.
>
> This could look like this:
>
> <Project Sdk="Microsoft.NET.Sdk">
>
> <PropertyGroup>
> <TargetFramework>net461</TargetFramework>
> </PropertyGroup>
>
> <ItemGroup>
> <PaketReference Include="FSharp.Core" />
> <PaketReference Include="xunit" Group="Test" />
> </ItemGroup>
>
> <ItemGroup>
> <Compile Include="Library.fs" />
> </ItemGroup>
>
>
> <Import Project="..\.paket\Paket.Restore.targets" />
>
> </Project>
>
> *Advantages:*
>
> - Similar to the Nuget PackageReference, so maybe easier to explain
> to someone coming from nuget (just replace all PackageReferences with
> PaketReferences, and remove the explicit versions, because the versions are
> handled by paket)
> - It can be dynamically programmed. For example let's say I want to
> include some Analyzer in all my C# projects.
> ** Currently I need to explicitly add it to all paket.reference
> files. The most I could do is to then write a unit test that verifies that
> yes, all projects really import it. If I create a new project, and forget
> it, the UT fails.
> ** With this feature, I could solve this via MSBuild programming and
> e.g. a Directory.props
> - The new project format is nice and pretty (well, relative for xml)
> readable. So why split it up into two files?
> - You could do a conditional reference (this would solve #2596
> <#2596>) via <PaketReference
> Include="FSharp.Core" Group="netcore" Condition=" '$(TargetFramework)' !=
> 'net35' " />
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#2606>, or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AADgNJY9RX-3lG_06X59Ge9A8dwjC5ciks5sXGO0gaJpZM4O0uK_>
> .
>
|
I assume that in the first stage, both would be additive? That is, if I have
Sure, unfortunately the day has only 24 hours and I need to prioritize this against catching up with GoT ;-) I want to finish the other stuff I already started first, and next week I am on vacation. If until after then no-one else has started with anything, I will try, but don't necessarily wait for me. |
Yes it should merge both sources.
Am 11.08.2017 16:42 schrieb "Lukas Rieger" <[email protected]>:
… Yes we are interested in in this. Like making it work in addition to the
existing references files.
I assume that in the first stage, both would be additive? That is, if I
have PaketReferences and a paket.references file, the sum of both should
be used?
PR with PoC code very welcome
Sure, unfortunately the day has only 24 hours and I need to prioritize
this against catching up with GoT ;-)
I want to finish the other stuff I already started first, and next week I
am on vacation. If until after then no-one else has started with anything,
I will try, but don't necessarily wait for me.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2606 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNM9yHHxQqzOvqF0VeqF7QaY48IcYks5sXGhggaJpZM4O0uK_>
.
|
I like the idea. I'm not sure about additive bahavior, because this can lead to unexpected results if one parent directory contains a paket.references file... |
We need both.
Parent directory paket.references have always been a weird thing. We don't
advertise them that much, so I think it's fine.
Am 11.08.2017 4:49 nachm. schrieb "Matthias Dittrich" <
[email protected]>:
… I like the idea. I'm not sure about additive bahavior, because this can
lead to unexpected results if one parent directory contains a
paket.references file...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2606 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNAuGd2CExsFj0owBZW3w4kJv6pDLks5sXGn2gaJpZM4O0uK_>
.
|
@forki Can we deprecate parent paket.references? Not remove them (yet), but print a warning? |
Note that I already added this to the (wish-)list of breaking changes for the next major (I really think we should just go ahead and do it. Therefore, I'm fully supporting the warning. |
We could deprecate them for modern type csproj.
Am 21.08.2017 12:28 vorm. schrieb "Matthias Dittrich" <
[email protected]>:
… Note that I already added this to the (wish-)list of breaking changes for
the next major (I really think we should just go ahead and do it.
Therefore, I'm fully supporting the warning.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2606 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNP0lw0NiwCsT2es3to4cj69Bluy4ks5saLL-gaJpZM4O0uK_>
.
|
Why not for all? I never saw anyone actually using them? (I don't count "by accident" which is most of the time not what you want) I can show you some examples of where it hurts or was added a workaround (empty files) |
Question is imho more what should be the replacement, and to answer this we need to know some real life examples of people using it |
Regarding the parent So they aren't even working as expected TODAY. |
Ok, so IMHO we should remove support for them, but maybe print a warning if we detect that an old version would have used them. |
Instead of having the references in a second file
paket.references
, I would like to include them into the project file.This could look like this:
Advantages:
PackageReference
, so maybe easier to explain to someone coming from nuget (just replace all PackageReferences with PaketReferences, and remove the explicit versions, because the versions are handled by paket)** Currently I need to explicitly add it to all paket.reference files. The most I could do is to then write a unit test that verifies that yes, all projects really import it. If I create a new project, and forget it, the UT fails.
** With this feature, I could solve this via MSBuild programming and e.g. a Directory.props
<PaketReference Include="FSharp.Core" Group="netcore" Condition=" '$(TargetFramework)' != 'net35' " />
Edit:
I just saw that this was already proposed at #2019.
I guess it was unlikely that I would be the only one to think of this.
The text was updated successfully, but these errors were encountered: