* Update branch name

* Update SDK version for iOS and watchOS (but not tvOS)

* [xharness] Add support for watchOS Series 2 simulators. (#812)

* [xharness] Add Jenkins support for watchOS Series 2 simulators. (#885)
This commit is contained in:
Sebastien Pouliot 2016-09-23 11:50:02 -04:00 коммит произвёл GitHub
Родитель d7d3c82d1d
Коммит e4ce16e989
3 изменённых файлов: 19 добавлений и 15 удалений

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

@ -29,7 +29,7 @@ PACKAGE_HEAD_REV=$(shell git rev-parse HEAD)
# on wrench, because wrench technically builds hashes, not branches)
#
#
PACKAGE_HEAD_BRANCH=xcode8
PACKAGE_HEAD_BRANCH=xcode8.1
ifeq ($(BUILD_REVISION),)
CURRENT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD)
else
@ -67,9 +67,9 @@ MIN_OSX_BUILD_VERSION=10.11
MIN_OSX_VERSION_FOR_IOS=10.10
MIN_OSX_VERSION_FOR_MAC=10.10
IOS_SDK_VERSION=10.0
IOS_SDK_VERSION=10.1
OSX_SDK_VERSION=10.12
WATCH_SDK_VERSION=3.0
WATCH_SDK_VERSION=3.1
TVOS_SDK_VERSION=10.0
MIN_IOS_SDK_VERSION=6.0

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

@ -71,28 +71,28 @@ namespace xharness
if (simulators != null)
return;
string simulator_devicetype;
string [] simulator_devicetypes;
string simulator_runtime;
switch (Target) {
case "ios-simulator-32":
simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType.iPhone-5";
simulator_devicetypes = new string [] { "com.apple.CoreSimulator.SimDeviceType.iPhone-5" };
simulator_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + Xamarin.SdkVersions.iOS.Replace ('.', '-');
break;
case "ios-simulator-64":
simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType.iPhone-5s";
simulator_devicetypes = new string [] { "com.apple.CoreSimulator.SimDeviceType.iPhone-5s" };
simulator_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + Xamarin.SdkVersions.iOS.Replace ('.', '-');
break;
case "ios-simulator":
simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType.iPhone-5";
simulator_devicetypes = new string [] { "com.apple.CoreSimulator.SimDeviceType.iPhone-5" };
simulator_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + Xamarin.SdkVersions.iOS.Replace ('.', '-');
break;
case "tvos-simulator":
simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p";
simulator_devicetypes = new string [] { "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p" };
simulator_runtime = "com.apple.CoreSimulator.SimRuntime.tvOS-" + Xamarin.SdkVersions.TVOS.Replace ('.', '-');
break;
case "watchos-simulator":
simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm";
simulator_devicetypes = new string [] { "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm", "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm" };
simulator_runtime = "com.apple.CoreSimulator.SimRuntime.watchOS-" + Xamarin.SdkVersions.WatchOS.Replace ('.', '-');
break;
default:
@ -107,7 +107,7 @@ namespace xharness
await sims.LoadAsync (Logs.CreateStream (LogDirectory, "simulator-list.log", "Simulator list"));
}).Wait ();
var devices = sims.AvailableDevices.Where ((SimDevice v) => v.SimRuntime == simulator_runtime && v.SimDeviceType == simulator_devicetype);
var devices = sims.AvailableDevices.Where ((SimDevice v) => v.SimRuntime == simulator_runtime && simulator_devicetypes.Contains (v.SimDeviceType));
SimDevice candidate = null;
simulators = null;
foreach (var device in devices) {
@ -134,7 +134,7 @@ namespace xharness
}
if (simulators == null) {
if (candidate == null)
throw new Exception ($"Could not find simulator for runtime={simulator_runtime} and device type={simulator_devicetype}.");
throw new Exception ($"Could not find simulator for runtime={simulator_runtime} and device type={string.Join (";", simulator_devicetypes)}.");
simulators = new SimDevice [] { candidate };
}

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

@ -78,15 +78,19 @@ namespace xharness
Where ((SimRuntime v) => v.Identifier.StartsWith ("com.apple.CoreSimulator.SimRuntime.watchOS-", StringComparison.Ordinal)).
OrderBy ((SimRuntime v) => v.Version).
Last ();
var watchOSDeviceType =
var watchOSDeviceTypes =
Simulators.SupportedDeviceTypes.
Where ((SimDeviceType v) => v.ProductFamilyId == "Watch").
First ();
Where ((SimDeviceType v) => v.ProductFamilyId == "Watch");
var devices =
Simulators.AvailableDevices.
Where ((SimDevice d) => d.SimRuntime == latestwatchOSRuntime.Identifier && d.SimDeviceType == watchOSDeviceType.Identifier);
Where ((SimDevice d) => d.SimRuntime == latestwatchOSRuntime.Identifier && watchOSDeviceTypes.Any ((v) => d.SimDeviceType == v.Identifier));
var pair = Simulators.AvailableDevicePairs.
FirstOrDefault ((SimDevicePair v) => devices.Any ((SimDevice d) => d.UDID == v.Gizmo));
if (pair == null) {
var msg = string.Format ("Could not find a device pair for any of these devices: {0}", string.Join (", ", devices.Select ((v) => v.Name).ToArray ()));
SimulatorLoadLog.WriteLine (msg);
throw new Exception (msg);
}
var device =
Simulators.AvailableDevices.
FirstOrDefault ((SimDevice v) => pair.Gizmo == v.UDID); // select the device in the device pair.