+Aurelia +Paket +FAKE

Interim commit; there may still be leftover files from the Aurelia
tutorial
This commit is contained in:
Daniel J. Summers
2017-05-20 09:45:48 -05:00
parent e522ab1ae1
commit b0b20df36d
69 changed files with 2884 additions and 25 deletions

69
build.fsx Normal file
View File

@@ -0,0 +1,69 @@
#r "packages/FAKE/tools/FakeLib.dll"
open Fake
open System
let buildDir = "./build/"
/// Path to the Aurelia app
let appPath = "src" @@ "app"
/// Path to the Suave API
let apiPath = "src" @@ "api"
// --- Targets ---
Target "Clean" (fun _ ->
CleanDir buildDir
)
Target "BuildApp" (fun _ ->
let result =
ExecProcessAndReturnMessages (fun info ->
info.UseShellExecute <- false
info.FileName <- "." @@ "build-au.bat") (TimeSpan.FromMinutes 2.)
match result.ExitCode with
| 0 -> Log "AppBuild-Output: " result.Messages
| _ -> failwith "Aurelia build failed"
)
Target "CopyApp" (fun _ ->
let apiWebPath = apiPath @@ "wwwroot"
[ "scripts" @@ "app-bundle.js"
"scripts" @@ "vendor-bundle.js"
"index.html"
]
|> List.iter (fun file ->
IO.File.Copy (appPath @@ file, apiWebPath @@ file, true)
Log "CopyApp--Output: " (Seq.singleton file))
)
Target "BuildApi" (fun _ ->
!! "src/api/*.fsproj"
|> MSBuildRelease buildDir "Build"
|> Log "ApiBuild-Output: "
)
Target "Run" (fun _ ->
ExecProcess (fun info ->
info.FileName <- "dotnet"
info.Arguments <- "myPrayerJournal.dll"
info.WorkingDirectory <- "build") TimeSpan.MaxValue
|> ignore
)
Target "Default" (fun _ ->
Log "" Seq.empty
)
// --- Dependencies ---
"Clean"
==> "BuildApp"
==> "CopyApp"
==> "BuildApi"
==> "Default"
"BuildApi"
==> "Run"
RunTargetOrDefault "Default"