From 9fcd1db1d18a61c5d9f5835d8bf028e89786f802 Mon Sep 17 00:00:00 2001 From: Adam Patridge Date: Thu, 12 Mar 2015 11:16:17 -0600 Subject: [PATCH 1/2] Adjust Xamarin.iOS archive helper params. --- src/app/FakeLib/XamarinHelper.fs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/app/FakeLib/XamarinHelper.fs b/src/app/FakeLib/XamarinHelper.fs index 6cba929afa0..29508d42285 100644 --- a/src/app/FakeLib/XamarinHelper.fs +++ b/src/app/FakeLib/XamarinHelper.fs @@ -165,8 +165,10 @@ let AndroidSignAndAlign setParams apkFile = /// The iOS archive paramater type type iOSArchiveParams = { - /// (Required) Path to project file - ProjectPath: string + /// Path to desired project or solution file. If not provided, mdtool finds the first solution in the current directory. + ProjectOrSolutionPath: string + /// Project name within a solution file + ProjectName: string /// Build configuration, defaults to 'Debug|iPhoneSimulator' Configuration: string /// Path to mdtool, defaults to Xamarin Studio's usual path @@ -175,7 +177,8 @@ type iOSArchiveParams = { /// The default iOS archive parameters let iOSArchiveDefaults = { - ProjectPath = "" + ProjectOrSolutionPath = "" + ProjectName = "" Configuration = "Debug|iPhoneSimulator" MDToolPath = "/Applications/Xamarin Studio.app/Contents/MacOS/mdtool" } @@ -184,16 +187,11 @@ let iOSArchiveDefaults = { /// ## Parameters /// - `setParams` - Function used to override the default archive parameters let iOSArchive setParams = - let validateParams param = - if param.ProjectPath = "" then failwith "You must specify a project to archive" - - param - let archiveProject param = - let args = String.Format(@"-v archive ""-c:{0}"" -p:{1}", param.Configuration, param.ProjectPath) + let projectNameArg = if param.ProjectName <> "" then String.Format("-p:{0} ", param.ProjectName) else "" + let args = String.Format(@"-v archive ""-c:{0}"" {1}{2}", param.Configuration, projectNameArg, param.ProjectOrSolutionPath) executeCommand param.MDToolPath args iOSArchiveDefaults |> setParams - |> validateParams |> archiveProject \ No newline at end of file From 4feccc42f0ae55c0794f2a46d24035663ae2af6e Mon Sep 17 00:00:00 2001 From: Adam Patridge Date: Thu, 12 Mar 2015 11:48:42 -0600 Subject: [PATCH 2/2] Xamarin.iOS archive helper wants a sln file. --- src/app/FakeLib/XamarinHelper.fs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/FakeLib/XamarinHelper.fs b/src/app/FakeLib/XamarinHelper.fs index 29508d42285..efaf7fee9eb 100644 --- a/src/app/FakeLib/XamarinHelper.fs +++ b/src/app/FakeLib/XamarinHelper.fs @@ -165,8 +165,9 @@ let AndroidSignAndAlign setParams apkFile = /// The iOS archive paramater type type iOSArchiveParams = { - /// Path to desired project or solution file. If not provided, mdtool finds the first solution in the current directory. - ProjectOrSolutionPath: string + /// Path to desired solution file. If not provided, mdtool finds the first solution in the current directory. + /// Although mdtool can take a project file, the archiving seems to fail to work without a solution. + SolutionPath: string /// Project name within a solution file ProjectName: string /// Build configuration, defaults to 'Debug|iPhoneSimulator' @@ -177,7 +178,7 @@ type iOSArchiveParams = { /// The default iOS archive parameters let iOSArchiveDefaults = { - ProjectOrSolutionPath = "" + SolutionPath = "" ProjectName = "" Configuration = "Debug|iPhoneSimulator" MDToolPath = "/Applications/Xamarin Studio.app/Contents/MacOS/mdtool" @@ -189,7 +190,7 @@ let iOSArchiveDefaults = { let iOSArchive setParams = let archiveProject param = let projectNameArg = if param.ProjectName <> "" then String.Format("-p:{0} ", param.ProjectName) else "" - let args = String.Format(@"-v archive ""-c:{0}"" {1}{2}", param.Configuration, projectNameArg, param.ProjectOrSolutionPath) + let args = String.Format(@"-v archive ""-c:{0}"" {1}{2}", param.Configuration, projectNameArg, param.SolutionPath) executeCommand param.MDToolPath args iOSArchiveDefaults