Skip to content

Instantly share code, notes, and snippets.

@VincentDondain
Created November 17, 2015 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VincentDondain/397e2c9c668570a172a6 to your computer and use it in GitHub Desktop.
Save VincentDondain/397e2c9c668570a172a6 to your computer and use it in GitHub Desktop.
commit dc033b0452f47e8d747a0da02a2ce757d40efdfb
Author: VincentDondain <vincent.dondain@xamarin.com>
Date: Tue Nov 17 15:33:38 2015 +0000
[msbuild] Added mtouch verbosity arg
diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs b/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs
index be2bf17..e0ec32a 100644
--- a/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs
+++ b/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs
@@ -137,6 +137,8 @@ namespace Xamarin.iOS.Tasks
[Required]
public bool UseThumb { get; set; }
+ public int Verbosity { get; set; }
+
[Required]
public ITaskItem[] AppExtensionReferences { get; set; }
@@ -520,6 +522,10 @@ namespace Xamarin.iOS.Tasks
args.AddQuoted (MainAssembly.ItemSpec);
+ // We give the priority to the ExtraArgs to set the mtouch verbosity.
+ if (string.IsNullOrEmpty (ExtraArgs) || (!string.IsNullOrEmpty (ExtraArgs) && !ExtraArgs.Contains ("-q") && !ExtraArgs.Contains ("-v")))
+ args.Add (GetVerbosityLevel (Verbosity));
+
return args.ToString ();
}
@@ -541,6 +547,7 @@ namespace Xamarin.iOS.Tasks
Log.LogTaskProperty ("AppExtensionReferences", AppExtensionReferences);
Log.LogTaskProperty ("AppManifest", AppManifest);
Log.LogTaskProperty ("Architectures", Architectures);
+ Log.LogTaskProperty ("BitcodeEnabled", EnableBitcode);
Log.LogTaskProperty ("CompiledEntitlements", CompiledEntitlements);
Log.LogTaskProperty ("Debug", Debug);
Log.LogTaskProperty ("EnableGenericValueTypeSharing", EnableGenericValueTypeSharing);
@@ -564,12 +571,12 @@ namespace Xamarin.iOS.Tasks
Log.LogTaskProperty ("SdkVersion", SdkVersion);
Log.LogTaskProperty ("SymbolsList", SymbolsList);
Log.LogTaskProperty ("TargetFrameworkIdentifier", TargetFrameworkIdentifier);
+ Log.LogTaskProperty ("UseFloat32As64", UseFloat32As64);
Log.LogTaskProperty ("UseLlvm", UseLlvm);
- Log.LogTaskProperty ("BitcodeEnabled", EnableBitcode);
Log.LogTaskProperty ("UseRefCounting", UseRefCounting);
- Log.LogTaskProperty ("UseFloat32As64", UseFloat32As64);
Log.LogTaskProperty ("UseSGen", UseSGen);
Log.LogTaskProperty ("UseThumb", UseThumb);
+ Log.LogTaskProperty ("Verbosity", Verbosity.ToString ());
try {
plist = PDictionary.FromFile (AppManifest.ItemSpec);
@@ -640,5 +647,27 @@ namespace Xamarin.iOS.Tasks
return null;
}
+
+ static string GetVerbosityLevel (int v) {
+ string result = "";
+ switch (v) {
+ case 0:
+ result = "-q";
+ break;
+ case 1:
+ result = "-v";
+ break;
+ case 2:
+ result = "-v -v";
+ break;
+ case 3:
+ result = "-v -v -v";
+ break;
+ case 4:
+ result = "-v -v -v -v";
+ break;
+ }
+ return result;
+ }
}
}
diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets
index 6cdaf64..b19a92a 100644
--- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets
+++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets
@@ -704,6 +704,7 @@ Copyright (C) 2013-2014 Xamarin. All rights reserved.
UseThumb="$(MtouchUseThumb)"
EnableBitcode="$(MtouchEnableBitcode)"
AppExtensionReferences="@(_ResolvedAppExtensionReferences)"
+ Verbosity="$(MtouchVerbosity)"
>
<Output TaskParameter="CompiledArchitectures" PropertyName="_CompiledArchitectures" />
</MTouch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment