Skip to content

Create a function which allows to serialize a FrameworkVersion in nuget syntax #291

Closed

Description

@forki

very naive implementation might look like:

type FrameworkVersion (projectFwVersion:string) =
  let nugetFwVersion = projectFwVersion.Replace("v","net")
  member x.NugetFwVersion = nugetFwVersion

also tests...

Activity

  1. khellang commented on Oct 23, 2014

    @khellang
    Contributor

    Basically you want this mapping? (from NuGet.Core)

    ".NETFramework" -> "net"
    ".NETMicroFramework" -> "netmf"
    "Silverlight" -> "sl"
    ".NETCore" -> "win"
    "Windows" -> "win"
    ".NETPortable" -> "portable"
    "WindowsPhone" -> "wp"
    "WindowsPhoneApp" -> "wpa"
    "Xamarin.iOS" -> "xamarinios"
    "Xamarin.Mac" -> "xamarinmac"
    "Xamarin.PlayStation3" -> "xamarinpsthree"
    "Xamarin.PlayStation4" -> "xamarinpsfour"
    "Xamarin.PlayStationVita" -> "xamarinpsvita"
    "Xamarin.Xbox360" -> "xamarinxboxthreesixty"
    "Xamarin.XboxOne" -> "xamarinxboxone"
    
  2. forki commented on Oct 23, 2014

    @forki
    MemberAuthor

    not exactly. At the moment wer can understand the folder structure in a package see https://github.com/fsprojects/Paket/blob/master/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs#L26

    what we want is to convert this info back into nuget syntax in order to patch nuspecs.

  3. khellang commented on Oct 23, 2014

    @khellang
    Contributor
  4. forki commented on Oct 23, 2014

    @forki
    MemberAuthor

    not completely sure but I think the inverse. but @Vidarls knows ;-)

  5. khellang commented on Oct 23, 2014

    @khellang
    Contributor

    It seems a bit crazy to duplicate all this logic. Have you ever considered dragging in NuGet.Core or even cherry-picking these parts from the NuGet codebase?

  6. forki commented on Oct 23, 2014

    @forki
    MemberAuthor

    We don't duplicate the logic ;-)
    But yes we considered to reference NuGet.Core. Very carefully.

    And we cherry-pick.

    2014-10-23 19:36 GMT+02:00 Kristian Hellang [email protected]:

    It seems a bit crazy to duplicate all this logic. Have you even considered
    dragging in NuGet.Core or even cherry-picking these parts from the NuGet
    codebase?

    —
    Reply to this email directly or view it on GitHub
    #291 (comment).

  7. Vidarls commented on Oct 23, 2014

    @Vidarls
    Contributor

    I have to admit there is a lot I do not yet grok of nuget/nuspec (like yhe fact that nuget have a public Api for utility stuff like this..)

    Anyhow, the reason for this conversion is to convert from targey fw found in a proj file to the correct subfolder name in a nuget package lib folder. My current (bnaive) implementation at the top seems to be working, but might have issues with edge cases. Not sure if nuget core has any code for this, but none of @khellang s suggestions seems to fit this use case

  8. khellang commented on Oct 23, 2014

    @khellang
    Contributor

    You should at least check out NuGet.Core's VersionUtility and NetPortableProfileTable (along with the other classes under the NuGet.Core.NETPortable namespace). They should have methods to go back and forth between different framework version representations.

  9. forki commented on Oct 23, 2014

    @forki
    MemberAuthor

    Yes. We did already. And ported some parts.

    But I can tell you most of the stuff is not really fitting. We already used
    in FAKE...
    On Oct 23, 2014 8:46 PM, "Kristian Hellang" [email protected]
    wrote:

    You should at least check out NuGet.Core's VersionUtility
    http://nuget.codeplex.com/SourceControl/latest#src/Core/Utility/VersionUtility.cs
    and NetPortableProfileTable
    http://nuget.codeplex.com/SourceControl/latest#src/Core/NETPortable/NetPortableProfileTable.cs
    (along with the other classes under the NuGet.Core.NETPortable namespace.

    —
    Reply to this email directly or view it on GitHub
    #291 (comment).

  10. forki commented on Oct 23, 2014

    @forki
    MemberAuthor

    I think I misinterpreted @Vidarls' original code and that part is already covered. Need to go back to the beginning.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions