diff --git a/.gitignore b/.gitignore index 15863ca..6b421a7 100644 --- a/.gitignore +++ b/.gitignore @@ -202,3 +202,5 @@ FakesAssemblies/ *.opt .fake + +FakeDemo/iOS/iPhoneSimulator/ \ No newline at end of file diff --git a/FakeDemo/build.fsx b/FakeDemo/build.fsx index 22989ec..42d5f4a 100644 --- a/FakeDemo/build.fsx +++ b/FakeDemo/build.fsx @@ -1,15 +1,48 @@ -#r "packages/FAKE/tools/FakeLib.dll" // 1 -open Fake // 2 +#r "packages/FAKE/tools/FakeLib.dll" +open Fake +open Fake.XamarinHelper -Target "Test" (fun _ -> // 3 +let buildDir = "FakeDemo/bin/Debug" + +Target "Clean" (fun _ -> + CleanDir buildDir +) + +Target "Test" (fun _ -> trace "Testing stuff..." ) -Target "Build" (fun _ -> - trace "Heavy build action" +Target "Build-Pcl" (fun _ -> + RestorePackages() + + !! "FakeDemo.csproj" + |> MSBuild "FakeDemo/bin/Debug" "Build" [ ("Configuration", "Debug"); ("Platform", "Any CPU") ] + |> Log "---PCL build output---" ) -"Build" // 4 - ==> "Test" +Target "Build-iOS" (fun _ -> + iOSBuild (fun defaults -> + { + defaults with ProjectPath = "iOS/FakeDemo.iOS.csproj" + OutputPath = "iOS/iPhoneSimulator/Debug" + Configuration = "Debug|iPhoneSimulator" + Target = "Build" + }) +) + +Target "Build-Droid" (fun _ -> + !! "Droid/FakeDemo.Droid.csproj" + |> MSBuild "Droid/bin/Debug" "Build" [ ("Configuration", "Debug"); ("Platform", "Any CPU") ] + |> Log "----Android build output----" +) + +"Clean" + ==> "Build-Pcl" + ==> "Test" + +"Clean" + ==> "Build-Pcl" + ==> "Build-iOS" + ==> "Build-Droid" -Run "Test" // 5 \ No newline at end of file +RunTargetOrDefault "Test" \ No newline at end of file