-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from jindraivanek/project-load
Reordering project file
- Loading branch information
Showing
5 changed files
with
47 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
open Mechanic | ||
open Mechanic.Files | ||
open Mechanic.GraphAlg | ||
open Mechanic.Utils | ||
|
||
[<EntryPoint>] | ||
let main argv = | ||
let root = argv.[0] | ||
let pattern = argv.[1] | ||
SymbolGraph.solveOrderFromPattern root pattern | ||
|> printfn "%A" | ||
match argv.Length with | ||
| 1 -> | ||
let p = ProjectFile.loadFromFile argv.[0] | ||
p |> ProjectFile.getSourceFiles | ||
|> SymbolGraph.solveOrder (fun f -> f.FullName) | ||
|> function | ||
| TopologicalOrderResult.TopologicalOrder xs -> | ||
xs |> fun x -> ProjectFile.updateProjectFile x p | ||
TopologicalOrderResult.TopologicalOrder (xs |> List.map (fun f -> f.FullName)) | ||
| TopologicalOrderResult.Cycle xs -> TopologicalOrderResult.Cycle (xs |> List.map (fun f -> f.FullName)) | ||
|> printfn "%A" | ||
| 2 -> | ||
let root = argv.[0] | ||
let pattern = argv.[1] | ||
SymbolGraph.solveOrderFromPattern root pattern | ||
|> printfn "%A" | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters