1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.projectConfig = projectConfig;
|
7 | exports.dependencyConfig = dependencyConfig;
|
8 | exports.findPodfilePaths = void 0;
|
9 |
|
10 | function _path() {
|
11 | const data = _interopRequireDefault(require("path"));
|
12 |
|
13 | _path = function () {
|
14 | return data;
|
15 | };
|
16 |
|
17 | return data;
|
18 | }
|
19 |
|
20 | function _fs() {
|
21 | const data = _interopRequireDefault(require("fs"));
|
22 |
|
23 | _fs = function () {
|
24 | return data;
|
25 | };
|
26 |
|
27 | return data;
|
28 | }
|
29 |
|
30 | var _findPodfilePath = _interopRequireDefault(require("./findPodfilePath"));
|
31 |
|
32 | var _findXcodeProject = _interopRequireDefault(require("./findXcodeProject"));
|
33 |
|
34 | var _findPodspec = _interopRequireDefault(require("./findPodspec"));
|
35 |
|
36 | var _findAllPodfilePaths = _interopRequireDefault(require("./findAllPodfilePaths"));
|
37 |
|
38 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | function projectConfig(folder, userConfig) {
|
53 | if (!userConfig) {
|
54 | return null;
|
55 | }
|
56 |
|
57 | const src = _path().default.join(folder, userConfig.sourceDir ?? '');
|
58 |
|
59 | const podfile = (0, _findPodfilePath.default)(src);
|
60 | |
61 |
|
62 |
|
63 |
|
64 |
|
65 | if (!podfile) {
|
66 | return null;
|
67 | }
|
68 |
|
69 | const sourceDir = _path().default.dirname(podfile);
|
70 |
|
71 | const xcodeProject = (0, _findXcodeProject.default)(_fs().default.readdirSync(sourceDir));
|
72 | return {
|
73 | sourceDir,
|
74 | xcodeProject
|
75 | };
|
76 | }
|
77 |
|
78 | function dependencyConfig(folder, userConfig = {}) {
|
79 | if (userConfig === null) {
|
80 | return null;
|
81 | }
|
82 |
|
83 | const podspecPath = (0, _findPodspec.default)(folder);
|
84 |
|
85 | if (!podspecPath) {
|
86 | return null;
|
87 | }
|
88 |
|
89 | return {
|
90 | podspecPath,
|
91 | configurations: userConfig.configurations || [],
|
92 | scriptPhases: userConfig.scriptPhases || []
|
93 | };
|
94 | }
|
95 |
|
96 | const findPodfilePaths = _findAllPodfilePaths.default;
|
97 | exports.findPodfilePaths = findPodfilePaths;
|
98 |
|
99 |
|
\ | No newline at end of file |