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

Fix failing test case. #1644

Merged
merged 2 commits into from Apr 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/Paket.Core/ProjectFile.fs
Expand Up @@ -485,9 +485,8 @@ module ProjectFile =
let libReferenceNode =
let name =
match fileItem.BuildAction with
| BuildAction.Reference ->
let n = FileInfo(fileItem.Include).Name.TrimEnd('\\').Split('\\') |> Array.last
n.Replace(Path.GetExtension n,"")
| BuildAction.Reference ->
fileItem.Include |> normalizePath |> Path.GetFileNameWithoutExtension
| _ -> fileItem.Include

createNode (string fileItem.BuildAction) project
Expand Down Expand Up @@ -520,7 +519,7 @@ module ProjectFile =
|> getDescendants (string fileItem.BuildAction)
|> List.filter (fun node ->
match node |> getAttribute "Include" with
| Some path when path.StartsWith (Path.GetDirectoryName fileItem.Include) -> true
| Some path when path.StartsWith (fileItem.Include |> normalizePath |> Path.GetDirectoryName |> windowsPath) -> true
| _ -> false)


Expand Down
2 changes: 1 addition & 1 deletion src/Paket.Core/Utils.fs
Expand Up @@ -442,7 +442,7 @@ let askYesNo question =
getAnswer()

let inline normalizePath(path:string) = path.Replace("\\",Path.DirectorySeparatorChar.ToString()).Replace("/",Path.DirectorySeparatorChar.ToString()).TrimEnd(Path.DirectorySeparatorChar)

let inline windowsPath (path:string) = path.Replace(Path.DirectorySeparatorChar, '\\')
/// Gets all files with the given pattern
let inline FindAllFiles(folder, pattern) = DirectoryInfo(folder).GetFiles(pattern, SearchOption.AllDirectories)

Expand Down