File tree 3 files changed +6
-13
lines changed
3 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,6 @@ type Location =
9
9
| Rel of RelPath
10
10
| Abs of AbsPath
11
11
12
- type FileLocation = FileLocation of Location
13
- type DirLocation = DirLocation of Location
14
-
15
12
let toAbs ( AbsPath anchorPath ) ( RelPath relativeSegment ) =
16
13
let anchorDir = Path.GetDirectoryName( anchorPath)
17
14
Path.Combine( anchorDir, relativeSegment) |> Path.GetFullPath |> AbsPath
@@ -25,8 +22,4 @@ let normalize anchor location =
25
22
let toLocation ( str : string ) =
26
23
match Path.IsPathRooted( str) with
27
24
| true -> str |> AbsPath |> Location.Abs
28
- | false -> str |> RelPath |> Location.Rel
29
-
30
- let toFileLocation = toLocation >> FileLocation
31
-
32
- let toDirLocation = toLocation >> FileLocation
25
+ | false -> str |> RelPath |> Location.Rel
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ let main argv =
55
55
56
56
let builder = { GetEdges = Projects.GetProjectDependencies }
57
57
58
- let originProject = argData.ProjectFile |> Paths.toFileLocation |> Projects.ProjectRef
58
+ let originProject = argData.ProjectFile |> Paths.toLocation |> Projects.ProjectRef
59
59
60
60
let originNode = Graph.Build( builder, originProject)
61
61
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ open System.Xml.Linq
4
4
open BulkAdd.Paths
5
5
open System.IO
6
6
7
- type ProjectRef = ProjectRef of FileLocation
8
- let private getXml ( FileLocation location) =
7
+ type ProjectRef = ProjectRef of Location
8
+ let private getXml ( location ) =
9
9
match location with
10
10
| Abs ( AbsPath path) -> XElement.Load path
11
11
| Rel ( RelPath path) -> XElement.Load path
@@ -17,14 +17,14 @@ let private getProjectDependencies(projectPath : AbsPath) =
17
17
let ( AbsPath projectFilePath ) = projectPath
18
18
let projectXml = XElement.Load( projectFilePath)
19
19
20
- let makeReference = Paths.normalize projectPath >> FileLocation >> ProjectRef
20
+ let makeReference = Paths.normalize projectPath >> ProjectRef
21
21
22
22
projectXml.Descendants !! " ProjectReference"
23
23
|> Seq.choose ( getAttribute !! " Include" )
24
24
|> Seq.map ( fun attr -> attr.Value |> Paths.toLocation |> makeReference)
25
25
|> Seq.toList
26
26
27
- let GetProjectDependencies ( ProjectRef ( FileLocation location) ) =
27
+ let GetProjectDependencies ( ProjectRef location ) =
28
28
let pwd = System.Environment.CurrentDirectory |> AbsPath
29
29
match location with
30
30
| Rel relPath -> relPath |> Paths.toAbs pwd |> getProjectDependencies
You can’t perform that action at this time.
0 commit comments