Merge commit '2272efbb189d457dc6c599cefd875425baad92a5' into framework-sdk

This commit is contained in:
Rolf Bjarne Kvinge 2017-03-14 19:24:07 +01:00
Родитель 1e498bce22 2272efbb18
Коммит b41307bb7f
55 изменённых файлов: 478 добавлений и 53 удалений

Просмотреть файл

@ -58,9 +58,9 @@ MAX_MONO_VERSION=4.8.99
MIN_MONO_URL=http://bosstoragemirror.blob.core.windows.net/wrench/mono-4.8.0/e5/e51aa0a7043a8185e264d6332ac7bc1f8f87cd39/MonoFramework-MDK-4.8.0.269.macos10.xamarin.universal.pkg MIN_MONO_URL=http://bosstoragemirror.blob.core.windows.net/wrench/mono-4.8.0/e5/e51aa0a7043a8185e264d6332ac7bc1f8f87cd39/MonoFramework-MDK-4.8.0.269.macos10.xamarin.universal.pkg
# Minimum Xamarin Studio version # Minimum Xamarin Studio version
MIN_XAMARIN_STUDIO_URL=https://files.xamarin.com/~rolf/XamarinStudio-6.1.0.4373.dmg MIN_XAMARIN_STUDIO_URL=https://bosstoragemirror.blob.core.windows.net/wrench/monodevelop-lion-master/a0/a04f5191c0d91121215fbbaa866f9d420521b6ee/XamarinStudio-6.4.0.5.dmg
MIN_XAMARIN_STUDIO_VERSION=6.1.0.4373 MIN_XAMARIN_STUDIO_VERSION=6.4.0.5
MAX_XAMARIN_STUDIO_VERSION=6.3.0.9999 MAX_XAMARIN_STUDIO_VERSION=6.4.0.9999
# Minimum CMake version # Minimum CMake version
MIN_CMAKE_URL=https://cmake.org/files/v3.6/cmake-3.6.2-Darwin-x86_64.dmg MIN_CMAKE_URL=https://cmake.org/files/v3.6/cmake-3.6.2-Darwin-x86_64.dmg

2
external/mono поставляемый

@ -1 +1 @@
Subproject commit 5aba8a05f147ab1d12414c8f072657531b1c97f1 Subproject commit 21c2ed435a5533719ee80647c7c3cae150e013c3

Просмотреть файл

@ -1,5 +1,5 @@
ifdef ENABLE_XAMARIN ifdef ENABLE_XAMARIN
NEEDED_MACCORE_VERSION := 5aca47d09bfd13f2cea370ac01dc2d9d371acb2c NEEDED_MACCORE_VERSION := d576fd8274e3fea113171bf7586175735b6dd42c
NEEDED_MACCORE_BRANCH := master NEEDED_MACCORE_BRANCH := master
MACCORE_DIRECTORY := maccore MACCORE_DIRECTORY := maccore

Просмотреть файл

@ -49,6 +49,11 @@ namespace Xamarin.Mac.Tasks
get; set; get; set;
} }
[Output]
public bool IsXcode8 {
get; set;
}
#endregion Outputs #endregion Outputs
public override bool Execute () public override bool Execute ()
@ -60,6 +65,8 @@ namespace Xamarin.Mac.Tasks
EnsureXamarinSdkRoot (); EnsureXamarinSdkRoot ();
EnsureSdkPath (); EnsureSdkPath ();
IsXcode8 = AppleSdkSettings.XcodeVersion.Major >= 8;
return !Log.HasLoggedErrors; return !Log.HasLoggedErrors;
} }

Просмотреть файл

@ -40,14 +40,28 @@ namespace Xamarin.Mac.Tasks
var sb = new StringBuilder (); var sb = new StringBuilder ();
if (isMobile) { if (isMobile) {
sb.Append (Path.Combine (FrameworkRoot, "lib", "bmac", "bmac-mobile.exe")); sb.Append (Path.Combine (FrameworkRoot, "lib", "bmac", "bmac-mobile.exe"));
sb.Append (" --target-framework=Xamarin.Mac,Version=v2.0,Profile=Mobile ");
} else { } else {
sb.Append (Path.Combine (FrameworkRoot, "lib", "bmac", "bmac-full.exe")); sb.Append (Path.Combine (FrameworkRoot, "lib", "bmac", "bmac-full.exe"));
sb.Append (" --target-framework=Xamarin.Mac,Version=v4.5,Profile=Full ");
} }
sb.Append ("-nostdlib "); sb.Append (" -nostdlib ");
sb.Append (base.GenerateCommandLineCommands ()); sb.Append (base.GenerateCommandLineCommands ());
return sb.ToString (); return sb.ToString ();
} }
protected override string GetTargetFrameworkArgument ()
{
switch (TargetFrameworkIdentifier) {
case null:
case "":
case "Xamarin.Mac":
return "/target-framework=Xamarin.Mac,Version=v2.0,Profile=Mobile";
case ".NETFramework":
return "/target-framework=Xamarin.Mac,Version=v4.5,Profile=Full";
default:
Log.LogError ($"Unknown target framework identifier: {TargetFrameworkIdentifier}.");
return string.Empty;
}
}
} }
} }

Просмотреть файл

@ -357,13 +357,21 @@ Copyright (C) 2014 Xamarin. All rights reserved.
<Target Name="_ForgeMetal" Condition="'$(_CanOutputAppBundle)' == 'true' And '@(_SmeltedMetal)' != ''" DependsOnTargets="_SmeltMetal" <Target Name="_ForgeMetal" Condition="'$(_CanOutputAppBundle)' == 'true' And '@(_SmeltedMetal)' != ''" DependsOnTargets="_SmeltMetal"
Inputs="@(_SmeltedMetal)" Outputs="$(IntermediateOutputPath)metal\default.metal-ar"> Inputs="@(_SmeltedMetal)" Outputs="$(IntermediateOutputPath)metal\default.metal-ar">
<ArTool <ArTool
Condition="'$(IsMacEnabled)' == 'true'" Condition="'$(IsMacEnabled)' == 'true' and '$(_IsXcode8)' == 'false'"
SessionId="$(BuildSessionId)" SessionId="$(BuildSessionId)"
Items="@(_SmeltedMetal)" Items="@(_SmeltedMetal)"
Archive="$(IntermediateOutputPath)metal\default.metal-ar"> Archive="$(IntermediateOutputPath)metal\default.metal-ar">
</ArTool> </ArTool>
<CreateItem Include="$(IntermediateOutputPath)metal\default.metal-ar"> <!-- If !Xcode8 -->
<CreateItem Include="$(IntermediateOutputPath)metal\default.metal-ar"
Condition="'$(_IsXcode8)' == 'false'">
<Output TaskParameter="Include" ItemName="_ForgedMetal" />
</CreateItem>
<!-- Else -->
<CreateItem Include="@(_SmeltedMetal)"
Condition="'$(_IsXcode8)' == 'true'">
<Output TaskParameter="Include" ItemName="_ForgedMetal" /> <Output TaskParameter="Include" ItemName="_ForgedMetal" />
</CreateItem> </CreateItem>
</Target> </Target>
@ -453,6 +461,7 @@ Copyright (C) 2014 Xamarin. All rights reserved.
<Output TaskParameter="SdkBinPath" PropertyName="_SdkBinPath" /> <Output TaskParameter="SdkBinPath" PropertyName="_SdkBinPath" />
<Output TaskParameter="SdkDevPath" PropertyName="_SdkDevPath" /> <Output TaskParameter="SdkDevPath" PropertyName="_SdkDevPath" />
<Output TaskParameter="SdkUsrPath" PropertyName="_SdkUsrPath" /> <Output TaskParameter="SdkUsrPath" PropertyName="_SdkUsrPath" />
<Output TaskParameter="IsXcode8" PropertyName="_IsXcode8" />
</DetectSdkLocations> </DetectSdkLocations>
</Target> </Target>

Просмотреть файл

@ -51,6 +51,11 @@ namespace Xamarin.MacDev.Tasks
log.LogMessage (TaskPropertyImportance, " {0}: {1}", propertyName, value); log.LogMessage (TaskPropertyImportance, " {0}: {1}", propertyName, value);
} }
public static void LogTaskProperty (this TaskLoggingHelper log, string propertyName, int value)
{
log.LogMessage (TaskPropertyImportance, " {0}: {1}", propertyName, value);
}
public static void LogTaskName (this TaskLoggingHelper log, string taskName) public static void LogTaskName (this TaskLoggingHelper log, string taskName)
{ {
log.LogMessage (TaskPropertyImportance, "{0} Task", taskName); log.LogMessage (TaskPropertyImportance, "{0} Task", taskName);

Просмотреть файл

@ -33,7 +33,7 @@ namespace Xamarin.MacDev
try { try {
buffer = Marshal.AllocHGlobal (PATHMAX); buffer = Marshal.AllocHGlobal (PATHMAX);
var result = realpath (path, buffer); var result = realpath (path, buffer);
return result == IntPtr.Zero ? "" : Marshal.PtrToStringAuto (buffer); return result == IntPtr.Zero ? path : Marshal.PtrToStringAuto (buffer);
} finally { } finally {
if (buffer != IntPtr.Zero) if (buffer != IntPtr.Zero)
Marshal.FreeHGlobal (buffer); Marshal.FreeHGlobal (buffer);
@ -42,7 +42,7 @@ namespace Xamarin.MacDev
public static string AbsoluteToRelative (string baseDirectory, string absolute) public static string AbsoluteToRelative (string baseDirectory, string absolute)
{ {
if (!Path.IsPathRooted (absolute) || string.IsNullOrEmpty (baseDirectory)) if (string.IsNullOrEmpty (baseDirectory))
return absolute; return absolute;
// canonicalize the paths // canonicalize the paths

Просмотреть файл

@ -183,19 +183,23 @@ namespace Xamarin.MacDev.Tasks {
if (GeneratedSourcesFileList != null) if (GeneratedSourcesFileList != null)
cmd.AppendSwitchIfNotNull ("/sourceonly:", Path.GetFullPath (GeneratedSourcesFileList)); cmd.AppendSwitchIfNotNull ("/sourceonly:", Path.GetFullPath (GeneratedSourcesFileList));
cmd.AppendSwitch (GetTargetFrameworkArgument ());
return cmd.ToString ();
}
protected virtual string GetTargetFrameworkArgument ()
{
switch (TargetFrameworkIdentifier) { switch (TargetFrameworkIdentifier) {
case "MonoTouch": case "MonoTouch":
case "Xamarin.iOS": case "Xamarin.iOS":
case "Xamarin.TVOS": case "Xamarin.TVOS":
case "Xamarin.WatchOS": case "Xamarin.WatchOS":
cmd.AppendSwitch ($"/target-framework={TargetFrameworkIdentifier},v1.0"); return $"/target-framework={TargetFrameworkIdentifier},v1.0";
break;
default: default:
Log.LogError ($"Unknown target framework identifier: {TargetFrameworkIdentifier}."); Log.LogError ($"Unknown target framework identifier: {TargetFrameworkIdentifier}.");
break; return string.Empty;
} }
return cmd.ToString ();
} }
public override bool Execute () public override bool Execute ()

Просмотреть файл

@ -177,16 +177,21 @@ namespace Xamarin.MacDev.Tasks
} }
if (exitCode != 0) { if (exitCode != 0) {
// Note: ibtool or actool exited with an error. Dump everything we can to help the user
// diagnose the issue and then delete the manifest log file so that rebuilding tries
// again (in case of ibtool's infamous spurious errors).
if (errors.Length > 0) if (errors.Length > 0)
Log.LogError (null, null, null, items[0].ItemSpec, 0, 0, 0, 0, "{0}", errors); Log.LogError (null, null, null, items[0].ItemSpec, 0, 0, 0, 0, "{0}", errors);
Log.LogError ("{0} exited with code {1}", ToolName, exitCode);
// Note: If the log file exists and is parseable, log those warnings/errors as well...
if (File.Exists (manifest.ItemSpec)) { if (File.Exists (manifest.ItemSpec)) {
try { try {
var plist = PDictionary.FromFile (manifest.ItemSpec); var plist = PDictionary.FromFile (manifest.ItemSpec);
LogWarningsAndErrors (plist, items[0]); LogWarningsAndErrors (plist, items[0]);
} catch (FormatException) { } catch (FormatException) {
Log.LogError ("{0} exited with code {1}", ToolName, exitCode);
} }
File.Delete (manifest.ItemSpec); File.Delete (manifest.ItemSpec);

Просмотреть файл

@ -1,6 +1,22 @@
namespace Microsoft.Build.Tasks using Xamarin.MacDev.Tasks;
namespace Microsoft.Build.Tasks
{ {
public class Copy : CopyBase public class Copy : CopyBase
{ {
public override bool Execute ()
{
Log.LogTaskName ("Copy");
Log.LogTaskProperty ("DestinationFiles", DestinationFiles);
Log.LogTaskProperty ("DestinationFolder", DestinationFolder);
Log.LogTaskProperty ("OverwriteReadOnlyFiles", OverwriteReadOnlyFiles);
Log.LogTaskProperty ("Retries", Retries);
Log.LogTaskProperty ("RetryDelayMilliseconds", RetryDelayMilliseconds);
Log.LogTaskProperty ("SkipUnchangedFiles", SkipUnchangedFiles);
Log.LogTaskProperty ("SourceFiles", SourceFiles);
Log.LogTaskProperty ("UseHardlinksIfPossible", UseHardlinksIfPossible);
return base.Execute ();
}
} }
} }

Просмотреть файл

@ -1,6 +1,16 @@
namespace Microsoft.Build.Tasks using Xamarin.MacDev.Tasks;
namespace Microsoft.Build.Tasks
{ {
public class Delete : DeleteBase public class Delete : DeleteBase
{ {
public override bool Execute ()
{
Log.LogTaskName ("Delete");
Log.LogTaskProperty ("Files", Files);
Log.LogTaskProperty ("TreatErrorsAsWarnings", TreatErrorsAsWarnings);
return base.Execute ();
}
} }
} }

Просмотреть файл

@ -1,6 +1,22 @@
namespace Microsoft.Build.Tasks using Xamarin.MacDev.Tasks;
namespace Microsoft.Build.Tasks
{ {
public class Exec : ExecBase public class Exec : ExecBase
{ {
public override bool Execute ()
{
Log.LogTaskName ("Exec");
Log.LogTaskProperty ("Command", Command);
Log.LogTaskProperty ("CustomErrorRegularExpression", CustomErrorRegularExpression);
Log.LogTaskProperty ("CustomWarningRegularExpression", CustomWarningRegularExpression);
Log.LogTaskProperty ("IgnoreExitCode", IgnoreExitCode);
Log.LogTaskProperty ("IgnoreStandardErrorWarningFormat", IgnoreStandardErrorWarningFormat);
Log.LogTaskProperty ("StdErrEncoding", StdErrEncoding);
Log.LogTaskProperty ("StdOutEncoding", StdOutEncoding);
Log.LogTaskProperty ("WorkingDirectory", WorkingDirectory);
return base.Execute ();
}
} }
} }

Просмотреть файл

@ -1,6 +1,15 @@
namespace Microsoft.Build.Tasks using Xamarin.MacDev.Tasks;
namespace Microsoft.Build.Tasks
{ {
public class MakeDir : MakeDirBase public class MakeDir : MakeDirBase
{ {
public override bool Execute ()
{
Log.LogTaskName ("MakeDir");
Log.LogTaskProperty ("Directories", Directories);
return base.Execute ();
}
} }
} }

Просмотреть файл

@ -1,6 +1,17 @@
namespace Microsoft.Build.Tasks using Xamarin.MacDev.Tasks;
namespace Microsoft.Build.Tasks
{ {
public class Move : MoveTaskBase public class Move : MoveTaskBase
{ {
public override bool Execute ()
{
Log.LogTaskName ("Move");
Log.LogTaskProperty ("DestinationFiles", DestinationFiles);
Log.LogTaskProperty ("DestinationFolder", DestinationFolder);
Log.LogTaskProperty ("SourceFiles", SourceFiles);
return base.Execute ();
}
} }
} }

Просмотреть файл

@ -1,6 +1,15 @@
using Xamarin.MacDev.Tasks;
namespace Microsoft.Build.Tasks namespace Microsoft.Build.Tasks
{ {
public class RemoveDir : RemoveDirBase public class RemoveDir : RemoveDirBase
{ {
public override bool Execute ()
{
Log.LogTaskName ("RemoveDir");
Log.LogTaskProperty ("Directories", Directories);
return base.Execute ();
}
} }
} }

Просмотреть файл

@ -1,6 +1,18 @@
namespace Microsoft.Build.Tasks using Xamarin.MacDev.Tasks;
namespace Microsoft.Build.Tasks
{ {
public class Touch : TouchBase public class Touch : TouchBase
{ {
public override bool Execute ()
{
Log.LogTaskName ("Touch");
Log.LogTaskProperty ("AlwaysCreate", AlwaysCreate);
Log.LogTaskProperty ("Files", Files);
Log.LogTaskProperty ("ForceTouch", ForceTouch);
Log.LogTaskProperty ("Time", Time);
return base.Execute ();
}
} }
} }

Просмотреть файл

@ -69,6 +69,11 @@ namespace Xamarin.iOS.Tasks
get; set; get; set;
} }
[Output]
public bool IsXcode8 {
get; set;
}
#endregion Outputs #endregion Outputs
public PlatformFramework Framework { public PlatformFramework Framework {
@ -92,6 +97,8 @@ namespace Xamarin.iOS.Tasks
SdkIsSimulator = (architectures & (TargetArchitecture.i386 | TargetArchitecture.x86_64)) != 0; SdkIsSimulator = (architectures & (TargetArchitecture.i386 | TargetArchitecture.x86_64)) != 0;
IsXcode8 = AppleSdkSettings.XcodeVersion.Major >= 8;
EnsureAppleSdkRoot (); EnsureAppleSdkRoot ();
EnsureXamarinSdkRoot (); EnsureXamarinSdkRoot ();
switch (Framework) { switch (Framework) {

Просмотреть файл

@ -605,7 +605,7 @@ namespace Xamarin.iOS.Tasks
args.Add ("--target-framework"); args.Add ("--target-framework");
args.Add (TargetFrameworkIdentifier + "," + TargetFrameworkVersion); args.Add (TargetFrameworkIdentifier + "," + TargetFrameworkVersion);
args.AddQuoted (MainAssembly.ItemSpec); args.AddQuoted (Path.GetFullPath (MainAssembly.ItemSpec));
// We give the priority to the ExtraArgs to set the mtouch verbosity. // 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"))) if (string.IsNullOrEmpty (ExtraArgs) || (!string.IsNullOrEmpty (ExtraArgs) && !ExtraArgs.Contains ("-q") && !ExtraArgs.Contains ("-v")))

Просмотреть файл

@ -533,12 +533,20 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
Inputs="@(_SmeltedMetal)" Outputs="$(DeviceSpeficicIntermediateOutputPath)metal\default.metal-ar"> Inputs="@(_SmeltedMetal)" Outputs="$(DeviceSpeficicIntermediateOutputPath)metal\default.metal-ar">
<ArTool <ArTool
SessionId="$(BuildSessionId)" SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' == 'true'" Condition="'$(IsMacEnabled)' == 'true' and '$(_IsXcode8)' == 'false'"
Items="@(_SmeltedMetal)" Items="@(_SmeltedMetal)"
Archive="$(DeviceSpecificIntermediateOutputPath)metal\default.metal-ar"> Archive="$(DeviceSpecificIntermediateOutputPath)metal\default.metal-ar">
</ArTool> </ArTool>
<CreateItem Include="$(DeviceSpecificIntermediateOutputPath)metal\default.metal-ar"> <!-- If !Xcode8 -->
<CreateItem Include="$(DeviceSpecificIntermediateOutputPath)metal\default.metal-ar"
Condition="'$(_IsXcode8)' == 'false'">
<Output TaskParameter="Include" ItemName="_ForgedMetal" />
</CreateItem>
<!-- Else -->
<CreateItem Include="@(_SmeltedMetal)"
Condition="'$(_IsXcode8)' == 'true'">
<Output TaskParameter="Include" ItemName="_ForgedMetal" /> <Output TaskParameter="Include" ItemName="_ForgedMetal" />
</CreateItem> </CreateItem>
</Target> </Target>
@ -593,6 +601,7 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
<Output TaskParameter="SdkUsrPath" PropertyName="_SdkUsrPath" /> <Output TaskParameter="SdkUsrPath" PropertyName="_SdkUsrPath" />
<Output TaskParameter="SdkPlatform" PropertyName="_SdkPlatform" /> <Output TaskParameter="SdkPlatform" PropertyName="_SdkPlatform" />
<Output TaskParameter="SdkIsSimulator" PropertyName="_SdkIsSimulator" /> <Output TaskParameter="SdkIsSimulator" PropertyName="_SdkIsSimulator" />
<Output TaskParameter="IsXcode8" PropertyName="_IsXcode8" />
</DetectSdkLocations> </DetectSdkLocations>
</Target> </Target>

Просмотреть файл

@ -561,8 +561,11 @@ void monotouch_configure_debugging ()
#if MONOTOUCH && (defined(__i386__) || defined (__x86_64__)) #if MONOTOUCH && (defined(__i386__) || defined (__x86_64__))
// Try to read shared memory as well // Try to read shared memory as well
key_t shmkey = ftok ("/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch", 0); key_t shmkey;
if (shmkey == -1) { if (!xamarin_is_extension) {
// Don't read shared memory in normal apps, because we're always able to pass
// the debug data (host/port) using either command-line arguments or environment variables
} else if ((shmkey = ftok ("/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch", 0)) == -1) {
LOG (PRODUCT ": Could not create shared memory key: %s\n", strerror (errno)); LOG (PRODUCT ": Could not create shared memory key: %s\n", strerror (errno));
} else { } else {
int shmsize = 1024; int shmsize = 1024;

Просмотреть файл

@ -0,0 +1,23 @@
using XamCore.Foundation;
namespace XamCore.NetworkExtension {
// needed for generated Async support
//public delegate void NEPacketTunnelFlowReadHandler (NSData [] packets, NSNumber [] protocols);
// avoid generator default `Arg1` and `Arg2` since Action<> was used
public class NEPacketTunnelFlowReadResult {
#if !COREBUILD
public NEPacketTunnelFlowReadResult (NSData [] packets, NSNumber [] protocols)
{
Packets = packets;
Protocols = protocols;
}
public NSData [] Packets { get; set; }
public NSNumber [] Protocols { get; set; }
#endif
}
}

Просмотреть файл

@ -0,0 +1,21 @@
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;
namespace XamCore.TVMLKit {
public class TVViewElementDispatchResult {
#if !COREBUILD
public TVViewElementDispatchResult (bool isDispatched, bool isCancelled)
{
IsDispatched = isDispatched;
IsCancelled = isCancelled;
}
public bool IsDispatched { get; set; }
public bool IsCancelled { get; set; }
#endif
}
}

Просмотреть файл

@ -10,6 +10,7 @@ using XamCore.UIKit;
namespace XamCore.WatchKit { namespace XamCore.WatchKit {
#if !COREBUILD
public partial class WKInterfaceController { public partial class WKInterfaceController {
public void PushController (string name, string context) public void PushController (string name, string context)
@ -92,6 +93,21 @@ namespace XamCore.WatchKit {
Runtime.ConnectMethod (mi, sel); Runtime.ConnectMethod (mi, sel);
} }
} }
#endif
public class WKPresentMediaPlayerResult {
#if !COREBUILD
public WKPresentMediaPlayerResult (bool didPlayToEnd, double /* NSTimeInterval */ endTime)
{
DidPlayToEnd = didPlayToEnd;
EndTime = endTime;
}
public bool DidPlayToEnd { get; set; }
public double EndTime { get; set; }
#endif
}
} }
#endif // WATCH || IOS #endif // WATCH || IOS

Просмотреть файл

@ -81,6 +81,7 @@ namespace XamCore.AudioUnit {
[Static] [Static]
[Export ("instantiateWithComponentDescription:options:completionHandler:")] [Export ("instantiateWithComponentDescription:options:completionHandler:")]
[Async]
void FromComponentDescription (AudioComponentDescription componentDescription, AudioComponentInstantiationOptions options, Action<AUAudioUnit, NSError> completionHandler); void FromComponentDescription (AudioComponentDescription componentDescription, AudioComponentInstantiationOptions options, Action<AUAudioUnit, NSError> completionHandler);
[Export ("componentDescription")] [Export ("componentDescription")]

Просмотреть файл

@ -1267,15 +1267,19 @@ namespace XamCore.AVFoundation {
[Export ("playing")] [Export ("playing")]
bool Playing { [Bind ("isPlaying")] get; } bool Playing { [Bind ("isPlaying")] get; }
[Async]
[Export ("scheduleBuffer:completionHandler:")] [Export ("scheduleBuffer:completionHandler:")]
void ScheduleBuffer (AVAudioPcmBuffer buffer, [NullAllowed] Action completionHandler); void ScheduleBuffer (AVAudioPcmBuffer buffer, [NullAllowed] Action completionHandler);
[Async]
[Export ("scheduleBuffer:atTime:options:completionHandler:")] [Export ("scheduleBuffer:atTime:options:completionHandler:")]
void ScheduleBuffer (AVAudioPcmBuffer buffer, [NullAllowed] AVAudioTime when, AVAudioPlayerNodeBufferOptions options, [NullAllowed] Action completionHandler); void ScheduleBuffer (AVAudioPcmBuffer buffer, [NullAllowed] AVAudioTime when, AVAudioPlayerNodeBufferOptions options, [NullAllowed] Action completionHandler);
[Async]
[Export ("scheduleFile:atTime:completionHandler:")] [Export ("scheduleFile:atTime:completionHandler:")]
void ScheduleFile (AVAudioFile file, [NullAllowed] AVAudioTime when, [NullAllowed] Action completionHandler); void ScheduleFile (AVAudioFile file, [NullAllowed] AVAudioTime when, [NullAllowed] Action completionHandler);
[Async]
[Export ("scheduleSegment:startingFrame:frameCount:atTime:completionHandler:")] [Export ("scheduleSegment:startingFrame:frameCount:atTime:completionHandler:")]
void ScheduleSegment (AVAudioFile file, long startFrame, uint /* AVAudioFrameCount = uint32_t */ numberFrames, [NullAllowed] AVAudioTime when, [NullAllowed] Action completionHandler); void ScheduleSegment (AVAudioFile file, long startFrame, uint /* AVAudioFrameCount = uint32_t */ numberFrames, [NullAllowed] AVAudioTime when, [NullAllowed] Action completionHandler);
@ -2071,6 +2075,7 @@ namespace XamCore.AVFoundation {
[iOS (9,0), Mac (10,11)] [iOS (9,0), Mac (10,11)]
[Static] [Static]
[Export ("instantiateWithComponentDescription:options:completionHandler:")] [Export ("instantiateWithComponentDescription:options:completionHandler:")]
[Async]
void FromComponentDescription (AudioComponentDescription audioComponentDescription, AudioComponentInstantiationOptions options, Action<AVAudioUnit, NSError> completionHandler); void FromComponentDescription (AudioComponentDescription audioComponentDescription, AudioComponentInstantiationOptions options, Action<AVAudioUnit, NSError> completionHandler);
[iOS (9,0), Mac (10,11, onlyOn64 : true)] [iOS (9,0), Mac (10,11, onlyOn64 : true)]

Просмотреть файл

@ -69,15 +69,19 @@ namespace XamCore.CoreSpotlight {
#endif #endif
[Export ("indexSearchableItems:completionHandler:")] [Export ("indexSearchableItems:completionHandler:")]
[Async]
void Index (CSSearchableItem [] items, [NullAllowed] Action<NSError> completionHandler); void Index (CSSearchableItem [] items, [NullAllowed] Action<NSError> completionHandler);
[Export ("deleteSearchableItemsWithIdentifiers:completionHandler:")] [Export ("deleteSearchableItemsWithIdentifiers:completionHandler:")]
[Async]
void Delete (string [] identifiers, [NullAllowed] Action<NSError> completionHandler); void Delete (string [] identifiers, [NullAllowed] Action<NSError> completionHandler);
[Export ("deleteSearchableItemsWithDomainIdentifiers:completionHandler:")] [Export ("deleteSearchableItemsWithDomainIdentifiers:completionHandler:")]
[Async]
void DeleteWithDomain (string [] domainIdentifiers, [NullAllowed] Action<NSError> completionHandler); void DeleteWithDomain (string [] domainIdentifiers, [NullAllowed] Action<NSError> completionHandler);
[Export ("deleteAllSearchableItemsWithCompletionHandler:")] [Export ("deleteAllSearchableItemsWithCompletionHandler:")]
[Async]
void DeleteAll ([NullAllowed] Action<NSError> completionHandler); void DeleteAll ([NullAllowed] Action<NSError> completionHandler);
} }

Просмотреть файл

@ -74,6 +74,7 @@ using ProductException=BindingException;
// BI1051 Internal error: Don't know how to get attributes for {0}. Please file a bug report (http://bugzilla.xamarin.com) with a test case. // BI1051 Internal error: Don't know how to get attributes for {0}. Please file a bug report (http://bugzilla.xamarin.com) with a test case.
// BI1052 Internal error: Could not find the type {0} in the assembly {1}. Please file a bug report (http://bugzilla.xamarin.com) with a test case. // BI1052 Internal error: Could not find the type {0} in the assembly {1}. Please file a bug report (http://bugzilla.xamarin.com) with a test case.
// BI1053 Internal error: unknown target framework '{0}'. // BI1053 Internal error: unknown target framework '{0}'.
// BI1060 The {0} protocol is decorated with [Model], but not [BaseType]. Please verify that [Model] is relevant for this protocol; if so, add [BaseType] as well, otherwise remove [Model].
// BI11xx warnings // BI11xx warnings
// BI1101 Trying to use a string as a [Target] // BI1101 Trying to use a string as a [Target]
// BI1102 Using the deprecated EventArgs for a delegate signature in {0}.{1}, please use DelegateName instead // BI1102 Using the deprecated EventArgs for a delegate signature in {0}.{1}, please use DelegateName instead

Просмотреть файл

@ -3338,6 +3338,7 @@ namespace XamCore.Foundation
[Export ("inputItems", ArgumentSemantic.Copy)] [Export ("inputItems", ArgumentSemantic.Copy)]
NSExtensionItem [] InputItems { get; } NSExtensionItem [] InputItems { get; }
[Async]
[Export ("completeRequestReturningItems:completionHandler:")] [Export ("completeRequestReturningItems:completionHandler:")]
void CompleteRequest (NSExtensionItem [] returningItems, [NullAllowed] Action<bool> completionHandler); void CompleteRequest (NSExtensionItem [] returningItems, [NullAllowed] Action<bool> completionHandler);
@ -5734,6 +5735,7 @@ namespace XamCore.Foundation
NSString ChangedNotification { get; } NSString ChangedNotification { get; }
[iOS (8,0), Mac (10,10)] [iOS (8,0), Mac (10,10)]
[Async]
[Export ("getCredentialsForProtectionSpace:task:completionHandler:")] [Export ("getCredentialsForProtectionSpace:task:completionHandler:")]
void GetCredentials (NSUrlProtectionSpace protectionSpace, NSUrlSessionTask task, [NullAllowed] Action<NSDictionary> completionHandler); void GetCredentials (NSUrlProtectionSpace protectionSpace, NSUrlSessionTask task, [NullAllowed] Action<NSDictionary> completionHandler);
@ -5746,6 +5748,7 @@ namespace XamCore.Foundation
void RemoveCredential (NSUrlCredential credential, NSUrlProtectionSpace protectionSpace, NSDictionary options, NSUrlSessionTask task); void RemoveCredential (NSUrlCredential credential, NSUrlProtectionSpace protectionSpace, NSDictionary options, NSUrlSessionTask task);
[iOS (8,0), Mac (10,10)] [iOS (8,0), Mac (10,10)]
[Async]
[Export ("getDefaultCredentialForProtectionSpace:task:completionHandler:")] [Export ("getDefaultCredentialForProtectionSpace:task:completionHandler:")]
void GetDefaultCredential (NSUrlProtectionSpace space, NSUrlSessionTask task, [NullAllowed] Action<NSUrlCredential> completionHandler); void GetDefaultCredential (NSUrlProtectionSpace space, NSUrlSessionTask task, [NullAllowed] Action<NSUrlCredential> completionHandler);
@ -8233,6 +8236,7 @@ namespace XamCore.Foundation
#if !MONOMAC || XAMCORE_2_0 #if !MONOMAC || XAMCORE_2_0
[Mac (10,10)][iOS (8,0)] [Mac (10,10)][iOS (8,0)]
[Async]
[Export ("getCookiesForTask:completionHandler:")] [Export ("getCookiesForTask:completionHandler:")]
void GetCookiesForTask (NSUrlSessionTask task, Action<NSHttpCookie []> completionHandler); void GetCookiesForTask (NSUrlSessionTask task, Action<NSHttpCookie []> completionHandler);
@ -8724,6 +8728,7 @@ namespace XamCore.Foundation
[Export ("hasItemConformingToTypeIdentifier:")] [Export ("hasItemConformingToTypeIdentifier:")]
bool HasItemConformingTo (string typeIdentifier); bool HasItemConformingTo (string typeIdentifier);
[Async]
[Export ("loadItemForTypeIdentifier:options:completionHandler:")] [Export ("loadItemForTypeIdentifier:options:completionHandler:")]
void LoadItem (string typeIdentifier, [NullAllowed] NSDictionary options, [NullAllowed] Action<NSObject,NSError> completionHandler); void LoadItem (string typeIdentifier, [NullAllowed] NSDictionary options, [NullAllowed] Action<NSObject,NSError> completionHandler);
@ -8733,6 +8738,7 @@ namespace XamCore.Foundation
[Export ("setPreviewImageHandler:")] [Export ("setPreviewImageHandler:")]
void SetPreviewImageHandler (NSItemProviderLoadHandler handler); void SetPreviewImageHandler (NSItemProviderLoadHandler handler);
[Async]
[Export ("loadPreviewImageWithOptions:completionHandler:")] [Export ("loadPreviewImageWithOptions:completionHandler:")]
void LoadPreviewImage (NSDictionary options, Action<NSObject,NSError> completionHandler); void LoadPreviewImage (NSDictionary options, Action<NSObject,NSError> completionHandler);
@ -11151,6 +11157,7 @@ namespace XamCore.Foundation
[Mac (10,10)] [Mac (10,10)]
[iOS (8,0)] [iOS (8,0)]
[Static] [Static]
[Async]
[Export ("getNonlocalVersionsOfItemAtURL:completionHandler:")] [Export ("getNonlocalVersionsOfItemAtURL:completionHandler:")]
void GetNonlocalVersions (NSUrl url, NSFileVersionNonlocalVersionsCompletionHandler completionHandler); void GetNonlocalVersions (NSUrl url, NSFileVersionNonlocalVersionsCompletionHandler completionHandler);

Просмотреть файл

@ -976,6 +976,7 @@ NETWORKEXTENSION_API_SOURCES = \
NETWORKEXTENSION_CORE_SOURCES = \ NETWORKEXTENSION_CORE_SOURCES = \
NetworkExtension/NEHotspotHelperOptions.cs \ NetworkExtension/NEHotspotHelperOptions.cs \
NetworkExtension/NEPacketTunnelFlow.cs \
NetworkExtension/NEVpnConnectionStartOptions.cs \ NetworkExtension/NEVpnConnectionStartOptions.cs \
NETWORKEXTENSION_SOURCES = \ NETWORKEXTENSION_SOURCES = \
@ -1245,7 +1246,8 @@ SYSTEMCONFIGURATION_SOURCES = \
# TVMLKit # TVMLKit
TVMLKIT_CORE_SOURCES = TVMLKIT_CORE_SOURCES = \
TVMLKit/TVViewElement.cs \
# TVServices # TVServices
@ -1386,9 +1388,11 @@ WATCHCONNECTIVITY_CORE_SOURCES = \
WATCHKIT_API_SOURCES = \ WATCHKIT_API_SOURCES = \
WatchKit/WKDefs.cs \ WatchKit/WKDefs.cs \
WATCHKIT_CORE_SOURCES = \
WatchKit/WKInterfaceController.cs \
WATCHKIT_SOURCES = \ WATCHKIT_SOURCES = \
WatchKit/WKAccessibility.cs \ WatchKit/WKAccessibility.cs \
WatchKit/WKInterfaceController.cs \
WatchKit/WKInterfaceDevice.cs \ WatchKit/WKInterfaceDevice.cs \
# WebKit (Mac version) # WebKit (Mac version)

Просмотреть файл

@ -280,6 +280,7 @@ namespace XamCore.GameController {
GCController [] Controllers { get; } GCController [] Controllers { get; }
[Static, Export ("startWirelessControllerDiscoveryWithCompletionHandler:")] [Static, Export ("startWirelessControllerDiscoveryWithCompletionHandler:")]
[Async]
void StartWirelessControllerDiscovery ([NullAllowed] Action completionHandler); void StartWirelessControllerDiscovery ([NullAllowed] Action completionHandler);
[Static, Export ("stopWirelessControllerDiscovery")] [Static, Export ("stopWirelessControllerDiscovery")]

Просмотреть файл

@ -773,6 +773,7 @@ namespace XamCore.GameKit {
void UnregisterAllListeners (); void UnregisterAllListeners ();
[iOS (7,0), Mac (10,10)] [iOS (7,0), Mac (10,10)]
[Async (ResultTypeName = "GKIdentityVerificationSignatureResult")]
[Export ("generateIdentityVerificationSignatureWithCompletionHandler:")] [Export ("generateIdentityVerificationSignatureWithCompletionHandler:")]
void GenerateIdentityVerificationSignature ([NullAllowed] GKIdentityVerificationSignatureHandler completionHandler); void GenerateIdentityVerificationSignature ([NullAllowed] GKIdentityVerificationSignatureHandler completionHandler);
@ -897,6 +898,7 @@ namespace XamCore.GameKit {
[iOS (8,0), Mac (10,10)] [iOS (8,0), Mac (10,10)]
[Export ("chooseBestHostingPlayerWithCompletionHandler:")] [Export ("chooseBestHostingPlayerWithCompletionHandler:")]
[Async]
void ChooseBestHostingPlayer (Action<GKPlayer> completionHandler); void ChooseBestHostingPlayer (Action<GKPlayer> completionHandler);
[iOS (8,0), Mac(10,10)] [iOS (8,0), Mac(10,10)]

Просмотреть файл

@ -1098,7 +1098,6 @@ public partial class Generator : IMemberGatherer {
throw new BindingException (1017, true, "Do not know how to make a signature for {0}", mai.Type); throw new BindingException (1017, true, "Do not know how to make a signature for {0}", mai.Type);
} }
static HashSet<Type> missing_base_type_warning_shown = new HashSet<Type> ();
static bool IsProtocolInterface (Type type, bool checkPrefix = true) static bool IsProtocolInterface (Type type, bool checkPrefix = true)
{ {
// for subclassing the type (from the binding files) is not yet prefixed by an `I` // for subclassing the type (from the binding files) is not yet prefixed by an `I`
@ -5451,12 +5450,9 @@ public partial class Generator : IMemberGatherer {
if (is_protocol) { if (is_protocol) {
if (is_static_class) if (is_static_class)
throw new BindingException (1025, true, "[Static] and [Protocol] are mutually exclusive ({0})", type.FullName); throw new BindingException (1025, true, "[Static] and [Protocol] are mutually exclusive ({0})", type.FullName);
if (is_model && base_type == TypeManager.System_Object){ if (is_model && base_type == TypeManager.System_Object)
if (!missing_base_type_warning_shown.Contains (type)){ throw new BindingException (1060, true, "The {0} protocol is decorated with [Model], but not [BaseType]. Please verify that [Model] is relevant for this protocol; if so, add [BaseType] as well, otherwise remove [Model].", type.FullName);
missing_base_type_warning_shown.Add (type);
Console.WriteLine ("Warning, protocol {0} does not have a BaseType, wont generate the class, only the interface and extensions class", type.FullName);
}
}
var protocol = AttributeManager.GetCustomAttribute<ProtocolAttribute> (type); var protocol = AttributeManager.GetCustomAttribute<ProtocolAttribute> (type);
GenerateProtocolTypes (type, class_visibility, TypeName, protocol.Name ?? objc_type_name, protocol); GenerateProtocolTypes (type, class_visibility, TypeName, protocol.Name ?? objc_type_name, protocol);
} }

Просмотреть файл

@ -412,19 +412,23 @@ namespace XamCore.HealthKit {
HKBloodTypeObject GetBloodType (out NSError error); HKBloodTypeObject GetBloodType (out NSError error);
[NoWatch] [NoWatch]
[Async]
[Export ("enableBackgroundDeliveryForType:frequency:withCompletion:")] [Export ("enableBackgroundDeliveryForType:frequency:withCompletion:")]
void EnableBackgroundDelivery (HKObjectType type, HKUpdateFrequency frequency, Action<bool, NSError> completion); void EnableBackgroundDelivery (HKObjectType type, HKUpdateFrequency frequency, Action<bool, NSError> completion);
[NoWatch] [NoWatch]
[Async]
[Export ("disableBackgroundDeliveryForType:withCompletion:")] [Export ("disableBackgroundDeliveryForType:withCompletion:")]
void DisableBackgroundDelivery (HKObjectType type, Action<bool, NSError> completion); void DisableBackgroundDelivery (HKObjectType type, Action<bool, NSError> completion);
[NoWatch] [NoWatch]
[Async]
[Export ("disableAllBackgroundDeliveryWithCompletion:")] [Export ("disableAllBackgroundDeliveryWithCompletion:")]
void DisableAllBackgroundDelivery (Action<bool, NSError> completion); void DisableAllBackgroundDelivery (Action<bool, NSError> completion);
// FIXME NS_EXTENSION_UNAVAILABLE("Not available to extensions") ; // FIXME NS_EXTENSION_UNAVAILABLE("Not available to extensions") ;
[NoWatch] [NoWatch]
[Async]
[iOS (9,0)] [iOS (9,0)]
[Export ("handleAuthorizationForExtensionWithCompletion:")] [Export ("handleAuthorizationForExtensionWithCompletion:")]
void HandleAuthorizationForExtension (Action<bool, NSError> completion); void HandleAuthorizationForExtension (Action<bool, NSError> completion);

Просмотреть файл

@ -691,6 +691,7 @@ namespace XamCore.HomeKit {
[NoTV] [NoTV]
[NoWatch] [NoWatch]
[iOS (9,0)] [iOS (9,0)]
[Async]
[Export ("manageUsersWithCompletionHandler:")] [Export ("manageUsersWithCompletionHandler:")]
void ManageUsers (Action<NSError> completion); void ManageUsers (Action<NSError> completion);
@ -1128,6 +1129,7 @@ namespace XamCore.HomeKit {
[NoTV] [NoTV]
[NoWatch] [NoWatch]
[Async]
[Export ("updateTriggerValue:completionHandler:")] [Export ("updateTriggerValue:completionHandler:")]
void UpdateTriggerValue ([NullAllowed] INSCopying triggerValue, Action<NSError> completion); void UpdateTriggerValue ([NullAllowed] INSCopying triggerValue, Action<NSError> completion);
} }
@ -1182,16 +1184,19 @@ namespace XamCore.HomeKit {
[NoTV] [NoTV]
[NoWatch] [NoWatch]
[Async]
[Export ("addEvent:completionHandler:")] [Export ("addEvent:completionHandler:")]
void AddEvent (HMEvent @event, Action<NSError> completion); void AddEvent (HMEvent @event, Action<NSError> completion);
[NoTV] [NoTV]
[NoWatch] [NoWatch]
[Async]
[Export ("removeEvent:completionHandler:")] [Export ("removeEvent:completionHandler:")]
void RemoveEvent (HMEvent @event, Action<NSError> completion); void RemoveEvent (HMEvent @event, Action<NSError> completion);
[NoTV] [NoTV]
[NoWatch] [NoWatch]
[Async]
[Export ("updatePredicate:completionHandler:")] [Export ("updatePredicate:completionHandler:")]
void UpdatePredicate ([NullAllowed] NSPredicate predicate, Action<NSError> completion); void UpdatePredicate ([NullAllowed] NSPredicate predicate, Action<NSError> completion);
} }
@ -1233,6 +1238,7 @@ namespace XamCore.HomeKit {
[NoTV] [NoTV]
[NoWatch] [NoWatch]
[Async]
[Export ("updateRegion:completionHandler:")] [Export ("updateRegion:completionHandler:")]
void UpdateRegion (CLRegion region, Action<NSError> completion); void UpdateRegion (CLRegion region, Action<NSError> completion);
} }

Просмотреть файл

@ -263,6 +263,7 @@ namespace XamCore.iAd {
[iOS (9,0)] [iOS (9,0)]
[Export ("requestAttributionDetailsWithBlock:")] [Export ("requestAttributionDetailsWithBlock:")]
[Async]
void RequestAttributionDetails (Action<NSDictionary, NSError> completionHandler); void RequestAttributionDetails (Action<NSDictionary, NSError> completionHandler);
#if !XAMCORE_4_0 #if !XAMCORE_4_0

Просмотреть файл

@ -1246,11 +1246,9 @@ namespace XamCore.MapKit {
#endif #endif
interface MKLocalSearchRequest : NSCopying { interface MKLocalSearchRequest : NSCopying {
#if !XAMCORE_2_0 && !MONOMAC [TV (9,2)][NoWatch][iOS (9,3)][Mac (10,11,4, onlyOn64 : true)]
[TV (9,2)][NoWatch][iOS (9,3)]
[Export ("initWithCompletion:")] [Export ("initWithCompletion:")]
IntPtr Constructor (MKLocalSearchCompletion completion); IntPtr Constructor (MKLocalSearchCompletion completion);
#endif
[Export ("naturalLanguageQuery", ArgumentSemantic.Copy)] [Export ("naturalLanguageQuery", ArgumentSemantic.Copy)]
[NullAllowed] [NullAllowed]
@ -1302,6 +1300,7 @@ namespace XamCore.MapKit {
IntPtr Constructor (MKDirectionsRequest request); IntPtr Constructor (MKDirectionsRequest request);
[Export ("calculateDirectionsWithCompletionHandler:")] [Export ("calculateDirectionsWithCompletionHandler:")]
[Async]
void CalculateDirections (MKDirectionsHandler completionHandler); void CalculateDirections (MKDirectionsHandler completionHandler);
[Export ("cancel")] [Export ("cancel")]
@ -1311,6 +1310,7 @@ namespace XamCore.MapKit {
bool Calculating { [Bind ("isCalculating")] get; } bool Calculating { [Bind ("isCalculating")] get; }
[Export ("calculateETAWithCompletionHandler:")] [Export ("calculateETAWithCompletionHandler:")]
[Async]
void CalculateETA (MKETAHandler completionHandler); void CalculateETA (MKETAHandler completionHandler);
} }
@ -1533,9 +1533,11 @@ namespace XamCore.MapKit {
IntPtr Constructor (MKMapSnapshotOptions options); IntPtr Constructor (MKMapSnapshotOptions options);
[Export ("startWithCompletionHandler:")] [Export ("startWithCompletionHandler:")]
[Async]
void Start (MKMapSnapshotCompletionHandler completionHandler); void Start (MKMapSnapshotCompletionHandler completionHandler);
[Export ("startWithQueue:completionHandler:")] [Export ("startWithQueue:completionHandler:")]
[Async]
void Start (DispatchQueue queue, MKMapSnapshotCompletionHandler completionHandler); void Start (DispatchQueue queue, MKMapSnapshotCompletionHandler completionHandler);
[Export ("cancel")] [Export ("cancel")]

Просмотреть файл

@ -219,18 +219,21 @@ namespace XamCore.MetalKit {
void FromUrl (NSUrl url, [NullAllowed] NSDictionary options, MTKTextureLoaderCallback completionHandler); void FromUrl (NSUrl url, [NullAllowed] NSDictionary options, MTKTextureLoaderCallback completionHandler);
[Wrap ("FromUrl (url, options == null ? null : options.Dictionary, completionHandler)")] [Wrap ("FromUrl (url, options == null ? null : options.Dictionary, completionHandler)")]
[Async]
void FromUrl (NSUrl url, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderCallback completionHandler); void FromUrl (NSUrl url, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderCallback completionHandler);
[Export ("newTextureWithData:options:completionHandler:"), Internal] [Export ("newTextureWithData:options:completionHandler:"), Internal]
void FromData (NSData data, [NullAllowed] NSDictionary options, MTKTextureLoaderCallback completionHandler); void FromData (NSData data, [NullAllowed] NSDictionary options, MTKTextureLoaderCallback completionHandler);
[Wrap ("FromData (data, options == null ? null : options.Dictionary, completionHandler)")] [Wrap ("FromData (data, options == null ? null : options.Dictionary, completionHandler)")]
[Async]
void FromData (NSData data, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderCallback completionHandler); void FromData (NSData data, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderCallback completionHandler);
[Export ("newTextureWithCGImage:options:completionHandler:"), Internal] [Export ("newTextureWithCGImage:options:completionHandler:"), Internal]
void FromCGImage (CGImage cgImage, [NullAllowed] NSDictionary options, MTKTextureLoaderCallback completionHandler); void FromCGImage (CGImage cgImage, [NullAllowed] NSDictionary options, MTKTextureLoaderCallback completionHandler);
[Wrap ("FromCGImage (cgImage, options == null ? null : options.Dictionary, completionHandler)")] [Wrap ("FromCGImage (cgImage, options == null ? null : options.Dictionary, completionHandler)")]
[Async]
void FromCGImage (CGImage cgImage, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderCallback completionHandler); void FromCGImage (CGImage cgImage, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderCallback completionHandler);
[Export ("newTextureWithContentsOfURL:options:error:"), Internal] [Export ("newTextureWithContentsOfURL:options:error:"), Internal]
@ -243,10 +246,12 @@ namespace XamCore.MetalKit {
[iOS (10,0)][Mac (10,12, onlyOn64 : true)] [iOS (10,0)][Mac (10,12, onlyOn64 : true)]
[Export ("newTexturesWithContentsOfURLs:options:completionHandler:")] [Export ("newTexturesWithContentsOfURLs:options:completionHandler:")]
[Async]
void FromUrls (NSUrl[] urls, [NullAllowed] NSDictionary options, MTKTextureLoaderArrayCallback completionHandler); void FromUrls (NSUrl[] urls, [NullAllowed] NSDictionary options, MTKTextureLoaderArrayCallback completionHandler);
[iOS (10,0)][Mac (10,12, onlyOn64 : true)] [iOS (10,0)][Mac (10,12, onlyOn64 : true)]
[Wrap ("FromUrls (urls, options == null ? null : options.Dictionary, completionHandler)")] [Wrap ("FromUrls (urls, options == null ? null : options.Dictionary, completionHandler)")]
[Async]
void FromUrls (NSUrl[] urls, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderArrayCallback completionHandler); void FromUrls (NSUrl[] urls, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderArrayCallback completionHandler);
[iOS (10,0)][Mac (10,12, onlyOn64 : true)] [iOS (10,0)][Mac (10,12, onlyOn64 : true)]
@ -275,18 +280,22 @@ namespace XamCore.MetalKit {
[iOS (10,0)][Mac (10,12, onlyOn64 : true)] [iOS (10,0)][Mac (10,12, onlyOn64 : true)]
[Export ("newTextureWithName:scaleFactor:bundle:options:completionHandler:")] [Export ("newTextureWithName:scaleFactor:bundle:options:completionHandler:")]
[Async]
void FromName (string name, nfloat scaleFactor, [NullAllowed] NSBundle bundle, [NullAllowed] NSDictionary options, MTKTextureLoaderCallback completionHandler); void FromName (string name, nfloat scaleFactor, [NullAllowed] NSBundle bundle, [NullAllowed] NSDictionary options, MTKTextureLoaderCallback completionHandler);
[iOS (10,0)][Mac (10,12, onlyOn64 : true)] [iOS (10,0)][Mac (10,12, onlyOn64 : true)]
[Wrap ("FromName (name, scaleFactor, bundle, options == null ? null : options.Dictionary, completionHandler)")] [Wrap ("FromName (name, scaleFactor, bundle, options == null ? null : options.Dictionary, completionHandler)")]
[Async]
void FromName (string name, nfloat scaleFactor, [NullAllowed] NSBundle bundle, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderCallback completionHandler); void FromName (string name, nfloat scaleFactor, [NullAllowed] NSBundle bundle, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderCallback completionHandler);
[iOS (10,0)][Mac (10,12, onlyOn64 : true)] [iOS (10,0)][Mac (10,12, onlyOn64 : true)]
[Export ("newTexturesWithNames:scaleFactor:bundle:options:completionHandler:")] [Export ("newTexturesWithNames:scaleFactor:bundle:options:completionHandler:")]
[Async]
void FromNames (string[] names, nfloat scaleFactor, [NullAllowed] NSBundle bundle, [NullAllowed] NSDictionary options, MTKTextureLoaderArrayCallback completionHandler); void FromNames (string[] names, nfloat scaleFactor, [NullAllowed] NSBundle bundle, [NullAllowed] NSDictionary options, MTKTextureLoaderArrayCallback completionHandler);
[iOS (10,0)][Mac (10,12, onlyOn64 : true)] [iOS (10,0)][Mac (10,12, onlyOn64 : true)]
[Wrap ("FromNames (names, scaleFactor, bundle, options == null ? null : options.Dictionary, completionHandler)")] [Wrap ("FromNames (names, scaleFactor, bundle, options == null ? null : options.Dictionary, completionHandler)")]
[Async]
void FromNames (string[] names, nfloat scaleFactor, [NullAllowed] NSBundle bundle, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderArrayCallback completionHandler); void FromNames (string[] names, nfloat scaleFactor, [NullAllowed] NSBundle bundle, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderArrayCallback completionHandler);
[iOS (10,0)][Mac (10,12, onlyOn64 : true)] [iOS (10,0)][Mac (10,12, onlyOn64 : true)]

Просмотреть файл

@ -627,6 +627,7 @@ namespace XamCore.NetworkExtension {
[iOS (10,0)][Mac (10,12, onlyOn64 : true)] [iOS (10,0)][Mac (10,12, onlyOn64 : true)]
[Export ("displayMessage:completionHandler:")] [Export ("displayMessage:completionHandler:")]
[Async]
void DisplayMessage (string message, Action<bool> completionHandler); void DisplayMessage (string message, Action<bool> completionHandler);
} }
@ -1321,6 +1322,7 @@ namespace XamCore.NetworkExtension {
[BaseType (typeof(NSObject))] [BaseType (typeof(NSObject))]
interface NEPacketTunnelFlow { interface NEPacketTunnelFlow {
[Export ("readPacketsWithCompletionHandler:")] [Export ("readPacketsWithCompletionHandler:")]
[Async (ResultType = typeof (NEPacketTunnelFlowReadResult))]
void ReadPackets (Action<NSData[], NSNumber[]> completionHandler); void ReadPackets (Action<NSData[], NSNumber[]> completionHandler);
[Export ("writePackets:withProtocols:")] [Export ("writePackets:withProtocols:")]

Просмотреть файл

@ -73,6 +73,7 @@ namespace XamCore.PassKit {
[Since (7,0)] [Since (7,0)]
[Export ("addPasses:withCompletionHandler:")] [Export ("addPasses:withCompletionHandler:")]
[Async]
void AddPasses (PKPass[] passes, [NullAllowed] Action<PKPassLibraryAddPassesStatus> completion); void AddPasses (PKPass[] passes, [NullAllowed] Action<PKPassLibraryAddPassesStatus> completion);
[Field ("PKPassLibraryDidChangeNotification")] [Field ("PKPassLibraryDidChangeNotification")]
@ -95,11 +96,13 @@ namespace XamCore.PassKit {
[NoWatch] [NoWatch]
[iOS (8,0)] [iOS (8,0)]
[Async]
[Export ("activatePaymentPass:withActivationData:completion:")] [Export ("activatePaymentPass:withActivationData:completion:")]
void ActivatePaymentPass (PKPaymentPass paymentPass, NSData activationData, [NullAllowed] Action<bool, NSError> completion); void ActivatePaymentPass (PKPaymentPass paymentPass, NSData activationData, [NullAllowed] Action<bool, NSError> completion);
[NoWatch] [NoWatch]
[iOS (8,0)] [iOS (8,0)]
[Async]
[Export ("activatePaymentPass:withActivationCode:completion:")] [Export ("activatePaymentPass:withActivationCode:completion:")]
void ActivatePaymentPass (PKPaymentPass paymentPass, string activationCode, [NullAllowed] Action<bool, NSError> completion); void ActivatePaymentPass (PKPaymentPass paymentPass, string activationCode, [NullAllowed] Action<bool, NSError> completion);

Просмотреть файл

@ -343,6 +343,7 @@ namespace XamCore.Photos
int RequestData (PHAssetResource forResource, [NullAllowed] PHAssetResourceRequestOptions options, Action<NSData> handler, Action<NSError> completionHandler); int RequestData (PHAssetResource forResource, [NullAllowed] PHAssetResourceRequestOptions options, Action<NSData> handler, Action<NSError> completionHandler);
[Export ("writeDataForAssetResource:toFile:options:completionHandler:")] [Export ("writeDataForAssetResource:toFile:options:completionHandler:")]
[Async]
void WriteData (PHAssetResource forResource, NSUrl fileURL, [NullAllowed] PHAssetResourceRequestOptions options, Action<NSError> completionHandler); void WriteData (PHAssetResource forResource, NSUrl fileURL, [NullAllowed] PHAssetResourceRequestOptions options, Action<NSError> completionHandler);
[Export ("cancelDataRequest:")] [Export ("cancelDataRequest:")]
@ -999,6 +1000,7 @@ namespace XamCore.Photos
[Async] [Async]
void RequestAuthorization (Action<PHAuthorizationStatus> handler); void RequestAuthorization (Action<PHAuthorizationStatus> handler);
// no [Async] since we're binding performChangesAndWait:error: too
[Export ("performChanges:completionHandler:")] [Export ("performChanges:completionHandler:")]
void PerformChanges (Action changeHandler, Action<bool, NSError> completionHandler); void PerformChanges (Action changeHandler, Action<bool, NSError> completionHandler);

Просмотреть файл

@ -2220,6 +2220,7 @@ namespace XamCore.SceneKit {
[Abstract] // this protocol existed before iOS 9 (or OSX 10.11) and we cannot add abstract members to it (breaking changes) [Abstract] // this protocol existed before iOS 9 (or OSX 10.11) and we cannot add abstract members to it (breaking changes)
#endif #endif
[iOS (9,0)][Mac (10,11, onlyOn64 : true)] // SKTransition -> SpriteKit -> only on 64 bits [iOS (9,0)][Mac (10,11, onlyOn64 : true)] // SKTransition -> SpriteKit -> only on 64 bits
[Async]
[Export ("presentScene:withTransition:incomingPointOfView:completionHandler:")] [Export ("presentScene:withTransition:incomingPointOfView:completionHandler:")]
void PresentScene (SCNScene scene, SKTransition transition, [NullAllowed] SCNNode pointOfView, [NullAllowed] Action completionHandler); void PresentScene (SCNScene scene, SKTransition transition, [NullAllowed] SCNNode pointOfView, [NullAllowed] Action completionHandler);
#endif #endif

Просмотреть файл

@ -217,6 +217,7 @@ namespace XamCore.SpriteKit {
[Export ("runAction:")] [Export ("runAction:")]
void RunAction (SKAction action); void RunAction (SKAction action);
[Async]
[Export ("runAction:completion:")] [Export ("runAction:completion:")]
void RunAction (SKAction action, Action completionHandler); void RunAction (SKAction action, Action completionHandler);

Просмотреть файл

@ -178,6 +178,7 @@ namespace XamCore.TVMLKit {
UINavigationController NavigationController { get; } UINavigationController NavigationController { get; }
[Export ("evaluateInJavaScriptContext:completion:")] [Export ("evaluateInJavaScriptContext:completion:")]
[Async]
void Evaluate (Action<JSContext> evaluation, [NullAllowed] Action<bool> completion); void Evaluate (Action<JSContext> evaluation, [NullAllowed] Action<bool> completion);
[Export ("stop")] [Export ("stop")]
@ -744,9 +745,11 @@ namespace XamCore.TVMLKit {
void Reset (TVElementResettableProperty resettableProperty); void Reset (TVElementResettableProperty resettableProperty);
[Export ("dispatchEventOfType:canBubble:cancellable:extraInfo:completion:")] [Export ("dispatchEventOfType:canBubble:cancellable:extraInfo:completion:")]
[Async (ResultType = typeof (TVViewElementDispatchResult))]
void DispatchEvent (TVElementEventType type, bool canBubble, bool isCancellable, [NullAllowed] NSDictionary<NSString, NSObject> extraInfo, [NullAllowed] Action<bool, bool> completion); void DispatchEvent (TVElementEventType type, bool canBubble, bool isCancellable, [NullAllowed] NSDictionary<NSString, NSObject> extraInfo, [NullAllowed] Action<bool, bool> completion);
[Export ("dispatchEventWithName:canBubble:cancellable:extraInfo:completion:")] [Export ("dispatchEventWithName:canBubble:cancellable:extraInfo:completion:")]
[Async (ResultType = typeof (TVViewElementDispatchResult))]
void DispatchEvent (string eventName, bool canBubble, bool isCancellable, [NullAllowed] NSDictionary<NSString, NSObject> extraInfo, [NullAllowed] Action<bool, bool> completion); void DispatchEvent (string eventName, bool canBubble, bool isCancellable, [NullAllowed] NSDictionary<NSString, NSObject> extraInfo, [NullAllowed] Action<bool, bool> completion);
} }

Просмотреть файл

@ -279,6 +279,7 @@ namespace XamCore.UIKit {
[NoWatch] [NoWatch]
[NoTV] [NoTV]
[iOS (8,0)] [iOS (8,0)]
[ThreadSafe]
[BaseType (typeof (NSObject))] [BaseType (typeof (NSObject))]
partial interface NSFileProviderExtension { partial interface NSFileProviderExtension {
[Static, Export ("writePlaceholderAtURL:withMetadata:error:")] [Static, Export ("writePlaceholderAtURL:withMetadata:error:")]
@ -2514,6 +2515,7 @@ namespace XamCore.UIKit {
[iOS (10,0), TV (10,0)] [iOS (10,0), TV (10,0)]
[Wrap ("OpenUrl (url, options?.Dictionary, completion)")] [Wrap ("OpenUrl (url, options?.Dictionary, completion)")]
[Async]
void OpenUrl (NSUrl url, UIApplicationOpenUrlOptions options, [NullAllowed] Action<bool> completion); void OpenUrl (NSUrl url, UIApplicationOpenUrlOptions options, [NullAllowed] Action<bool> completion);
[Export ("canOpenURL:")] [Export ("canOpenURL:")]
@ -14699,6 +14701,7 @@ namespace XamCore.UIKit {
UIPrinter FromUrl (NSUrl url); UIPrinter FromUrl (NSUrl url);
[Export ("contactPrinter:")] [Export ("contactPrinter:")]
[Async]
void ContactPrinter (UIPrinterContactPrinterHandler completionHandler); void ContactPrinter (UIPrinterContactPrinterHandler completionHandler);
} }
@ -15644,6 +15647,7 @@ namespace XamCore.UIKit {
NSObject WeakDelegate { get; set; } NSObject WeakDelegate { get; set; }
[Export ("addOptionWithTitle:image:order:handler:")] [Export ("addOptionWithTitle:image:order:handler:")]
[Async]
void AddOption (string title, [NullAllowed] UIImage image, UIDocumentMenuOrder order, Action completionHandler); void AddOption (string title, [NullAllowed] UIImage image, UIDocumentMenuOrder order, Action completionHandler);
} }
@ -15833,6 +15837,7 @@ namespace XamCore.UIKit {
[BaseType (typeof (NSObject))] [BaseType (typeof (NSObject))]
interface UIFocusAnimationCoordinator { interface UIFocusAnimationCoordinator {
[Export ("addCoordinatedAnimations:completion:")] [Export ("addCoordinatedAnimations:completion:")]
[Async]
void AddCoordinatedAnimations ([NullAllowed] Action animations, [NullAllowed] Action completion); void AddCoordinatedAnimations ([NullAllowed] Action animations, [NullAllowed] Action completion);
} }

Просмотреть файл

@ -145,10 +145,12 @@ namespace XamCore.WatchKit {
[ThreadSafe (false)] [ThreadSafe (false)]
[Export ("presentTextInputControllerWithSuggestions:allowedInputMode:completion:")] [Export ("presentTextInputControllerWithSuggestions:allowedInputMode:completion:")]
[Async]
void PresentTextInputController ([NullAllowed] string [] suggestions, WKTextInputMode inputMode, Action<NSArray> completion); void PresentTextInputController ([NullAllowed] string [] suggestions, WKTextInputMode inputMode, Action<NSArray> completion);
[iOS (9,0)] [iOS (9,0)]
[Export ("presentTextInputControllerWithSuggestionsForLanguage:allowedInputMode:completion:")] [Export ("presentTextInputControllerWithSuggestionsForLanguage:allowedInputMode:completion:")]
[Async]
void PresentTextInputController ([NullAllowed] Func<NSString, NSArray> suggestionsHandler, WKTextInputMode inputMode, Action<NSArray> completion); void PresentTextInputController ([NullAllowed] Func<NSString, NSArray> suggestionsHandler, WKTextInputMode inputMode, Action<NSArray> completion);
[NoWatch] [NoWatch]
@ -170,6 +172,7 @@ namespace XamCore.WatchKit {
[Watch (2,0)] [Watch (2,0)]
[Export ("presentAudioRecorderControllerWithOutputURL:preset:options:completion:")] [Export ("presentAudioRecorderControllerWithOutputURL:preset:options:completion:")]
[Async]
void PresentAudioRecorderController (NSUrl outputUrl, WKAudioRecorderPreset preset, [NullAllowed] NSDictionary options, Action<bool, NSError> completion); void PresentAudioRecorderController (NSUrl outputUrl, WKAudioRecorderPreset preset, [NullAllowed] NSDictionary options, Action<bool, NSError> completion);
[Watch (2,0)] [Watch (2,0)]
@ -183,6 +186,7 @@ namespace XamCore.WatchKit {
void PresentAlertController ([NullAllowed] string title, [NullAllowed] string message, WKAlertControllerStyle preferredStyle, WKAlertAction[] actions); void PresentAlertController ([NullAllowed] string title, [NullAllowed] string message, WKAlertControllerStyle preferredStyle, WKAlertAction[] actions);
[Export ("presentAddPassesControllerWithPasses:completion:")] [Export ("presentAddPassesControllerWithPasses:completion:")]
[Async]
void PresentAddPassesController (PKPass[] passes, Action completion); void PresentAddPassesController (PKPass[] passes, Action completion);
[Export ("dismissAddPassesController")] [Export ("dismissAddPassesController")]
@ -205,6 +209,7 @@ namespace XamCore.WatchKit {
#endif #endif
[NoiOS] [NoiOS]
[Export ("presentMediaPlayerControllerWithURL:options:completion:")] [Export ("presentMediaPlayerControllerWithURL:options:completion:")]
[Async (ResultType = typeof (WKPresentMediaPlayerResult))]
void PresentMediaPlayerController (NSUrl url, [NullAllowed] NSDictionary options, Action<bool, double, NSError> completion); void PresentMediaPlayerController (NSUrl url, [NullAllowed] NSDictionary options, Action<bool, double, NSError> completion);
[Watch (3,0)][NoiOS] [Watch (3,0)][NoiOS]

Просмотреть файл

@ -281,12 +281,15 @@ namespace XamCore.WebKit
NSSet<NSString> AllWebsiteDataTypes { get; } NSSet<NSString> AllWebsiteDataTypes { get; }
[Export ("fetchDataRecordsOfTypes:completionHandler:")] [Export ("fetchDataRecordsOfTypes:completionHandler:")]
[Async]
void FetchDataRecordsOfTypes (NSSet<NSString> dataTypes, Action<NSArray> completionHandler); void FetchDataRecordsOfTypes (NSSet<NSString> dataTypes, Action<NSArray> completionHandler);
[Export ("removeDataOfTypes:forDataRecords:completionHandler:")] [Export ("removeDataOfTypes:forDataRecords:completionHandler:")]
[Async]
void RemoveDataOfTypes (NSSet<NSString> dataTypes, WKWebsiteDataRecord[] dataRecords, Action completionHandler); void RemoveDataOfTypes (NSSet<NSString> dataTypes, WKWebsiteDataRecord[] dataRecords, Action completionHandler);
[Export ("removeDataOfTypes:modifiedSince:completionHandler:")] [Export ("removeDataOfTypes:modifiedSince:completionHandler:")]
[Async]
void RemoveDataOfTypes (NSSet<NSString> websiteDataTypes, NSDate date, Action completionHandler); void RemoveDataOfTypes (NSSet<NSString> websiteDataTypes, NSDate date, Action completionHandler);
} }

Просмотреть файл

@ -295,7 +295,10 @@ namespace Xamarin.Tests
public static string MlaunchPath { public static string MlaunchPath {
get { get {
return Path.Combine (XSIphoneDir, "mlaunch.app", "Contents", "MacOS", "mlaunch"); var env = Environment.GetEnvironmentVariable ("MLAUNCH_PATH");
if (!string.IsNullOrEmpty (env))
return env;
return Path.Combine (BinDirXI, "mlaunch");
} }
} }
} }

Просмотреть файл

@ -14,7 +14,7 @@ include $(TOP)/Make.config
IOS_CURRENT_DIR=$(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current IOS_CURRENT_DIR=$(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current
IOS_GENERATOR = $(IOS_CURRENT_DIR)/bin/btouch-native /baselib:$(IOS_CURRENT_DIR)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll /unsafe IOS_GENERATOR = $(IOS_CURRENT_DIR)/bin/btouch-native /baselib:$(IOS_CURRENT_DIR)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll /unsafe
IOS_TESTS = bug15283 bug15307 bug15799 bug16036 sof20696157 bug23041 bug27430 bug27428 bug34042 btouch-with-hyphen-in-name property-redefination-ios arrayfromhandlebug bug36457 bug39614 bug40282 bug17232 bug24078-ignore-methods-events strong-dict-support-templated-dicts bug43579 bindastests IOS_TESTS = bug15283 bug15307 bug15799 bug16036 sof20696157 bug23041 bug27430 bug27428 bug34042 btouch-with-hyphen-in-name property-redefination-ios arrayfromhandlebug bug36457 bug39614 bug40282 bug17232 bug24078-ignore-methods-events strong-dict-support-templated-dicts bug43579 bindastests
IOS_CUSTOM_TESTS = forum54078 desk63279 desk79124 multiple-api-definitions1 multiple-api-definitions2 bug29493 classNameCollision bi1036 bug37527 bug27986 bug35176 bi1046 bindas1048error bindas1049error bindas1050modelerror bindas1050protocolerror virtualwrap IOS_CUSTOM_TESTS = forum54078 desk63279 desk79124 multiple-api-definitions1 multiple-api-definitions2 bug29493 classNameCollision bi1036 bug37527 bug27986 bug35176 bi1046 bindas1048error bindas1049error bindas1050modelerror bindas1050protocolerror virtualwrap bug42855
MAC_CURRENT_DIR=$(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current MAC_CURRENT_DIR=$(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current
MAC_GENERATOR = $(MAC_CURRENT_DIR)/bin/bmac MAC_GENERATOR = $(MAC_CURRENT_DIR)/bin/bmac
@ -61,6 +61,7 @@ $(eval $(call iOSErrorCodeTestTemplate,bindas1048error,1048))
$(eval $(call iOSErrorCodeTestTemplate,bindas1049error,1049)) $(eval $(call iOSErrorCodeTestTemplate,bindas1049error,1049))
$(eval $(call iOSErrorCodeTestTemplate,bindas1050modelerror,1050)) $(eval $(call iOSErrorCodeTestTemplate,bindas1050modelerror,1050))
$(eval $(call iOSErrorCodeTestTemplate,bindas1050protocolerror,1050)) $(eval $(call iOSErrorCodeTestTemplate,bindas1050protocolerror,1050))
$(eval $(call iOSErrorCodeTestTemplate,bug42855,1060))
classNameCollision: classNameCollision:
@rm -Rf $@.tmpdir @rm -Rf $@.tmpdir

Просмотреть файл

@ -0,0 +1,16 @@
using System;
using Foundation;
namespace Bug42855Tests {
[Protocol][Model]
interface MyFooClass {
[Abstract]
[Export ("stringMethod:")]
NSString StringMethod (int arg1);
[Export ("stringMethod2:")]
NSString StringMethod2 (int arg1);
}
}

Просмотреть файл

@ -865,5 +865,115 @@ namespace Introspection {
ReportError ($"`{t.Name}.{m.Name}` return type `{rt.Name}` is a concrete type `[Model]` and not an interface `[Protocol]`"); ReportError ($"`{t.Name}.{m.Name}` return type `{rt.Name}` is a concrete type `[Model]` and not an interface `[Protocol]`");
} }
} }
static bool IsDiscouraged (MemberInfo mi)
{
foreach (var ca in mi.GetCustomAttributes ()) {
switch (ca.GetType ().Name) {
case "ObsoleteAttribute":
case "AdviceAttribute":
case "ObsoletedAttribute":
case "DeprecatedAttribute":
return true;
}
}
return false;
}
#if !MONOMAC
[Test]
#endif
public void AsyncCandidates ()
{
int n = 0;
Errors = 0;
ErrorData.Clear ();
foreach (Type t in Assembly.GetTypes ()) {
// e.g. delegates used for events
if (t.IsNested)
continue;
if (!NSObjectType.IsAssignableFrom (t))
continue;
if (t.GetCustomAttribute<ProtocolAttribute> () != null)
continue;
if (t.GetCustomAttribute<ModelAttribute> () != null)
continue;
// let's not encourage the use of some API
if (IsDiscouraged (t))
continue;
CurrentType = t;
var methods = t.GetMethods (Flags);
foreach (MethodInfo m in methods) {
if (m.DeclaringType != t)
continue;
// skip properties / events
if (m.IsSpecialName)
continue;
if (IgnoreAsync (m))
continue;
if (m.ReturnType.Name != "Void")
continue;
// some calls are "natively" async
if (m.Name.IndexOf ("Async", StringComparison.Ordinal) != -1)
continue;
// let's not encourage the use of some API
if (IsDiscouraged (m))
continue;
// is it a candidate ?
var p = m.GetParameters ();
if (p.Length == 0)
continue;
var last = p [p.Length - 1];
// trying to limit false positives and the need for large ignore lists to maintain
// unlike other introspection tests a failure does not mean a broken API
switch (last.Name) {
case "completionHandler":
case "completion":
break;
default:
continue;
}
if (!last.ParameterType.IsSubclassOf (typeof (Delegate)))
continue;
// did we provide a async wrapper ?
string ma = m.Name + "Async";
if (methods.Where ((mi) => mi.Name == ma).FirstOrDefault () != null)
continue;
var name = m.ToString ();
var i = name.IndexOf (' ');
ErrorData.AppendLine (name.Insert (i + 1, m.DeclaringType.Name + "::"));
Errors++;
}
}
AssertIfErrors ("{0} errors found in {1} signatures validated{2}", Errors, n, Errors == 0 ? string.Empty : ":\n" + ErrorData.ToString () + "\n");
}
protected virtual bool IgnoreAsync (MethodInfo m)
{
switch (m.Name) {
// we bind PerformChangesAndWait which does the same
case "PerformChanges":
return m.DeclaringType.Name == "PHPhotoLibrary";
// it sets the callback, it will never call it
case "SetCompletionBlock":
return m.DeclaringType.Name == "SCNTransaction";
}
return false;
}
} }
} }

Просмотреть файл

@ -214,5 +214,23 @@ namespace Introspection {
#endif #endif
base.CheckManagedMemberSignatures (m, t, ref n); base.CheckManagedMemberSignatures (m, t, ref n);
} }
protected override bool IgnoreAsync (MethodInfo m)
{
switch (m.Name) {
// Called by the OS, i.e. meant to be overridden (not called) by user code.
case "DidReceiveNotification":
return m.DeclaringType.Name == "WKUserNotificationInterfaceController";
case "AddCompletion":
return true;
// comes from NSFilePresenter protocol, where we cannot put [Async] today
// proposal: https://trello.com/c/dSOh6PXE/680-rfc-async-on-protocol-proposal
case "AccommodatePresentedItemDeletion":
case "AccommodatePresentedSubitemDeletion":
case "SavePresentedItemChanges":
return m.DeclaringType.Name == "UIDocument";
}
return base.IgnoreAsync (m);
}
} }
} }

Просмотреть файл

@ -30,7 +30,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>False</Optimize> <Optimize>True</Optimize>
<OutputPath>bin\iPhoneSimulator\$(Configuration)-unified</OutputPath> <OutputPath>bin\iPhoneSimulator\$(Configuration)-unified</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@ -87,7 +87,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>False</Optimize> <Optimize>True</Optimize>
<OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath> <OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@ -101,7 +101,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release32|iPhone' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release32|iPhone' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>False</Optimize> <Optimize>True</Optimize>
<OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath> <OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@ -115,7 +115,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release64|iPhone' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release64|iPhone' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>False</Optimize> <Optimize>True</Optimize>
<OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath> <OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@ -129,7 +129,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-bitcode|iPhone' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-bitcode|iPhone' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>False</Optimize> <Optimize>True</Optimize>
<OutputPath>bin\iPhone\$(Configuration)-bitcode-unified</OutputPath> <OutputPath>bin\iPhone\$(Configuration)-bitcode-unified</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>

Просмотреть файл

@ -29,7 +29,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>False</Optimize> <Optimize>True</Optimize>
<OutputPath>bin\iPhoneSimulator\$(Configuration)-unified</OutputPath> <OutputPath>bin\iPhoneSimulator\$(Configuration)-unified</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@ -81,7 +81,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>False</Optimize> <Optimize>True</Optimize>
<OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath> <OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@ -93,7 +93,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release32|iPhone' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release32|iPhone' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>False</Optimize> <Optimize>True</Optimize>
<OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath> <OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@ -105,7 +105,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release64|iPhone' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release64|iPhone' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>False</Optimize> <Optimize>True</Optimize>
<OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath> <OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@ -117,7 +117,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-bitcode|iPhone' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-bitcode|iPhone' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>False</Optimize> <Optimize>True</Optimize>
<OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath> <OutputPath>bin\iPhone\$(Configuration)-unified</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>

Просмотреть файл

@ -205,6 +205,7 @@ namespace xharness
var filename = Path.GetFullPath (Path.Combine (IOS_DESTDIR, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current", "bin", "mlaunch")); var filename = Path.GetFullPath (Path.Combine (IOS_DESTDIR, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current", "bin", "mlaunch"));
if (File.Exists (filename)) { if (File.Exists (filename)) {
Log ("Found mlaunch: {0}", filename); Log ("Found mlaunch: {0}", filename);
Environment.SetEnvironmentVariable ("MLAUNCH_PATH", filename);
return mlaunch = filename; return mlaunch = filename;
} }
@ -217,6 +218,7 @@ namespace xharness
} }
if (File.Exists (filename)) { if (File.Exists (filename)) {
Log ("Found mlaunch: {0}", filename); Log ("Found mlaunch: {0}", filename);
Environment.SetEnvironmentVariable ("MLAUNCH_PATH", filename);
return mlaunch = filename; return mlaunch = filename;
} }
@ -226,6 +228,7 @@ namespace xharness
filename = "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch"; filename = "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch";
if (File.Exists (filename)) { if (File.Exists (filename)) {
Log ("Found mlaunch: {0}", filename); Log ("Found mlaunch: {0}", filename);
Environment.SetEnvironmentVariable ("MLAUNCH_PATH", filename);
return mlaunch = filename; return mlaunch = filename;
} }