MCPcopy
hub / github.com/ionic-team/capacitor / buildDependencyTexts

Function buildDependencyTexts

cli/src/ios/update.ts:170–197  ·  view source on GitHub ↗
(p: Plugin, config: Config)

Source from the content-addressed store, hash-verified

168}
169
170async function buildDependencyTexts(p: Plugin, config: Config) {
171 let allDependencies: string[] = getPlatformElement(p, platform, 'dependency');
172 if (p.xml['dependency']) {
173 allDependencies = allDependencies.concat(p.xml['dependency']);
174 }
175 let packageText = '';
176 let productText = '';
177 await Promise.all(
178 allDependencies.map(async (dep: any) => {
179 let plugin = dep.$.id;
180 if (plugin.includes('@') && plugin.indexOf('@') !== 0) {
181 [plugin] = plugin.split('@');
182 }
183 const depPlugin = await resolvePlugin(config, plugin);
184 if (depPlugin) {
185 const headerFiles = getPlatformElement(depPlugin, platform, 'header-file');
186 const resources = getPlatformElement(depPlugin, platform, 'resource-file');
187 const sourceFiles = getPlatformElement(depPlugin, platform, 'source-file');
188 if (sourceFiles.length === 0 && headerFiles.length === 0 && resources.length === 0) {
189 return;
190 }
191 packageText += `,\n .package(name: "${depPlugin.name}", path: "../${depPlugin.name}")`;
192 productText += `,\n .product(name: "${depPlugin.name}", package: "${depPlugin.name}")`;
193 }
194 }),
195 );
196 return { packageText, productText };
197}
198
199function buildCSettingsText(p: Plugin, sourceFiles: any[]): string {
200 const pluginId = p.id;

Callers 1

Calls 2

getPlatformElementFunction · 0.90
resolvePluginFunction · 0.90

Tested by

no test coverage detected