MCPcopy Index your code
hub / github.com/ionic-team/capacitor / buildBinaryTargetEntries

Function buildBinaryTargetEntries

cli/src/ios/update.ts:124–155  ·  view source on GitHub ↗
(p: Plugin, frameworks: any[])

Source from the content-addressed store, hash-verified

122}
123
124function buildBinaryTargetEntries(p: Plugin, frameworks: any[]): { binaryTargetsText: string; binaryDepsText: string } {
125 const customXcframeworks = frameworks.filter((f: any) => f.$.custom === 'true' && f.$.src.endsWith('.xcframework'));
126 const customFrameworks = frameworks.filter((f: any) => f.$.custom === 'true' && f.$.src.endsWith('.framework'));
127
128 if (customFrameworks.length > 0) {
129 customFrameworks.forEach((f: any) => {
130 logger.warn(
131 `${p.id}: custom .framework files are not supported as binaryTarget in SPM (${f.$.src}). Convert to .xcframework for SPM compatibility.`,
132 );
133 });
134 }
135
136 const binaryTargetsText = customXcframeworks
137 .map((f: any) => {
138 const name = f.$.src.split('/').pop().replace('.xcframework', '');
139 return `,
140 .binaryTarget(
141 name: "${name}",
142 path: "${f.$.src}"
143 )`;
144 })
145 .join('');
146
147 const binaryDepsText = customXcframeworks
148 .map((f: any) => {
149 const name = f.$.src.split('/').pop().replace('.xcframework', '');
150 return `,\n .target(name: "${name}")`;
151 })
152 .join('');
153
154 return { binaryTargetsText, binaryDepsText };
155}
156
157function buildResourcesText(resources: any[]) {
158 const resourceEntry = [];

Callers 1

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected