open Fake.Testing
open System
open System.IO
+open System.Diagnostics
// --------------------------------------------------------------------------------------
// START TODO: Provide project-specific details below
| _ -> failwith (sprintf "Project file %s not supported. Unknown project type." projFileName)
-let activeProjects =
+let buildProjects =
+ !! "src/Generator.*/**.csproj"
+
+let runtimeProjects =
let xamarinFilter f =
if isXamarinPlatform then
f
!! "src/**/*.??proj"
++ "tests/**/OpenTK.Tests*.fsproj"
+ -- "src/Generator.*/**.csproj"
|> xamarinFilter
+let activeProjects =
+ Seq.concat [buildProjects; runtimeProjects]
+
+let generateBindings =
+ if not (File.Exists(".bindingsGenerated")) then
+ buildProjects
+ |> MSBuildRelease "" "Build"
+ |> ignore
+ let bindingProcess = new Process()
+ bindingProcess.StartInfo.FileName <- "src/Generator.Bind/bin/Release/Bind.exe"
+ bindingProcess.Start()
+ bindingProcess.WaitForExit()
+ File.Create(".bindingsGenerated").Close();
+
+
// Generate assembly info files with the right version & up-to-date information
Target "AssemblyInfo" (fun _ ->
let getAssemblyInfoAttributes (projectName:string) =
)
// --------------------------------------------------------------------------------------
+// Build generator projects, and generate bindings if neccesary
+Target "GenerateBindings" (fun _ ->
+ generateBindings
+ |> ignore
+)
+
+// --------------------------------------------------------------------------------------
// Build library & test project
Target "Build" (fun _ ->
+ generateBindings
activeProjects
|> MSBuildRelease "" "Build"
|> ignore