46 lines
1.3 KiB
FSharp
46 lines
1.3 KiB
FSharp
#r "paket:
|
|
nuget Fake.IO.FileSystem
|
|
nuget Fake.Core.Target"
|
|
#load "./.fake/tool.fsx/intellisense.fsx"
|
|
|
|
open Fake.Core
|
|
open Fake.IO
|
|
open Fake.IO.Globbing.Operators
|
|
open Fake
|
|
|
|
open System.Diagnostics
|
|
|
|
let replicate _ =
|
|
// unison.exe doesn't work without very specific parameters
|
|
printfn "Detected changes..."
|
|
let psi = ProcessStartInfo()
|
|
psi.FileName <- "python"
|
|
psi.Arguments <- __SOURCE_DIRECTORY__ + "/replicator/replicate_to_linux_vm.py"
|
|
psi.UseShellExecute <- false
|
|
psi.CreateNoWindow <- true
|
|
let p = Process.Start(psi)
|
|
p.WaitForExit()
|
|
printfn "Ok"
|
|
|
|
let build _ =
|
|
replicate ()
|
|
Process.directExec (fun config ->
|
|
{ config with
|
|
FileName = "ssh"
|
|
Arguments = "bts@sparkvm -o StrictHostKeyChecking=no -t \"cd /home/bts/spark/build/ninja_debug/ && touch ../../CMakeLists.txt && time ninja\" "
|
|
}) |> ignore
|
|
|
|
|
|
Target.create "AutoBuild" (fun _ ->
|
|
use watcher = !!"src/**/*.cpp" ++ "src/**/*.h" ++ "src/**/*.proto" ++ "tools/*.sh" |> ChangeWatcher.run build
|
|
System.Console.ReadLine() |> ignore
|
|
)
|
|
|
|
Target.create "Replicate" (fun _ ->
|
|
use watcher = !!"src/**/*.cpp" ++ "src/**/*.h" ++ "src/**/*.proto" |> ChangeWatcher.run replicate
|
|
System.Console.ReadLine() |> ignore
|
|
)
|
|
|
|
Target.runOrDefault "Replicate"
|
|
|