Skip to content

Commit

Permalink
Merge pull request #8 from Wintellect/fake-build-projects
Browse files Browse the repository at this point in the history
Part 2 - Building Projects
  • Loading branch information
jwood803 committed Oct 8, 2015
2 parents 883df94 + be1601d commit f85e959
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,5 @@ FakesAssemblies/
*.opt

.fake

FakeDemo/iOS/iPhoneSimulator/
49 changes: 41 additions & 8 deletions FakeDemo/build.fsx
Original file line number Diff line number Diff line change
@@ -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
RunTargetOrDefault "Test"

0 comments on commit f85e959

Please sign in to comment.