Skip to content

Commit

Permalink
generate-load-scripts case sensitivity - fixes #2547
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jul 21, 2017
1 parent 6137c34 commit 3d84116
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 5.81.1 - 21.07.2017
* BUGFIX: Fixed generate-load-scripts case sensitivity - https://github.com/fsprojects/Paket/issues/2547

#### 5.81.0 - 21.07.2017
* BUGFIX: Pass along empty arguments in bootstrapper - https://github.com/fsprojects/Paket/issues/2551

Expand Down
10 changes: 6 additions & 4 deletions src/Paket.Core/Dependencies/NuGet.fs
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,18 @@ let tryFindFolder folder (content:NuGetPackageContent) =
contents
|> List.collect (collectItems fullPath relPath)
| NuGetFile _ ->
[ {UnparsedPackageFile.FullPath = fullPath; UnparsedPackageFile.PathWithinPackage = relPath } ]
[ {UnparsedPackageFile.FullPath = fullPath
UnparsedPackageFile.PathWithinPackage = relPath } ]

content.Content
|> List.tryPick (fun c ->
match c with
| NuGetDirectory(n,contents) when String.equalsIgnoreCase n folder -> Some contents
| NuGetDirectory(name,contents) when String.equalsIgnoreCase name folder ->
Some(name,contents)
| _ -> None)
|> Option.map (fun item ->
|> Option.map (fun (name,item) ->
item
|> List.collect (collectItems (Path.Combine(content.Path, folder)) folder))
|> List.collect (collectItems (Path.Combine(content.Path, name)) name))

let DownloadLicense(root,force,packageName:PackageName,version:SemVerInfo,licenseUrl,targetFileName) =
async {
Expand Down
20 changes: 16 additions & 4 deletions src/Paket.Core/PaketConfigFiles/InstallModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ module Library =
let ext = fi.Extension
if String.IsNullOrEmpty ext then fi.Name
else fi.Name.Replace(ext, "")
{ Name = name; Path = f.File.FullPath; PathWithinPackage = f.File.PathWithinPackage }

{ Name = name
Path = f.File.FullPath
PathWithinPackage = f.File.PathWithinPackage }

type RuntimeLibrary = {
Library : Library
Expand Down Expand Up @@ -431,16 +434,20 @@ module InstallModel =
folderType
|> Seq.map (fun folder -> choosefn folder.FolderContents)
|> Seq.concat

/// This is for library references, which at the same time can be used for references (old world - pre dotnetcore)
let getLegacyReferences (target : TargetProfile) (installModel:InstallModel) =
getFileFolders target (installModel.CompileLibFolders) (fun f -> f.Libraries |> Set.toSeq)
|> Seq.cache

let getLegacyFrameworkReferences (target : TargetProfile) (installModel:InstallModel) =
getFileFolders target (installModel.CompileLibFolders) (fun f -> f.FrameworkReferences |> Set.toSeq)
|> Seq.cache

let getAllLegacyFrameworkReferences (installModel:InstallModel) =
getAllFiles installModel.CompileLibFolders (fun f -> f.FrameworkReferences |> Set.toSeq)
|> Seq.cache

let getAllLegacyReferences (installModel:InstallModel) =
getAllFiles installModel.CompileLibFolders (fun f -> f.Libraries |> Set.toSeq)
|> Seq.cache
Expand Down Expand Up @@ -469,6 +476,7 @@ module InstallModel =
lib
|> Seq.map (fun l -> l.FolderContents)
|> Seq.forall Set.isEmpty

let removeIfCompletelyEmpty (this:InstallModel) =
let foldersEmpty =
isEmpty this.CompileRefFolders && isEmpty this.TargetsFileFolders && isEmpty this.RuntimeAssemblyFolders &&
Expand Down Expand Up @@ -508,9 +516,13 @@ module InstallModel =
match references with
| NuspecReferences.All -> true
| NuspecReferences.Explicit list -> List.exists file.File.FullPath.EndsWith list
if not install then this else
{ this with
CompileLibFolders = addFileToFolder path (Library.ofFile file) this.CompileLibFolders ReferenceOrLibraryFolder.addLibrary }

if not install then
this
else
let folders = addFileToFolder path (Library.ofFile file) this.CompileLibFolders ReferenceOrLibraryFolder.addLibrary
{ this with
CompileLibFolders = folders }

let private addPackageRefFile references (path:FrameworkFolder<Library Set>) (file:FrameworkDependentFile) (this:InstallModel) : InstallModel =
let install =
Expand Down

0 comments on commit 3d84116

Please sign in to comment.