Skip to content

Commit

Permalink
Resolve more runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Apr 19, 2016
1 parent 2d9f0d3 commit a40e5d5
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 26 deletions.
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#### 2.62.2 - 19.04.2016
#### 2.62.3 - 19.04.2016
* EXPERIMENTAL: paket resolves runtime dependency libs - https://github.com/fsprojects/Paket/pull/1626

#### 2.62.1 - 17.04.2016
Expand Down
10 changes: 5 additions & 5 deletions src/Paket.Bootstrapper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
[assembly: AssemblyTitleAttribute("Paket.Bootstrapper")]
[assembly: AssemblyProductAttribute("Paket")]
[assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")]
[assembly: AssemblyVersionAttribute("2.62.2")]
[assembly: AssemblyFileVersionAttribute("2.62.2")]
[assembly: AssemblyInformationalVersionAttribute("2.62.2")]
[assembly: AssemblyVersionAttribute("2.62.3")]
[assembly: AssemblyFileVersionAttribute("2.62.3")]
[assembly: AssemblyInformationalVersionAttribute("2.62.3")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "2.62.2";
internal const string InformationalVersion = "2.62.2";
internal const string Version = "2.62.3";
internal const string InformationalVersion = "2.62.3";
}
}
10 changes: 5 additions & 5 deletions src/Paket.Core/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")>]
[<assembly: AssemblyVersionAttribute("2.62.2")>]
[<assembly: AssemblyFileVersionAttribute("2.62.2")>]
[<assembly: AssemblyInformationalVersionAttribute("2.62.2")>]
[<assembly: AssemblyVersionAttribute("2.62.3")>]
[<assembly: AssemblyFileVersionAttribute("2.62.3")>]
[<assembly: AssemblyInformationalVersionAttribute("2.62.3")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "2.62.2"
let [<Literal>] InformationalVersion = "2.62.2"
let [<Literal>] Version = "2.62.3"
let [<Literal>] InformationalVersion = "2.62.3"
2 changes: 2 additions & 0 deletions src/Paket.Core/FrameworkHandling.fs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ module FrameworkDetection =
| x when x.StartsWith "runtimes/" -> Some(Runtimes(x.Substring(9)))
| "runtimes/win7-x86" -> Some(Runtimes("Win32"))
| "runtimes/win7-arm" -> Some(Runtimes("arm"))
| "runtimes/aot" -> Some(Runtimes("aot"))
| "native" -> Some(Native("",""))
| "sl" | "sl3" | "sl30" -> Some (Silverlight "v3.0")
| "sl4" | "sl40" -> Some (Silverlight "v4.0")
Expand Down Expand Up @@ -465,6 +466,7 @@ module KnownTargetProfiles =
Runtimes("win7-x86")
Runtimes("win7-arm")
Runtimes("debian-x64")
Runtimes("aot")
Runtimes("osx") ]

let AllProfiles = (AllNativeProfiles |> List.map (fun p -> SinglePlatform p)) @ (AllRuntimes |> List.map (fun p -> SinglePlatform p)) @ AllDotNetProfiles
Expand Down
10 changes: 6 additions & 4 deletions src/Paket.Core/InstallModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,12 @@ module InstallModel =
TargetsFileFolders = []
Analyzers = [] }

let extractLibFolder path =
match Utils.extractPath ("lib", path) with
| None when path.Contains "runtimes" -> Utils.extractPath ("runtimes", path)
| x -> x
let extractLibFolder (path:string) =
let path = path.Replace("\\", "/").ToLower()
if path.Contains "runtimes" then
Utils.extractPath ("runtimes", path)
else
Utils.extractPath ("lib", path)

let extractBuildFolder path = Utils.extractPath ("build", path)

Expand Down
25 changes: 25 additions & 0 deletions src/Paket.Core/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ module ProjectFile =
(usedPackages : Map<GroupName*PackageName,_*InstallSettings>) hard (project:ProjectFile) =
removePaketNodes project

let packagesWithRuntimeDependencies = System.Collections.Generic.HashSet<_>()
completeModel
|> Seq.filter (fun kv -> usedPackages.ContainsKey kv.Key)
|> Seq.map (fun kv ->
Expand All @@ -931,6 +932,18 @@ module ProjectFile =
let copyLocal = defaultArg installSettings.CopyLocal true
let importTargets = defaultArg installSettings.ImportTargets true

let hasRunTimeStuff =
projectModel.ReferenceFileFolders
|> Seq.collect (fun lib ->
match lib with
| x when (match x.Targets with | [SinglePlatform(Runtimes(_))] -> true | _ -> false) -> lib.Files.References
| _ -> Set.empty)
|> Seq.isEmpty
|> not

if hasRunTimeStuff then
packagesWithRuntimeDependencies.Add(kv.Key) |> ignore

generateXml projectModel copyLocal importTargets installSettings.ReferenceCondition project)
|> Seq.iter (fun (propsNodes,targetsNodes,chooseNode,propertyChooseNode, analyzersNode) ->

Expand Down Expand Up @@ -1004,6 +1017,18 @@ module ProjectFile =
project.ProjectNode.AppendChild analyzersNode |> ignore
)

// if Seq.isEmpty packagesWithRuntimeDependencies then () else

// let allPackages =
// packagesWithRuntimeDependencies
// |> Seq.map (fun (group,packageName) ->
// if group = Constants.MainDependencyGroup then
// packageName.ToString()
// else
// sprintf "%O#%O" group packageName)
// |> fun xs -> String.Join(";",xs)
// failwithf "%s" allPackages

let save forceTouch project =
if Utils.normalizeXml project.Document <> project.OriginalText || not (File.Exists(project.FileName)) then
verbosefn "Project %s changed" project.FileName
Expand Down
3 changes: 2 additions & 1 deletion src/Paket.Core/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ let inline createRelativePath root path =
uri.MakeRelativeUri(Uri path).ToString().Replace("/", "\\").Replace("%20", " ")

let getNative (path:string) =
if path.Contains "native" |> not then "" else
if path.Contains "native" |> not && path.Contains "runtimes" |> not then "" else
if path.Contains "/x86/debug" then "x86/debug" else
if path.Contains "/x86/release" then "/x86/release" else
if path.Contains "/arm/debug" then "/arm/debug" else
Expand All @@ -150,6 +150,7 @@ let getNative (path:string) =
if path.Contains "/win7-x86" then "/win7-x86" else
if path.Contains "/win7-arm" then "/win7-arm" else
if path.Contains "/debian-x64" then "/debian-x64" else
if path.Contains "/aot" then "/aot" else
if path.Contains "/osx" then "/osx" else
""

Expand Down
10 changes: 5 additions & 5 deletions src/Paket.PowerShell/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")>]
[<assembly: AssemblyVersionAttribute("2.62.2")>]
[<assembly: AssemblyFileVersionAttribute("2.62.2")>]
[<assembly: AssemblyInformationalVersionAttribute("2.62.2")>]
[<assembly: AssemblyVersionAttribute("2.62.3")>]
[<assembly: AssemblyFileVersionAttribute("2.62.3")>]
[<assembly: AssemblyInformationalVersionAttribute("2.62.3")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "2.62.2"
let [<Literal>] InformationalVersion = "2.62.2"
let [<Literal>] Version = "2.62.3"
let [<Literal>] InformationalVersion = "2.62.3"
10 changes: 5 additions & 5 deletions src/Paket/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")>]
[<assembly: AssemblyVersionAttribute("2.62.2")>]
[<assembly: AssemblyFileVersionAttribute("2.62.2")>]
[<assembly: AssemblyInformationalVersionAttribute("2.62.2")>]
[<assembly: AssemblyVersionAttribute("2.62.3")>]
[<assembly: AssemblyFileVersionAttribute("2.62.3")>]
[<assembly: AssemblyInformationalVersionAttribute("2.62.3")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "2.62.2"
let [<Literal>] InformationalVersion = "2.62.2"
let [<Literal>] Version = "2.62.3"
let [<Literal>] InformationalVersion = "2.62.3"
6 changes: 6 additions & 0 deletions tests/Paket.Tests/InstallModel/ProcessingSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ let ``should understand libuv in runtimes``() =

model.GetLibReferences(SinglePlatform (Runtimes("win7-x64"))) |> shouldContain @"..\Microsoft.AspNetCore.Server.Kestrel\runtimes\win7-x64\native\libuv.dll"

[<Test>]
let ``should understand aot in runtimes``() =
let model = emptymodel.AddReferences [ @"..\packages\System.Diagnostics.Contracts\runtimes\aot\lib\netcore50\System.Diagnostics.Contracts.dll"; ]

model.GetLibReferences(SinglePlatform (Runtimes("aot"))) |> shouldContain @"..\packages\System.Diagnostics.Contracts\runtimes\aot\lib\netcore50\System.Diagnostics.Contracts.dll"


[<Test>]
let ``should understand mylib in mylib.dll``() =
Expand Down

0 comments on commit a40e5d5

Please sign in to comment.