diff --git a/src/app/FakeLib/XamarinHelper.fs b/src/app/FakeLib/XamarinHelper.fs index 6cba929afa0..efaf7fee9eb 100644 --- a/src/app/FakeLib/XamarinHelper.fs +++ b/src/app/FakeLib/XamarinHelper.fs @@ -165,8 +165,11 @@ let AndroidSignAndAlign setParams apkFile = /// The iOS archive paramater type type iOSArchiveParams = { - /// (Required) Path to project file - ProjectPath: 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' Configuration: string /// Path to mdtool, defaults to Xamarin Studio's usual path @@ -175,7 +178,8 @@ type iOSArchiveParams = { /// The default iOS archive parameters let iOSArchiveDefaults = { - ProjectPath = "" + SolutionPath = "" + ProjectName = "" Configuration = "Debug|iPhoneSimulator" MDToolPath = "/Applications/Xamarin Studio.app/Contents/MacOS/mdtool" } @@ -184,16 +188,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.SolutionPath) executeCommand param.MDToolPath args iOSArchiveDefaults |> setParams - |> validateParams |> archiveProject \ No newline at end of file