@use-voltra/expo-plugin 1.4.1 → 2.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -29
- package/build/cjs/constants.js +3 -43
- package/build/cjs/constants.js.map +1 -1
- package/build/cjs/index.js +23 -69
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/types.js +4 -0
- package/build/cjs/types.js.map +1 -1
- package/build/cjs/utils/localePick.js +48 -0
- package/build/cjs/utils/localePick.js.map +1 -0
- package/build/cjs/utils/prerender.js +15 -9
- package/build/cjs/utils/prerender.js.map +1 -1
- package/build/cjs/utils/widgetLabel.js +19 -0
- package/build/cjs/utils/widgetLabel.js.map +1 -0
- package/build/cjs/validation.js +75 -166
- package/build/cjs/validation.js.map +1 -1
- package/build/esm/constants.js +2 -42
- package/build/esm/constants.js.map +1 -1
- package/build/esm/index.js +8 -69
- package/build/esm/index.js.map +1 -1
- package/build/esm/types.js +4 -0
- package/build/esm/types.js.map +1 -1
- package/build/esm/utils/localePick.js +44 -0
- package/build/esm/utils/localePick.js.map +1 -0
- package/build/esm/utils/prerender.js +15 -9
- package/build/esm/utils/prerender.js.map +1 -1
- package/build/esm/utils/widgetLabel.js +15 -0
- package/build/esm/utils/widgetLabel.js.map +1 -0
- package/build/esm/validation.js +71 -163
- package/build/esm/validation.js.map +1 -1
- package/build/types/constants.d.ts +2 -26
- package/build/types/constants.d.ts.map +1 -1
- package/build/types/index.d.ts +10 -12
- package/build/types/index.d.ts.map +1 -1
- package/build/types/types.d.ts +9 -260
- package/build/types/types.d.ts.map +1 -1
- package/build/types/utils/localePick.d.ts +7 -0
- package/build/types/utils/localePick.d.ts.map +1 -0
- package/build/types/utils/prerender.d.ts +6 -3
- package/build/types/utils/prerender.d.ts.map +1 -1
- package/build/types/utils/widgetLabel.d.ts +8 -0
- package/build/types/utils/widgetLabel.d.ts.map +1 -0
- package/build/types/validation.d.ts +6 -14
- package/build/types/validation.d.ts.map +1 -1
- package/package.json +11 -11
- package/build/cjs/android/files/assets.js +0 -259
- package/build/cjs/android/files/assets.js.map +0 -1
- package/build/cjs/android/files/fonts.js +0 -69
- package/build/cjs/android/files/fonts.js.map +0 -1
- package/build/cjs/android/files/index.js +0 -81
- package/build/cjs/android/files/index.js.map +0 -1
- package/build/cjs/android/files/initialStates.js +0 -83
- package/build/cjs/android/files/initialStates.js.map +0 -1
- package/build/cjs/android/files/kotlin.js +0 -142
- package/build/cjs/android/files/kotlin.js.map +0 -1
- package/build/cjs/android/files/xml.js +0 -247
- package/build/cjs/android/files/xml.js.map +0 -1
- package/build/cjs/android/index.js +0 -33
- package/build/cjs/android/index.js.map +0 -1
- package/build/cjs/android/manifest.js +0 -92
- package/build/cjs/android/manifest.js.map +0 -1
- package/build/cjs/ios/eas.js +0 -28
- package/build/cjs/ios/eas.js.map +0 -1
- package/build/cjs/ios/entitlements.js +0 -46
- package/build/cjs/ios/entitlements.js.map +0 -1
- package/build/cjs/ios/index.js +0 -39
- package/build/cjs/ios/index.js.map +0 -1
- package/build/cjs/ios/infoPlist.js +0 -51
- package/build/cjs/ios/infoPlist.js.map +0 -1
- package/build/cjs/ios/pushNotifications.js +0 -22
- package/build/cjs/ios/pushNotifications.js.map +0 -1
- package/build/cjs/ios-widget/eas.js +0 -66
- package/build/cjs/ios-widget/eas.js.map +0 -1
- package/build/cjs/ios-widget/files/assets.js +0 -199
- package/build/cjs/ios-widget/files/assets.js.map +0 -1
- package/build/cjs/ios-widget/files/entitlements.js +0 -77
- package/build/cjs/ios-widget/files/entitlements.js.map +0 -1
- package/build/cjs/ios-widget/files/index.js +0 -92
- package/build/cjs/ios-widget/files/index.js.map +0 -1
- package/build/cjs/ios-widget/files/infoPlist.js +0 -91
- package/build/cjs/ios-widget/files/infoPlist.js.map +0 -1
- package/build/cjs/ios-widget/files/swift.js +0 -256
- package/build/cjs/ios-widget/files/swift.js.map +0 -1
- package/build/cjs/ios-widget/fonts.js +0 -151
- package/build/cjs/ios-widget/fonts.js.map +0 -1
- package/build/cjs/ios-widget/index.js +0 -46
- package/build/cjs/ios-widget/index.js.map +0 -1
- package/build/cjs/ios-widget/podfile.js +0 -43
- package/build/cjs/ios-widget/podfile.js.map +0 -1
- package/build/cjs/ios-widget/widgetPlist.js +0 -99
- package/build/cjs/ios-widget/widgetPlist.js.map +0 -1
- package/build/cjs/ios-widget/xcode/buildPhases.js +0 -245
- package/build/cjs/ios-widget/xcode/buildPhases.js.map +0 -1
- package/build/cjs/ios-widget/xcode/configurationList.js +0 -91
- package/build/cjs/ios-widget/xcode/configurationList.js.map +0 -1
- package/build/cjs/ios-widget/xcode/groups.js +0 -65
- package/build/cjs/ios-widget/xcode/groups.js.map +0 -1
- package/build/cjs/ios-widget/xcode/index.js +0 -155
- package/build/cjs/ios-widget/xcode/index.js.map +0 -1
- package/build/cjs/ios-widget/xcode/mainAppSettings.js +0 -71
- package/build/cjs/ios-widget/xcode/mainAppSettings.js.map +0 -1
- package/build/cjs/ios-widget/xcode/productFile.js +0 -74
- package/build/cjs/ios-widget/xcode/productFile.js.map +0 -1
- package/build/cjs/ios-widget/xcode/target.js +0 -113
- package/build/cjs/ios-widget/xcode/target.js.map +0 -1
- package/build/cjs/utils/fileDiscovery.js +0 -107
- package/build/cjs/utils/fileDiscovery.js.map +0 -1
- package/build/cjs/utils/urlScheme.js +0 -40
- package/build/cjs/utils/urlScheme.js.map +0 -1
- package/build/esm/android/files/assets.js +0 -223
- package/build/esm/android/files/assets.js.map +0 -1
- package/build/esm/android/files/fonts.js +0 -33
- package/build/esm/android/files/fonts.js.map +0 -1
- package/build/esm/android/files/index.js +0 -77
- package/build/esm/android/files/index.js.map +0 -1
- package/build/esm/android/files/initialStates.js +0 -44
- package/build/esm/android/files/initialStates.js.map +0 -1
- package/build/esm/android/files/kotlin.js +0 -103
- package/build/esm/android/files/kotlin.js.map +0 -1
- package/build/esm/android/files/xml.js +0 -206
- package/build/esm/android/files/xml.js.map +0 -1
- package/build/esm/android/index.js +0 -29
- package/build/esm/android/index.js.map +0 -1
- package/build/esm/android/manifest.js +0 -88
- package/build/esm/android/manifest.js.map +0 -1
- package/build/esm/ios/eas.js +0 -24
- package/build/esm/ios/eas.js.map +0 -1
- package/build/esm/ios/entitlements.js +0 -42
- package/build/esm/ios/entitlements.js.map +0 -1
- package/build/esm/ios/index.js +0 -34
- package/build/esm/ios/index.js.map +0 -1
- package/build/esm/ios/infoPlist.js +0 -47
- package/build/esm/ios/infoPlist.js.map +0 -1
- package/build/esm/ios/pushNotifications.js +0 -18
- package/build/esm/ios/pushNotifications.js.map +0 -1
- package/build/esm/ios-widget/eas.js +0 -62
- package/build/esm/ios-widget/eas.js.map +0 -1
- package/build/esm/ios-widget/files/assets.js +0 -163
- package/build/esm/ios-widget/files/assets.js.map +0 -1
- package/build/esm/ios-widget/files/entitlements.js +0 -37
- package/build/esm/ios-widget/files/entitlements.js.map +0 -1
- package/build/esm/ios-widget/files/index.js +0 -55
- package/build/esm/ios-widget/files/index.js.map +0 -1
- package/build/esm/ios-widget/files/infoPlist.js +0 -55
- package/build/esm/ios-widget/files/infoPlist.js.map +0 -1
- package/build/esm/ios-widget/files/swift.js +0 -217
- package/build/esm/ios-widget/files/swift.js.map +0 -1
- package/build/esm/ios-widget/fonts.js +0 -111
- package/build/esm/ios-widget/fonts.js.map +0 -1
- package/build/esm/ios-widget/index.js +0 -42
- package/build/esm/ios-widget/index.js.map +0 -1
- package/build/esm/ios-widget/podfile.js +0 -39
- package/build/esm/ios-widget/podfile.js.map +0 -1
- package/build/esm/ios-widget/widgetPlist.js +0 -92
- package/build/esm/ios-widget/widgetPlist.js.map +0 -1
- package/build/esm/ios-widget/xcode/buildPhases.js +0 -208
- package/build/esm/ios-widget/xcode/buildPhases.js.map +0 -1
- package/build/esm/ios-widget/xcode/configurationList.js +0 -87
- package/build/esm/ios-widget/xcode/configurationList.js.map +0 -1
- package/build/esm/ios-widget/xcode/groups.js +0 -61
- package/build/esm/ios-widget/xcode/groups.js.map +0 -1
- package/build/esm/ios-widget/xcode/index.js +0 -118
- package/build/esm/ios-widget/xcode/index.js.map +0 -1
- package/build/esm/ios-widget/xcode/mainAppSettings.js +0 -68
- package/build/esm/ios-widget/xcode/mainAppSettings.js.map +0 -1
- package/build/esm/ios-widget/xcode/productFile.js +0 -70
- package/build/esm/ios-widget/xcode/productFile.js.map +0 -1
- package/build/esm/ios-widget/xcode/target.js +0 -108
- package/build/esm/ios-widget/xcode/target.js.map +0 -1
- package/build/esm/utils/fileDiscovery.js +0 -71
- package/build/esm/utils/fileDiscovery.js.map +0 -1
- package/build/esm/utils/urlScheme.js +0 -37
- package/build/esm/utils/urlScheme.js.map +0 -1
- package/build/types/android/files/assets.d.ts +0 -26
- package/build/types/android/files/assets.d.ts.map +0 -1
- package/build/types/android/files/fonts.d.ts +0 -19
- package/build/types/android/files/fonts.d.ts.map +0 -1
- package/build/types/android/files/index.d.ts +0 -21
- package/build/types/android/files/index.d.ts.map +0 -1
- package/build/types/android/files/initialStates.d.ts +0 -14
- package/build/types/android/files/initialStates.d.ts.map +0 -1
- package/build/types/android/files/kotlin.d.ts +0 -11
- package/build/types/android/files/kotlin.d.ts.map +0 -1
- package/build/types/android/files/xml.d.ts +0 -25
- package/build/types/android/files/xml.d.ts.map +0 -1
- package/build/types/android/index.d.ts +0 -12
- package/build/types/android/index.d.ts.map +0 -1
- package/build/types/android/manifest.d.ts +0 -16
- package/build/types/android/manifest.d.ts.map +0 -1
- package/build/types/ios/eas.d.ts +0 -12
- package/build/types/ios/eas.d.ts.map +0 -1
- package/build/types/ios/entitlements.d.ts +0 -14
- package/build/types/ios/entitlements.d.ts.map +0 -1
- package/build/types/ios/index.d.ts +0 -19
- package/build/types/ios/index.d.ts.map +0 -1
- package/build/types/ios/infoPlist.d.ts +0 -21
- package/build/types/ios/infoPlist.d.ts.map +0 -1
- package/build/types/ios/pushNotifications.d.ts +0 -10
- package/build/types/ios/pushNotifications.d.ts.map +0 -1
- package/build/types/ios-widget/eas.d.ts +0 -15
- package/build/types/ios-widget/eas.d.ts.map +0 -1
- package/build/types/ios-widget/files/assets.d.ts +0 -13
- package/build/types/ios-widget/files/assets.d.ts.map +0 -1
- package/build/types/ios-widget/files/entitlements.d.ts +0 -17
- package/build/types/ios-widget/files/entitlements.d.ts.map +0 -1
- package/build/types/ios-widget/files/index.d.ts +0 -24
- package/build/types/ios-widget/files/index.d.ts.map +0 -1
- package/build/types/ios-widget/files/infoPlist.d.ts +0 -10
- package/build/types/ios-widget/files/infoPlist.d.ts.map +0 -1
- package/build/types/ios-widget/files/swift.d.ts +0 -15
- package/build/types/ios-widget/files/swift.d.ts.map +0 -1
- package/build/types/ios-widget/fonts.d.ts +0 -22
- package/build/types/ios-widget/fonts.d.ts.map +0 -1
- package/build/types/ios-widget/index.d.ts +0 -31
- package/build/types/ios-widget/index.d.ts.map +0 -1
- package/build/types/ios-widget/podfile.d.ts +0 -9
- package/build/types/ios-widget/podfile.d.ts.map +0 -1
- package/build/types/ios-widget/widgetPlist.d.ts +0 -20
- package/build/types/ios-widget/widgetPlist.d.ts.map +0 -1
- package/build/types/ios-widget/xcode/buildPhases.d.ts +0 -25
- package/build/types/ios-widget/xcode/buildPhases.d.ts.map +0 -1
- package/build/types/ios-widget/xcode/configurationList.d.ts +0 -20
- package/build/types/ios-widget/xcode/configurationList.d.ts.map +0 -1
- package/build/types/ios-widget/xcode/groups.d.ts +0 -15
- package/build/types/ios-widget/xcode/groups.d.ts.map +0 -1
- package/build/types/ios-widget/xcode/index.d.ts +0 -20
- package/build/types/ios-widget/xcode/index.d.ts.map +0 -1
- package/build/types/ios-widget/xcode/mainAppSettings.d.ts +0 -15
- package/build/types/ios-widget/xcode/mainAppSettings.d.ts.map +0 -1
- package/build/types/ios-widget/xcode/productFile.d.ts +0 -14
- package/build/types/ios-widget/xcode/productFile.d.ts.map +0 -1
- package/build/types/ios-widget/xcode/target.d.ts +0 -42
- package/build/types/ios-widget/xcode/target.d.ts.map +0 -1
- package/build/types/utils/fileDiscovery.d.ts +0 -13
- package/build/types/utils/fileDiscovery.d.ts.map +0 -1
- package/build/types/utils/urlScheme.d.ts +0 -10
- package/build/types/utils/urlScheme.d.ts.map +0 -1
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import * as util from 'util';
|
|
2
|
-
const pbxFile = require('xcode/lib/pbxFile');
|
|
3
|
-
/**
|
|
4
|
-
* Adds all required build phases for the widget extension target.
|
|
5
|
-
*/
|
|
6
|
-
export function addBuildPhases(xcodeProject, options) {
|
|
7
|
-
const { targetUuid, groupName, productFile, widgetFiles } = options;
|
|
8
|
-
const buildPath = `""`;
|
|
9
|
-
const folderType = 'app_extension';
|
|
10
|
-
const { swiftFiles, intentFiles, assetDirectories } = widgetFiles;
|
|
11
|
-
// Sources build phase
|
|
12
|
-
xcodeProject.addBuildPhase([...swiftFiles, ...intentFiles], 'PBXSourcesBuildPhase', 'Sources', targetUuid, folderType, buildPath);
|
|
13
|
-
// Copy files build phase
|
|
14
|
-
xcodeProject.addBuildPhase([], 'PBXCopyFilesBuildPhase', groupName, xcodeProject.getFirstTarget().uuid, folderType, buildPath);
|
|
15
|
-
xcodeProject.buildPhaseObject('PBXCopyFilesBuildPhase', groupName, productFile.target).files.push({
|
|
16
|
-
value: productFile.uuid,
|
|
17
|
-
comment: util.format('%s in %s', productFile.basename, productFile.group),
|
|
18
|
-
});
|
|
19
|
-
xcodeProject.addToPbxBuildFileSection(productFile);
|
|
20
|
-
// Frameworks build phase
|
|
21
|
-
xcodeProject.addBuildPhase([], 'PBXFrameworksBuildPhase', 'Frameworks', targetUuid, folderType, buildPath);
|
|
22
|
-
// Resources build phase
|
|
23
|
-
xcodeProject.addBuildPhase([...assetDirectories], 'PBXResourcesBuildPhase', 'Resources', targetUuid);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Ensures all required build phases and files exist for the widget extension target.
|
|
27
|
-
*/
|
|
28
|
-
export function ensureBuildPhases(xcodeProject, options) {
|
|
29
|
-
const { targetUuid, groupName, productFile, widgetFiles } = options;
|
|
30
|
-
const buildPath = `""`;
|
|
31
|
-
const folderType = 'app_extension';
|
|
32
|
-
const mainTargetUuid = options.mainTargetUuid ?? xcodeProject.getFirstTarget().uuid;
|
|
33
|
-
const { swiftFiles, intentFiles, assetDirectories } = widgetFiles;
|
|
34
|
-
dedupeBuildPhasesForTarget(xcodeProject, targetUuid, 'PBXSourcesBuildPhase', 'Sources');
|
|
35
|
-
dedupeBuildPhasesForTarget(xcodeProject, targetUuid, 'PBXFrameworksBuildPhase', 'Frameworks');
|
|
36
|
-
dedupeBuildPhasesByComment(xcodeProject, mainTargetUuid, 'PBXCopyFilesBuildPhase', groupName);
|
|
37
|
-
// Sources build phase
|
|
38
|
-
let sourcesPhase = xcodeProject.buildPhaseObject('PBXSourcesBuildPhase', 'Sources', targetUuid);
|
|
39
|
-
if (!sourcesPhase) {
|
|
40
|
-
xcodeProject.addBuildPhase([...swiftFiles, ...intentFiles], 'PBXSourcesBuildPhase', 'Sources', targetUuid, folderType, buildPath);
|
|
41
|
-
sourcesPhase = xcodeProject.buildPhaseObject('PBXSourcesBuildPhase', 'Sources', targetUuid);
|
|
42
|
-
}
|
|
43
|
-
if (sourcesPhase) {
|
|
44
|
-
ensureBuildPhaseFiles(xcodeProject, sourcesPhase, [...swiftFiles, ...intentFiles]);
|
|
45
|
-
}
|
|
46
|
-
// Copy files build phase (embed extension into main app)
|
|
47
|
-
let copyFilesPhase = xcodeProject.buildPhaseObject('PBXCopyFilesBuildPhase', groupName, mainTargetUuid);
|
|
48
|
-
if (!copyFilesPhase) {
|
|
49
|
-
xcodeProject.addBuildPhase([], 'PBXCopyFilesBuildPhase', groupName, mainTargetUuid, folderType, buildPath);
|
|
50
|
-
copyFilesPhase = xcodeProject.buildPhaseObject('PBXCopyFilesBuildPhase', groupName, mainTargetUuid);
|
|
51
|
-
}
|
|
52
|
-
if (copyFilesPhase) {
|
|
53
|
-
ensureCopyFilesPhaseProduct(xcodeProject, copyFilesPhase, productFile);
|
|
54
|
-
}
|
|
55
|
-
// Frameworks build phase
|
|
56
|
-
const frameworksPhase = xcodeProject.buildPhaseObject('PBXFrameworksBuildPhase', 'Frameworks', targetUuid);
|
|
57
|
-
if (!frameworksPhase) {
|
|
58
|
-
xcodeProject.addBuildPhase([], 'PBXFrameworksBuildPhase', 'Frameworks', targetUuid, folderType, buildPath);
|
|
59
|
-
}
|
|
60
|
-
// Resources build phase
|
|
61
|
-
let resourcesPhase = xcodeProject.buildPhaseObject('PBXResourcesBuildPhase', 'Resources', targetUuid);
|
|
62
|
-
if (!resourcesPhase) {
|
|
63
|
-
xcodeProject.addBuildPhase([...assetDirectories], 'PBXResourcesBuildPhase', 'Resources', targetUuid);
|
|
64
|
-
resourcesPhase = xcodeProject.buildPhaseObject('PBXResourcesBuildPhase', 'Resources', targetUuid);
|
|
65
|
-
}
|
|
66
|
-
if (resourcesPhase) {
|
|
67
|
-
ensureBuildPhaseFiles(xcodeProject, resourcesPhase, [...assetDirectories]);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function dedupeBuildPhasesForTarget(xcodeProject, targetUuid, phaseType, preferredComment) {
|
|
71
|
-
const nativeTargets = xcodeProject.pbxNativeTargetSection();
|
|
72
|
-
const target = nativeTargets[targetUuid];
|
|
73
|
-
if (!target?.buildPhases) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const phaseSection = xcodeProject.hash.project.objects[phaseType] || {};
|
|
77
|
-
const matching = target.buildPhases.filter((entry) => phaseSection[entry.value]);
|
|
78
|
-
if (matching.length <= 1) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const keep = matching.find((entry) => entry.comment === preferredComment) ?? matching[0];
|
|
82
|
-
keep.comment = preferredComment;
|
|
83
|
-
target.buildPhases = target.buildPhases.filter((entry) => {
|
|
84
|
-
if (!phaseSection[entry.value]) {
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
return entry.value === keep.value;
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
function dedupeBuildPhasesByComment(xcodeProject, targetUuid, phaseType, comment) {
|
|
91
|
-
const nativeTargets = xcodeProject.pbxNativeTargetSection();
|
|
92
|
-
const target = nativeTargets[targetUuid];
|
|
93
|
-
if (!target?.buildPhases) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const phaseSection = xcodeProject.hash.project.objects[phaseType] || {};
|
|
97
|
-
const matching = target.buildPhases.filter((entry) => phaseSection[entry.value] && entry.comment === comment);
|
|
98
|
-
if (matching.length <= 1) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const keep = matching[0];
|
|
102
|
-
target.buildPhases = target.buildPhases.filter((entry) => {
|
|
103
|
-
if (!phaseSection[entry.value] || entry.comment !== comment) {
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
return entry.value === keep.value;
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
function normalizePath(value) {
|
|
110
|
-
if (!value) {
|
|
111
|
-
return '';
|
|
112
|
-
}
|
|
113
|
-
return value.replace(/^"|"$/g, '');
|
|
114
|
-
}
|
|
115
|
-
function findFileReferenceKey(xcodeProject, filePath) {
|
|
116
|
-
const fileReferenceSection = xcodeProject.pbxFileReferenceSection();
|
|
117
|
-
const normalizedPath = normalizePath(filePath);
|
|
118
|
-
for (const key of Object.keys(fileReferenceSection)) {
|
|
119
|
-
if (/_comment$/.test(key)) {
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
const entry = fileReferenceSection[key];
|
|
123
|
-
const entryPath = normalizePath(entry?.path);
|
|
124
|
-
if (entryPath === normalizedPath) {
|
|
125
|
-
return key;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
function findBuildFileKeyByFileRef(xcodeProject, fileRef) {
|
|
131
|
-
const buildFileSection = xcodeProject.pbxBuildFileSection();
|
|
132
|
-
for (const key of Object.keys(buildFileSection)) {
|
|
133
|
-
if (/_comment$/.test(key)) {
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
const entry = buildFileSection[key];
|
|
137
|
-
if (entry?.fileRef === fileRef) {
|
|
138
|
-
return key;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
function ensureFileReference(xcodeProject, filePath) {
|
|
144
|
-
const existingFileRef = findFileReferenceKey(xcodeProject, filePath);
|
|
145
|
-
const file = new pbxFile(filePath);
|
|
146
|
-
if (existingFileRef) {
|
|
147
|
-
return { fileRef: existingFileRef, basename: file.basename, group: file.group };
|
|
148
|
-
}
|
|
149
|
-
file.fileRef = xcodeProject.generateUuid();
|
|
150
|
-
xcodeProject.addToPbxFileReferenceSection(file);
|
|
151
|
-
return { fileRef: file.fileRef, basename: file.basename, group: file.group };
|
|
152
|
-
}
|
|
153
|
-
function ensureBuildFile(xcodeProject, filePath) {
|
|
154
|
-
const fileReference = ensureFileReference(xcodeProject, filePath);
|
|
155
|
-
const existingBuildFile = findBuildFileKeyByFileRef(xcodeProject, fileReference.fileRef);
|
|
156
|
-
if (existingBuildFile) {
|
|
157
|
-
return { uuid: existingBuildFile, ...fileReference };
|
|
158
|
-
}
|
|
159
|
-
const file = new pbxFile(filePath);
|
|
160
|
-
file.uuid = xcodeProject.generateUuid();
|
|
161
|
-
file.fileRef = fileReference.fileRef;
|
|
162
|
-
xcodeProject.addToPbxBuildFileSection(file);
|
|
163
|
-
return { uuid: file.uuid, ...fileReference, group: file.group };
|
|
164
|
-
}
|
|
165
|
-
function buildPhaseHasFile(xcodeProject, buildPhase, fileRef) {
|
|
166
|
-
if (!buildPhase?.files) {
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
const buildFileSection = xcodeProject.pbxBuildFileSection();
|
|
170
|
-
return buildPhase.files.some((entry) => {
|
|
171
|
-
const buildFile = buildFileSection[entry.value];
|
|
172
|
-
return buildFile?.fileRef === fileRef;
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
function ensureBuildPhaseFiles(xcodeProject, buildPhase, filePaths) {
|
|
176
|
-
if (!buildPhase.files) {
|
|
177
|
-
buildPhase.files = [];
|
|
178
|
-
}
|
|
179
|
-
for (const filePath of filePaths) {
|
|
180
|
-
const fileReference = ensureFileReference(xcodeProject, filePath);
|
|
181
|
-
if (buildPhaseHasFile(xcodeProject, buildPhase, fileReference.fileRef)) {
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
const buildFile = ensureBuildFile(xcodeProject, filePath);
|
|
185
|
-
buildPhase.files.push({
|
|
186
|
-
value: buildFile.uuid,
|
|
187
|
-
comment: util.format('%s in %s', buildFile.basename, buildFile.group),
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
function ensureCopyFilesPhaseProduct(xcodeProject, buildPhase, productFile) {
|
|
192
|
-
if (!buildPhase.files) {
|
|
193
|
-
buildPhase.files = [];
|
|
194
|
-
}
|
|
195
|
-
const alreadyExists = buildPhase.files.some((entry) => entry.value === productFile.uuid);
|
|
196
|
-
if (alreadyExists) {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
const buildFileSection = xcodeProject.pbxBuildFileSection();
|
|
200
|
-
if (!buildFileSection[productFile.uuid]) {
|
|
201
|
-
xcodeProject.addToPbxBuildFileSection(productFile);
|
|
202
|
-
}
|
|
203
|
-
buildPhase.files.push({
|
|
204
|
-
value: productFile.uuid,
|
|
205
|
-
comment: util.format('%s in %s', productFile.basename, productFile.group),
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
//# sourceMappingURL=buildPhases.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildPhases.js","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/buildPhases.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAI5B,MAAM,OAAO,GAAG,OAAO,CAAC,mBAAmB,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AC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC;KAC1E,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { IOS } from '../../constants';
|
|
2
|
-
function createCommonBuildSettings(options) {
|
|
3
|
-
const { targetName, bundleIdentifier, deploymentTarget, codeSignStyle, developmentTeam, provisioningProfileSpecifier, } = options;
|
|
4
|
-
const commonBuildSettings = {
|
|
5
|
-
PRODUCT_NAME: `"$(TARGET_NAME)"`,
|
|
6
|
-
SWIFT_VERSION: IOS.SWIFT_VERSION,
|
|
7
|
-
TARGETED_DEVICE_FAMILY: `"${IOS.DEVICE_FAMILY}"`,
|
|
8
|
-
INFOPLIST_FILE: `${targetName}/Info.plist`,
|
|
9
|
-
INFOPLIST_OUTPUT_FORMAT: `"xml"`,
|
|
10
|
-
CURRENT_PROJECT_VERSION: `"1"`,
|
|
11
|
-
MARKETING_VERSION: `"1.0"`,
|
|
12
|
-
IPHONEOS_DEPLOYMENT_TARGET: `"${deploymentTarget}"`,
|
|
13
|
-
PRODUCT_BUNDLE_IDENTIFIER: `"${bundleIdentifier}"`,
|
|
14
|
-
SWIFT_OPTIMIZATION_LEVEL: `"-Onone"`,
|
|
15
|
-
CODE_SIGN_ENTITLEMENTS: `"${targetName}/${targetName}.entitlements"`,
|
|
16
|
-
APPLICATION_EXTENSION_API_ONLY: '"YES"',
|
|
17
|
-
ASSETCATALOG_COMPILER_APPICON_NAME: '""',
|
|
18
|
-
};
|
|
19
|
-
// Synchronize code signing settings from main app target
|
|
20
|
-
if (codeSignStyle) {
|
|
21
|
-
commonBuildSettings.CODE_SIGN_STYLE = `"${codeSignStyle}"`;
|
|
22
|
-
}
|
|
23
|
-
if (developmentTeam) {
|
|
24
|
-
commonBuildSettings.DEVELOPMENT_TEAM = `"${developmentTeam}"`;
|
|
25
|
-
}
|
|
26
|
-
if (provisioningProfileSpecifier) {
|
|
27
|
-
commonBuildSettings.PROVISIONING_PROFILE_SPECIFIER = `"${provisioningProfileSpecifier}"`;
|
|
28
|
-
}
|
|
29
|
-
return commonBuildSettings;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Adds the XCConfigurationList for the widget extension target.
|
|
33
|
-
*/
|
|
34
|
-
export function addXCConfigurationList(xcodeProject, options) {
|
|
35
|
-
const { targetName } = options;
|
|
36
|
-
const commonBuildSettings = createCommonBuildSettings(options);
|
|
37
|
-
const buildConfigurationsList = [
|
|
38
|
-
{
|
|
39
|
-
name: 'Debug',
|
|
40
|
-
isa: 'XCBuildConfiguration',
|
|
41
|
-
buildSettings: {
|
|
42
|
-
...commonBuildSettings,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'Release',
|
|
47
|
-
isa: 'XCBuildConfiguration',
|
|
48
|
-
buildSettings: {
|
|
49
|
-
...commonBuildSettings,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
const xCConfigurationList = xcodeProject.addXCConfigurationList(buildConfigurationsList, 'Release', `Build configuration list for PBXNativeTarget "${targetName}"`);
|
|
54
|
-
return xCConfigurationList;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Ensures an existing XCConfigurationList is updated, or adds a new one if missing.
|
|
58
|
-
*/
|
|
59
|
-
export function ensureXCConfigurationList(xcodeProject, options, existingConfigurationListId) {
|
|
60
|
-
const configurationListId = typeof existingConfigurationListId === 'string'
|
|
61
|
-
? existingConfigurationListId.split(' ')[0]
|
|
62
|
-
: existingConfigurationListId?.value?.split(' ')[0];
|
|
63
|
-
const configurationLists = xcodeProject.pbxXCConfigurationList();
|
|
64
|
-
const configurationList = configurationListId ? configurationLists?.[configurationListId] : null;
|
|
65
|
-
if (!configurationList || !configurationList.buildConfigurations) {
|
|
66
|
-
return addXCConfigurationList(xcodeProject, options);
|
|
67
|
-
}
|
|
68
|
-
const commonBuildSettings = createCommonBuildSettings(options);
|
|
69
|
-
const buildConfigurations = configurationList.buildConfigurations;
|
|
70
|
-
const buildConfigurationSection = xcodeProject.pbxXCBuildConfigurationSection();
|
|
71
|
-
for (const configRef of buildConfigurations) {
|
|
72
|
-
const configId = typeof configRef === 'string' ? configRef.split(' ')[0] : configRef.value?.split(' ')[0];
|
|
73
|
-
if (!configId) {
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
const buildConfiguration = buildConfigurationSection[configId];
|
|
77
|
-
if (!buildConfiguration) {
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
buildConfiguration.buildSettings = {
|
|
81
|
-
...(buildConfiguration.buildSettings ?? {}),
|
|
82
|
-
...commonBuildSettings,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return { uuid: configurationListId };
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=configurationList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configurationList.js","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/configurationList.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAWrC,SAAS,yBAAyB,CAAC,OAAoC;IACrE,MAAM,EACJ,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,4BAA4B,GAC7B,GAAG,OAAO,CAAA;IAEX,MAAM,mBAAmB,GAA2B;QAClD,YAAY,EAAE,kBAAkB;QAChC,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,sBAAsB,EAAE,IAAI,GAAG,CAAC,aAAa,GAAG;QAChD,cAAc,EAAE,GAAG,UAAU,aAAa;QAC1C,uBAAuB,EAAE,OAAO;QAChC,uBAAuB,EAAE,KAAK;QAC9B,iBAAiB,EAAE,OAAO;QAC1B,0BAA0B,EAAE,IAAI,gBAAgB,GAAG;QACnD,yBAAyB,EAAE,IAAI,gBAAgB,GAAG;QAClD,wBAAwB,EAAE,UA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B,EAAE,CAAA;AACtC,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
const pbxFile = require('xcode/lib/pbxFile');
|
|
2
|
-
/**
|
|
3
|
-
* Adds a PBXGroup for the widget extension files.
|
|
4
|
-
*/
|
|
5
|
-
export function addPbxGroup(xcodeProject, options) {
|
|
6
|
-
const { targetName, widgetFiles } = options;
|
|
7
|
-
const { swiftFiles, intentFiles, assetDirectories, entitlementFiles, plistFiles } = widgetFiles;
|
|
8
|
-
// Add PBX group with all widget files
|
|
9
|
-
const { uuid: pbxGroupUuid } = xcodeProject.addPbxGroup([...swiftFiles, ...intentFiles, ...entitlementFiles, ...plistFiles, ...assetDirectories], targetName, targetName);
|
|
10
|
-
// Add PBXGroup to top level group
|
|
11
|
-
const groups = xcodeProject.hash.project.objects['PBXGroup'];
|
|
12
|
-
if (pbxGroupUuid) {
|
|
13
|
-
Object.keys(groups).forEach(function (key) {
|
|
14
|
-
if (groups[key].name === undefined && groups[key].path === undefined) {
|
|
15
|
-
xcodeProject.addToPbxGroup(pbxGroupUuid, key);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Ensures a PBXGroup exists for the widget extension files.
|
|
22
|
-
*/
|
|
23
|
-
export function ensurePbxGroup(xcodeProject, options) {
|
|
24
|
-
const { targetName, widgetFiles } = options;
|
|
25
|
-
const { swiftFiles, intentFiles, assetDirectories, entitlementFiles, plistFiles } = widgetFiles;
|
|
26
|
-
const allFiles = [...swiftFiles, ...intentFiles, ...entitlementFiles, ...plistFiles, ...assetDirectories];
|
|
27
|
-
const existingGroup = xcodeProject.pbxGroupByName(targetName);
|
|
28
|
-
if (!existingGroup) {
|
|
29
|
-
addPbxGroup(xcodeProject, options);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (!existingGroup.children) {
|
|
33
|
-
existingGroup.children = [];
|
|
34
|
-
}
|
|
35
|
-
for (const filePath of allFiles) {
|
|
36
|
-
const file = new pbxFile(filePath);
|
|
37
|
-
const fileRef = ensureFileReference(xcodeProject, filePath);
|
|
38
|
-
const alreadyInGroup = existingGroup.children.some((child) => child.value === fileRef || child.comment === file.basename);
|
|
39
|
-
if (!alreadyInGroup) {
|
|
40
|
-
existingGroup.children.push({ value: fileRef, comment: file.basename });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function ensureFileReference(xcodeProject, filePath) {
|
|
45
|
-
const fileReferenceSection = xcodeProject.pbxFileReferenceSection();
|
|
46
|
-
const file = new pbxFile(filePath);
|
|
47
|
-
for (const key of Object.keys(fileReferenceSection)) {
|
|
48
|
-
if (/_comment$/.test(key)) {
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
const entry = fileReferenceSection[key];
|
|
52
|
-
const entryPath = typeof entry?.path === 'string' ? entry.path.replace(/^"|"$/g, '') : '';
|
|
53
|
-
if (entryPath === file.path || entryPath === filePath) {
|
|
54
|
-
return key;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
file.fileRef = xcodeProject.generateUuid();
|
|
58
|
-
xcodeProject.addToPbxFileReferenceSection(file);
|
|
59
|
-
return file.fileRef;
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=groups.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groups.js","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/groups.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAO5C;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,YAA0B,EAAE,OAA2B;IACjF,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;IAC3C,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,WAAW,CAAA;IAE/F,sCAAsC;IACtC,MAAM,E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AQ,EAAE,CAAC;YACtD,OAAO,GAAG,CAAA;QACZ,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,YAAY,EAAE,CAAA;IAC1C,YAAY,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAA;IAC/C,OAAO,IAAI,CAAC,OAAO,CAAA;AACrB,CAAC"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { withXcodeProject } from '@expo/config-plugins';
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
import { getWidgetFiles } from '../../utils/fileDiscovery';
|
|
4
|
-
import { addBuildPhases, ensureBuildPhases } from './buildPhases';
|
|
5
|
-
import { addXCConfigurationList, ensureXCConfigurationList } from './configurationList';
|
|
6
|
-
import { addPbxGroup, ensurePbxGroup } from './groups';
|
|
7
|
-
import { getMainAppTargetSettings } from './mainAppSettings';
|
|
8
|
-
import { addProductFile, ensureProductFile } from './productFile';
|
|
9
|
-
import { configureTarget, ensureTargetAttributes, ensureTargetDependency } from './target';
|
|
10
|
-
/**
|
|
11
|
-
* Plugin step that configures the Xcode project for the widget extension.
|
|
12
|
-
*
|
|
13
|
-
* This:
|
|
14
|
-
* - Adds XCConfigurationList with Debug/Release configurations
|
|
15
|
-
* - Adds the product file (.appex)
|
|
16
|
-
* - Configures the native target
|
|
17
|
-
* - Adds build phases (Sources, CopyFiles, Frameworks, Resources)
|
|
18
|
-
* - Adds PBXGroup for widget files
|
|
19
|
-
*
|
|
20
|
-
* This should run after generateWidgetExtensionFiles so the files exist.
|
|
21
|
-
*/
|
|
22
|
-
export const configureXcodeProject = (config, props) => {
|
|
23
|
-
const { targetName, bundleIdentifier, deploymentTarget } = props;
|
|
24
|
-
return withXcodeProject(config, (config) => {
|
|
25
|
-
if (config.modRequest.introspect) {
|
|
26
|
-
return config;
|
|
27
|
-
}
|
|
28
|
-
const xcodeProject = config.modResults;
|
|
29
|
-
const groupName = 'Embed Foundation Extensions';
|
|
30
|
-
// Check if target already exists
|
|
31
|
-
const nativeTargets = xcodeProject.pbxNativeTargetSection();
|
|
32
|
-
const existingTargetKey = xcodeProject.findTargetKey(targetName);
|
|
33
|
-
const existingTarget = existingTargetKey ? nativeTargets[existingTargetKey] : null;
|
|
34
|
-
const { platformProjectRoot } = config.modRequest;
|
|
35
|
-
const targetPath = path.join(platformProjectRoot, targetName);
|
|
36
|
-
const widgetFiles = getWidgetFiles(targetPath, targetName);
|
|
37
|
-
// Read main app target settings to synchronize code signing
|
|
38
|
-
const mainAppSettings = getMainAppTargetSettings(xcodeProject);
|
|
39
|
-
// Use the deploymentTarget from plugin config (or default), ignore main app's deployment target
|
|
40
|
-
// This allows the widget extension to have its own deployment target independent of the main app
|
|
41
|
-
if (existingTarget && existingTargetKey) {
|
|
42
|
-
// Ensure configuration list is up to date
|
|
43
|
-
const xCConfigurationList = ensureXCConfigurationList(xcodeProject, {
|
|
44
|
-
targetName,
|
|
45
|
-
bundleIdentifier,
|
|
46
|
-
deploymentTarget,
|
|
47
|
-
codeSignStyle: mainAppSettings?.codeSignStyle,
|
|
48
|
-
developmentTeam: mainAppSettings?.developmentTeam,
|
|
49
|
-
provisioningProfileSpecifier: mainAppSettings?.provisioningProfileSpecifier,
|
|
50
|
-
}, existingTarget.buildConfigurationList);
|
|
51
|
-
// Ensure product file exists
|
|
52
|
-
const productFile = ensureProductFile(xcodeProject, {
|
|
53
|
-
targetName,
|
|
54
|
-
groupName,
|
|
55
|
-
});
|
|
56
|
-
// Update target references
|
|
57
|
-
existingTarget.productReference = productFile.fileRef;
|
|
58
|
-
existingTarget.buildConfigurationList = xCConfigurationList.uuid;
|
|
59
|
-
existingTarget.productType = `"com.apple.product-type.app-extension"`;
|
|
60
|
-
existingTarget.name = targetName;
|
|
61
|
-
existingTarget.productName = targetName;
|
|
62
|
-
if (!existingTarget.buildPhases) {
|
|
63
|
-
existingTarget.buildPhases = [];
|
|
64
|
-
}
|
|
65
|
-
// Ensure build phases and groups
|
|
66
|
-
ensureBuildPhases(xcodeProject, {
|
|
67
|
-
targetUuid: existingTargetKey,
|
|
68
|
-
groupName,
|
|
69
|
-
productFile,
|
|
70
|
-
widgetFiles,
|
|
71
|
-
mainTargetUuid: xcodeProject.getFirstTarget().uuid,
|
|
72
|
-
});
|
|
73
|
-
ensurePbxGroup(xcodeProject, {
|
|
74
|
-
targetName,
|
|
75
|
-
widgetFiles,
|
|
76
|
-
});
|
|
77
|
-
ensureTargetAttributes(xcodeProject, existingTargetKey);
|
|
78
|
-
ensureTargetDependency(xcodeProject, existingTargetKey);
|
|
79
|
-
return config;
|
|
80
|
-
}
|
|
81
|
-
// Add configuration list
|
|
82
|
-
const targetUuid = xcodeProject.generateUuid();
|
|
83
|
-
const xCConfigurationList = addXCConfigurationList(xcodeProject, {
|
|
84
|
-
targetName,
|
|
85
|
-
bundleIdentifier,
|
|
86
|
-
deploymentTarget,
|
|
87
|
-
codeSignStyle: mainAppSettings?.codeSignStyle,
|
|
88
|
-
developmentTeam: mainAppSettings?.developmentTeam,
|
|
89
|
-
provisioningProfileSpecifier: mainAppSettings?.provisioningProfileSpecifier,
|
|
90
|
-
});
|
|
91
|
-
// Add product file
|
|
92
|
-
const productFile = addProductFile(xcodeProject, {
|
|
93
|
-
targetName,
|
|
94
|
-
groupName,
|
|
95
|
-
});
|
|
96
|
-
// Configure target (native target, project section, dependency)
|
|
97
|
-
configureTarget(xcodeProject, {
|
|
98
|
-
targetName,
|
|
99
|
-
targetUuid,
|
|
100
|
-
productFile,
|
|
101
|
-
xCConfigurationList,
|
|
102
|
-
});
|
|
103
|
-
// Add build phases
|
|
104
|
-
addBuildPhases(xcodeProject, {
|
|
105
|
-
targetUuid,
|
|
106
|
-
groupName,
|
|
107
|
-
productFile,
|
|
108
|
-
widgetFiles,
|
|
109
|
-
});
|
|
110
|
-
// Add PBX group
|
|
111
|
-
addPbxGroup(xcodeProject, {
|
|
112
|
-
targetName,
|
|
113
|
-
widgetFiles,
|
|
114
|
-
});
|
|
115
|
-
return config;
|
|
116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reads build settings from the main app target to synchronize code signing with the widget extension.
|
|
3
|
-
*
|
|
4
|
-
* @param xcodeProject The Xcode project instance
|
|
5
|
-
* @returns The main app target's build settings, or null if not found
|
|
6
|
-
*/
|
|
7
|
-
export function getMainAppTargetSettings(xcodeProject) {
|
|
8
|
-
try {
|
|
9
|
-
const mainAppTarget = xcodeProject.getFirstTarget()?.firstTarget;
|
|
10
|
-
if (!mainAppTarget) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
// Get the build configuration list for the main app target
|
|
14
|
-
const buildConfigurationListId = mainAppTarget.buildConfigurationList;
|
|
15
|
-
if (!buildConfigurationListId) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
// Extract UUID from buildConfigurationListId (it might include a comment like "UUID /* comment */")
|
|
19
|
-
const buildConfigurationListUuid = buildConfigurationListId.split(' ')[0];
|
|
20
|
-
const buildConfigurationList = xcodeProject.hash.project.objects['XCConfigurationList']?.[buildConfigurationListUuid];
|
|
21
|
-
if (!buildConfigurationList || !buildConfigurationList.buildConfigurations) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
// Get the first build configuration (usually Debug) to read settings
|
|
25
|
-
const firstConfigRef = buildConfigurationList.buildConfigurations[0];
|
|
26
|
-
if (!firstConfigRef) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
// Extract UUID from config reference (it might include a comment)
|
|
30
|
-
const firstConfigUuid = typeof firstConfigRef === 'string' ? firstConfigRef.split(' ')[0] : firstConfigRef.value?.split(' ')[0];
|
|
31
|
-
if (!firstConfigUuid) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
const buildConfiguration = xcodeProject.hash.project.objects['XCBuildConfiguration']?.[firstConfigUuid];
|
|
35
|
-
if (!buildConfiguration || !buildConfiguration.buildSettings) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
const buildSettings = buildConfiguration.buildSettings;
|
|
39
|
-
// Extract deployment target (remove quotes if present)
|
|
40
|
-
const deploymentTarget = buildSettings.IPHONEOS_DEPLOYMENT_TARGET?.replace(/^"|"$/g, '') ||
|
|
41
|
-
buildSettings['IPHONEOS_DEPLOYMENT_TARGET']?.replace(/^"|"$/g, '') ||
|
|
42
|
-
null;
|
|
43
|
-
// Extract code signing settings
|
|
44
|
-
const codeSignStyle = buildSettings.CODE_SIGN_STYLE?.replace(/^"|"$/g, '') ||
|
|
45
|
-
buildSettings['CODE_SIGN_STYLE']?.replace(/^"|"$/g, '') ||
|
|
46
|
-
null;
|
|
47
|
-
const developmentTeam = buildSettings.DEVELOPMENT_TEAM?.replace(/^"|"$/g, '') ||
|
|
48
|
-
buildSettings['DEVELOPMENT_TEAM']?.replace(/^"|"$/g, '') ||
|
|
49
|
-
null;
|
|
50
|
-
const provisioningProfileSpecifier = buildSettings.PROVISIONING_PROFILE_SPECIFIER?.replace(/^"|"$/g, '') ||
|
|
51
|
-
buildSettings['PROVISIONING_PROFILE_SPECIFIER']?.replace(/^"|"$/g, '') ||
|
|
52
|
-
null;
|
|
53
|
-
if (!deploymentTarget) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
deploymentTarget,
|
|
58
|
-
codeSignStyle: codeSignStyle || undefined,
|
|
59
|
-
developmentTeam: developmentTeam || undefined,
|
|
60
|
-
provisioningProfileSpecifier: provisioningProfileSpecifier || undefined,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
// If we can't read the settings, return null and use fallback values
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=mainAppSettings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mainAppSettings.js","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/mainAppSettings.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,YAA0B;IACjE,IAAI,CAA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