From e60ea639f1d7173cb06b79a3b88170b7dde41017 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 21 Sep 2015 15:16:18 -0400 Subject: [PATCH 1/6] Add iOS and Android build targets --- FakeDemo/build.fsx | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/FakeDemo/build.fsx b/FakeDemo/build.fsx index 22989ec..f6fd1d6 100644 --- a/FakeDemo/build.fsx +++ b/FakeDemo/build.fsx @@ -1,15 +1,47 @@ #r "packages/FAKE/tools/FakeLib.dll" // 1 open Fake // 2 +open Fake.XamarinHelper + +let buildDir = "FakeDemo/bin/Debug" + +Target "Clean" (fun _ -> + CleanDir buildDir +) Target "Test" (fun _ -> // 3 trace "Testing stuff..." ) -Target "Build" (fun _ -> - trace "Heavy build action" +Target "BuildPcl" (fun _ -> + //RestorePackages () + + !! "FakeDemo.csproj" + |> MSBuild "FakeDemo/bin/Debug" "Build" [ ("Configuration", "Debug"); ("Platform", "Any CPU") ] + |> Log "---PCL build output---" +) + +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----" ) -"Build" // 4 +"BuildPcl" // 4 + ==> "Clean" ==> "Test" -Run "Test" // 5 \ No newline at end of file +"Build-Droid" + ==> "Build-iOS" + + +RunTargetOrDefault "Test" // 5 \ No newline at end of file From 6478c4177a5ec02dcf35d24dfd63ba4c08df47c6 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 22 Sep 2015 11:33:11 -0400 Subject: [PATCH 2/6] Remove comments from part 1 --- FakeDemo/build.fsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/FakeDemo/build.fsx b/FakeDemo/build.fsx index f6fd1d6..0e16e4d 100644 --- a/FakeDemo/build.fsx +++ b/FakeDemo/build.fsx @@ -1,5 +1,5 @@ -#r "packages/FAKE/tools/FakeLib.dll" // 1 -open Fake // 2 +#r "packages/FAKE/tools/FakeLib.dll" +open Fake open Fake.XamarinHelper let buildDir = "FakeDemo/bin/Debug" @@ -8,12 +8,12 @@ Target "Clean" (fun _ -> CleanDir buildDir ) -Target "Test" (fun _ -> // 3 +Target "Test" (fun _ -> trace "Testing stuff..." ) Target "BuildPcl" (fun _ -> - //RestorePackages () + RestorePackages () !! "FakeDemo.csproj" |> MSBuild "FakeDemo/bin/Debug" "Build" [ ("Configuration", "Debug"); ("Platform", "Any CPU") ] @@ -36,12 +36,11 @@ Target "Build-Droid" (fun _ -> |> Log "----Android build output----" ) -"BuildPcl" // 4 +"BuildPcl" ==> "Clean" ==> "Test" "Build-Droid" ==> "Build-iOS" - -RunTargetOrDefault "Test" // 5 \ No newline at end of file +RunTargetOrDefault "Test" \ No newline at end of file From 9a2676017bf02bc44de344e379ee7442601d7bb4 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 23 Sep 2015 14:33:12 -0400 Subject: [PATCH 3/6] Try to restore packages --- FakeDemo/build.fsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/FakeDemo/build.fsx b/FakeDemo/build.fsx index 0e16e4d..ac9fdc4 100644 --- a/FakeDemo/build.fsx +++ b/FakeDemo/build.fsx @@ -12,8 +12,9 @@ Target "Test" (fun _ -> trace "Testing stuff..." ) -Target "BuildPcl" (fun _ -> - RestorePackages () +Target "Build-Pcl" (fun _ -> + "FakeDemo/packages.config" + |> RestorePackage (fun defaults -> defaults) !! "FakeDemo.csproj" |> MSBuild "FakeDemo/bin/Debug" "Build" [ ("Configuration", "Debug"); ("Platform", "Any CPU") ] @@ -36,11 +37,8 @@ Target "Build-Droid" (fun _ -> |> Log "----Android build output----" ) -"BuildPcl" - ==> "Clean" - ==> "Test" - -"Build-Droid" - ==> "Build-iOS" +"Clean" + ==> "Build-Pcl" + ==> "Test" RunTargetOrDefault "Test" \ No newline at end of file From 73547726d53f2771348f8b6fbd06ea217a1d7556 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 23 Sep 2015 14:37:43 -0400 Subject: [PATCH 4/6] Restore packages in solution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note that the project path can’t have spaces or `RestorePackages` will error out --- FakeDemo/build.fsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/FakeDemo/build.fsx b/FakeDemo/build.fsx index ac9fdc4..5f0f6c1 100644 --- a/FakeDemo/build.fsx +++ b/FakeDemo/build.fsx @@ -13,8 +13,7 @@ Target "Test" (fun _ -> ) Target "Build-Pcl" (fun _ -> - "FakeDemo/packages.config" - |> RestorePackage (fun defaults -> defaults) + RestorePackages() !! "FakeDemo.csproj" |> MSBuild "FakeDemo/bin/Debug" "Build" [ ("Configuration", "Debug"); ("Platform", "Any CPU") ] From 7cdf3430c6437233166416a28a26900b9f9f21ab Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 23 Sep 2015 14:44:00 -0400 Subject: [PATCH 5/6] Add build dependency for iOS and Droid targets --- FakeDemo/build.fsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/FakeDemo/build.fsx b/FakeDemo/build.fsx index 5f0f6c1..42d5f4a 100644 --- a/FakeDemo/build.fsx +++ b/FakeDemo/build.fsx @@ -40,4 +40,9 @@ Target "Build-Droid" (fun _ -> ==> "Build-Pcl" ==> "Test" +"Clean" + ==> "Build-Pcl" + ==> "Build-iOS" + ==> "Build-Droid" + RunTargetOrDefault "Test" \ No newline at end of file From be1601d3e432a5a1dfa875fd2712d9949c189e13 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 23 Sep 2015 14:44:18 -0400 Subject: [PATCH 6/6] Ignoring iOS output...maybe not even be correct --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) 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