1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const WarningAggregator_1 = require("../WarningAggregator");
|
4 | function getSupportsTablet(config) {
|
5 | var _a, _b;
|
6 | if ((_a = config.ios) === null || _a === void 0 ? void 0 : _a.supportsTablet) {
|
7 | return (_b = config.ios) === null || _b === void 0 ? void 0 : _b.supportsTablet;
|
8 | }
|
9 | return false;
|
10 | }
|
11 | exports.getSupportsTablet = getSupportsTablet;
|
12 | function getIsTabletOnly(config) {
|
13 | var _a;
|
14 | if ((_a = config.ios) === null || _a === void 0 ? void 0 : _a.isTabletOnly) {
|
15 | return config.ios.isTabletOnly;
|
16 | }
|
17 | return false;
|
18 | }
|
19 | exports.getIsTabletOnly = getIsTabletOnly;
|
20 | function getDeviceFamilies(config) {
|
21 | let supportsTablet = getSupportsTablet(config);
|
22 | let isTabletOnly = getIsTabletOnly(config);
|
23 |
|
24 | if (isTabletOnly) {
|
25 | return [2];
|
26 | }
|
27 | else if (supportsTablet) {
|
28 | return [1, 2];
|
29 | }
|
30 | else {
|
31 | return [1];
|
32 | }
|
33 | }
|
34 | exports.getDeviceFamilies = getDeviceFamilies;
|
35 |
|
36 |
|
37 |
|
38 | function setDeviceFamily(config, projectRoot) {
|
39 | const deviceFamilies = getDeviceFamilies(config);
|
40 | let supportsTablet = getSupportsTablet(config);
|
41 | let isTabletOnly = getIsTabletOnly(config);
|
42 | if (isTabletOnly) {
|
43 | WarningAggregator_1.addWarningIOS('isTabletOnly', 'You will need to configure this in the "General" tab for your project target in Xcode.');
|
44 | }
|
45 | else if (supportsTablet) {
|
46 | WarningAggregator_1.addWarningIOS('supportsTablet', 'You will need to configure this in the "General" tab for your project target in Xcode.');
|
47 | }
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | }
|
61 | exports.setDeviceFamily = setDeviceFamily;
|
62 |
|
\ | No newline at end of file |