Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Xamarin.iOS archive helper params. #693

Merged
merged 2 commits into from
Mar 12, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/app/FakeLib/XamarinHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
}
Expand All @@ -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