@@ -7,38 +7,43 @@ open BulkAdd.Projects
7
7
open System
8
8
open System.IO
9
9
open BulkAdd.Graph
10
+ open BulkAdd.Paths
10
11
11
12
12
13
type StartInfo = System.Diagnostics.ProcessStartInfo
13
14
type Process = System.Diagnostics.Process
14
15
15
- let addProject slnPath ( projects : #seq<string> ) =
16
- for projPath in projects do
17
16
18
- printfn" -----------------------"
19
- printfn" Adding %s to %s " projPath slnPath
17
+ let addProjectToSln slnPath ( ProjectRef projectLocation ) =
20
18
21
- let command = sprintf " sln \" %s \" add \" %s \" " slnPath projPath
22
- if Debug then
23
- printfn " dotnet %s " command
24
- if Global.WhatIfMode then
25
- printfn " Not Executing in WhatIf mode"
26
- else
27
- try
19
+ let projectPath =
20
+ match projectLocation with
21
+ | Abs ( AbsPath abs) -> abs
22
+ | Rel ( RelPath rel) -> rel
28
23
29
- let startInfo = StartInfo()
30
- startInfo.FileName <- " dotnet"
31
- startInfo.Arguments <- command
24
+ printfn" -----------------------"
25
+ printfn" Adding %A to %s " projectPath slnPath
32
26
33
- let proc = Process.Start( startInfo)
34
- proc.WaitForExit()
27
+ let command = sprintf " sln \" %s \" add \" %s \" " slnPath projectPath
28
+ if Debug then
29
+ printfn " dotnet %s " command
30
+ if Global.WhatIfMode then
31
+ printfn " WhatIf mode, No Action Taken"
32
+ else
33
+ try
34
+ let startInfo = StartInfo()
35
+ startInfo.FileName <- " dotnet"
36
+ startInfo.Arguments <- command
35
37
36
- match proc.ExitCode with
37
- | 0 -> cprintf Color.Green " OK"
38
- | code -> cprintf Color.Yellow " Unusual Return :("
39
- with
40
- | _ -> ()
41
- printfn" -----------------------"
38
+ let proc = Process.Start( startInfo)
39
+ proc.WaitForExit()
40
+
41
+ match proc.ExitCode with
42
+ | 0 -> cprintf Color.Green " OK"
43
+ | code -> cprintf Color.Yellow " Unusual Return :("
44
+ with
45
+ | _ -> ()
46
+ //printfn"-----------------------"
42
47
43
48
44
49
[<EntryPoint>]
@@ -61,15 +66,9 @@ let main argv =
61
66
62
67
let inspector = {
63
68
State = ()
64
- Inspector = fun ( proj , ()) -> printfn " %A " proj
69
+ Inspector = fun ( projectRef , ()) -> addProjectToSln argData.SolutionFile projectRef
65
70
}
66
71
67
72
Graph.Visit( originNode, inspector)
68
73
69
- // |> Path.GetFullPath
70
- // |> AbsPath
71
- // |> ProjectRef
72
- // |> Graph.
73
- // |> addProject argData.SolutionFile
74
-
75
74
0
0 commit comments