@expo/config-plugins 5.0.4 → 6.0.0
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/build/Plugin.types.d.ts +7 -7
- package/build/Plugin.types.js +0 -9
- package/build/Plugin.types.js.map +1 -1
- package/build/android/AllowBackup.js +0 -15
- package/build/android/AllowBackup.js.map +1 -1
- package/build/android/BuildProperties.js +2 -16
- package/build/android/BuildProperties.js.map +1 -1
- package/build/android/Colors.js +3 -25
- package/build/android/Colors.js.map +1 -1
- package/build/android/EasBuild.js +2 -22
- package/build/android/EasBuild.js.map +1 -1
- package/build/android/EasBuildGradleScript.js.map +1 -1
- package/build/android/GoogleMapsApiKey.js +0 -12
- package/build/android/GoogleMapsApiKey.js.map +1 -1
- package/build/android/GoogleServices.js +10 -48
- package/build/android/GoogleServices.js.map +1 -1
- package/build/android/IntentFilters.d.ts +1 -1
- package/build/android/IntentFilters.js +8 -24
- package/build/android/IntentFilters.js.map +1 -1
- package/build/android/Manifest.d.ts +19 -19
- package/build/android/Manifest.js +7 -66
- package/build/android/Manifest.js.map +1 -1
- package/build/android/Name.js +6 -27
- package/build/android/Name.js.map +1 -1
- package/build/android/Orientation.js +2 -12
- package/build/android/Orientation.js.map +1 -1
- package/build/android/Package.js +26 -111
- package/build/android/Package.js.map +1 -1
- package/build/android/Paths.d.ts +2 -2
- package/build/android/Paths.js +0 -47
- package/build/android/Paths.js.map +1 -1
- package/build/android/Permissions.js +8 -52
- package/build/android/Permissions.js.map +1 -1
- package/build/android/PrimaryColor.js +0 -18
- package/build/android/PrimaryColor.js.map +1 -1
- package/build/android/Properties.d.ts +1 -1
- package/build/android/Properties.js +0 -9
- package/build/android/Properties.js.map +1 -1
- package/build/android/Resources.d.ts +4 -4
- package/build/android/Resources.js +9 -29
- package/build/android/Resources.js.map +1 -1
- package/build/android/Scheme.d.ts +1 -1
- package/build/android/Scheme.js +13 -66
- package/build/android/Scheme.js.map +1 -1
- package/build/android/StatusBar.js +5 -33
- package/build/android/StatusBar.js.map +1 -1
- package/build/android/Strings.js +0 -14
- package/build/android/Strings.js.map +1 -1
- package/build/android/Styles.js +7 -34
- package/build/android/Styles.js.map +1 -1
- package/build/android/Updates.d.ts +2 -0
- package/build/android/Updates.js +50 -47
- package/build/android/Updates.js.map +1 -1
- package/build/android/Version.js +3 -29
- package/build/android/Version.js.map +1 -1
- package/build/android/WindowSoftInputMode.js +0 -14
- package/build/android/WindowSoftInputMode.js.map +1 -1
- package/build/android/codeMod.js +6 -22
- package/build/android/codeMod.js.map +1 -1
- package/build/android/index.js +0 -94
- package/build/android/index.js.map +1 -1
- package/build/index.js +2 -65
- package/build/index.js.map +1 -1
- package/build/ios/Bitcode.d.ts +1 -1
- package/build/ios/Bitcode.js +8 -28
- package/build/ios/Bitcode.js.map +1 -1
- package/build/ios/BuildProperties.js +2 -14
- package/build/ios/BuildProperties.js.map +1 -1
- package/build/ios/BuildScheme.js +2 -34
- package/build/ios/BuildScheme.js.map +1 -1
- package/build/ios/BundleIdentifier.js +13 -72
- package/build/ios/BundleIdentifier.js.map +1 -1
- package/build/ios/DeviceFamily.js +6 -24
- package/build/ios/DeviceFamily.js.map +1 -1
- package/build/ios/Entitlements.js +4 -45
- package/build/ios/Entitlements.js.map +1 -1
- package/build/ios/Google.d.ts +2 -2
- package/build/ios/Google.js +11 -66
- package/build/ios/Google.js.map +1 -1
- package/build/ios/IosConfig.types.d.ts +6 -11
- package/build/ios/IosConfig.types.js.map +1 -1
- package/build/ios/Locales.d.ts +3 -3
- package/build/ios/Locales.js +12 -43
- package/build/ios/Locales.js.map +1 -1
- package/build/ios/Maps.js +15 -53
- package/build/ios/Maps.js.map +1 -1
- package/build/ios/Name.js +7 -31
- package/build/ios/Name.js.map +1 -1
- package/build/ios/Orientation.js +2 -10
- package/build/ios/Orientation.js.map +1 -1
- package/build/ios/Paths.d.ts +2 -2
- package/build/ios/Paths.js +8 -73
- package/build/ios/Paths.js.map +1 -1
- package/build/ios/Permissions.js +1 -16
- package/build/ios/Permissions.js.map +1 -1
- package/build/ios/ProvisioningProfile.d.ts +1 -1
- package/build/ios/ProvisioningProfile.js +0 -18
- package/build/ios/ProvisioningProfile.js.map +1 -1
- package/build/ios/RequiresFullScreen.js +19 -31
- package/build/ios/RequiresFullScreen.js.map +1 -1
- package/build/ios/Scheme.js +10 -32
- package/build/ios/Scheme.js.map +1 -1
- package/build/ios/Swift.js +16 -50
- package/build/ios/Swift.js.map +1 -1
- package/build/ios/Target.js +0 -30
- package/build/ios/Target.js.map +1 -1
- package/build/ios/Updates.js +10 -49
- package/build/ios/Updates.js.map +1 -1
- package/build/ios/UsesNonExemptEncryption.js +4 -10
- package/build/ios/UsesNonExemptEncryption.js.map +1 -1
- package/build/ios/Version.js +4 -11
- package/build/ios/Version.js.map +1 -1
- package/build/ios/XcodeProjectFile.js +5 -23
- package/build/ios/XcodeProjectFile.js.map +1 -1
- package/build/ios/codeMod.js +19 -60
- package/build/ios/codeMod.js.map +1 -1
- package/build/ios/index.js +0 -97
- package/build/ios/index.js.map +1 -1
- package/build/ios/utils/Xcodeproj.d.ts +6 -6
- package/build/ios/utils/Xcodeproj.js +15 -101
- package/build/ios/utils/Xcodeproj.js.map +1 -1
- package/build/ios/utils/getInfoPlistPath.js +2 -15
- package/build/ios/utils/getInfoPlistPath.js.map +1 -1
- package/build/ios/utils/string.js +0 -1
- package/build/ios/utils/string.js.map +1 -1
- package/build/plugins/android-plugins.d.ts +2 -2
- package/build/plugins/android-plugins.js +11 -42
- package/build/plugins/android-plugins.js.map +1 -1
- package/build/plugins/createBaseMod.d.ts +3 -3
- package/build/plugins/createBaseMod.js +8 -25
- package/build/plugins/createBaseMod.js.map +1 -1
- package/build/plugins/ios-plugins.d.ts +2 -2
- package/build/plugins/ios-plugins.js +8 -48
- package/build/plugins/ios-plugins.js.map +1 -1
- package/build/plugins/mod-compiler.js +21 -72
- package/build/plugins/mod-compiler.js.map +1 -1
- package/build/plugins/withAndroidBaseMods.d.ts +1 -1
- package/build/plugins/withAndroidBaseMods.js +4 -89
- package/build/plugins/withAndroidBaseMods.js.map +1 -1
- package/build/plugins/withDangerousMod.js +0 -5
- package/build/plugins/withDangerousMod.js.map +1 -1
- package/build/plugins/withIosBaseMods.d.ts +1 -1
- package/build/plugins/withIosBaseMods.js +26 -118
- package/build/plugins/withIosBaseMods.js.map +1 -1
- package/build/plugins/withMod.d.ts +1 -1
- package/build/plugins/withMod.js +24 -59
- package/build/plugins/withMod.js.map +1 -1
- package/build/plugins/withPlugins.js +0 -9
- package/build/plugins/withPlugins.js.map +1 -1
- package/build/plugins/withRunOnce.js +3 -9
- package/build/plugins/withRunOnce.js.map +1 -1
- package/build/plugins/withStaticPlugin.js +21 -43
- package/build/plugins/withStaticPlugin.js.map +1 -1
- package/build/utils/BuildProperties.types.d.ts +2 -2
- package/build/utils/BuildProperties.types.js.map +1 -1
- package/build/utils/Updates.d.ts +3 -1
- package/build/utils/Updates.js +18 -77
- package/build/utils/Updates.js.map +1 -1
- package/build/utils/XML.d.ts +1 -1
- package/build/utils/XML.js +7 -44
- package/build/utils/XML.js.map +1 -1
- package/build/utils/commonCodeMod.js +2 -10
- package/build/utils/commonCodeMod.js.map +1 -1
- package/build/utils/errors.d.ts +1 -1
- package/build/utils/errors.js +3 -11
- package/build/utils/errors.js.map +1 -1
- package/build/utils/fs.js +1 -12
- package/build/utils/fs.js.map +1 -1
- package/build/utils/generateCode.d.ts +1 -1
- package/build/utils/generateCode.js +8 -25
- package/build/utils/generateCode.js.map +1 -1
- package/build/utils/history.d.ts +1 -1
- package/build/utils/history.js +0 -6
- package/build/utils/history.js.map +1 -1
- package/build/utils/matchBrackets.d.ts +3 -3
- package/build/utils/matchBrackets.js +2 -17
- package/build/utils/matchBrackets.js.map +1 -1
- package/build/utils/modules.js +0 -10
- package/build/utils/modules.js.map +1 -1
- package/build/utils/obj.js +0 -4
- package/build/utils/obj.js.map +1 -1
- package/build/utils/plugin-resolver.js +25 -69
- package/build/utils/plugin-resolver.js.map +1 -1
- package/build/utils/sortObject.js +4 -10
- package/build/utils/sortObject.js.map +1 -1
- package/build/utils/versions.js +0 -10
- package/build/utils/versions.js.map +1 -1
- package/build/utils/warnings.js +1 -9
- package/build/utils/warnings.js.map +1 -1
- package/package.json +5 -5
package/build/ios/BuildScheme.js
CHANGED
|
@@ -7,51 +7,37 @@ exports.getApplicationTargetNameForSchemeAsync = getApplicationTargetNameForSche
|
|
|
7
7
|
exports.getArchiveBuildConfigurationForSchemeAsync = getArchiveBuildConfigurationForSchemeAsync;
|
|
8
8
|
exports.getRunnableSchemesFromXcodeproj = getRunnableSchemesFromXcodeproj;
|
|
9
9
|
exports.getSchemesFromXcodeproj = getSchemesFromXcodeproj;
|
|
10
|
-
|
|
11
10
|
function _XML() {
|
|
12
11
|
const data = require("../utils/XML");
|
|
13
|
-
|
|
14
12
|
_XML = function () {
|
|
15
13
|
return data;
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
return data;
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
function _Paths() {
|
|
22
18
|
const data = require("./Paths");
|
|
23
|
-
|
|
24
19
|
_Paths = function () {
|
|
25
20
|
return data;
|
|
26
21
|
};
|
|
27
|
-
|
|
28
22
|
return data;
|
|
29
23
|
}
|
|
30
|
-
|
|
31
24
|
function _Target() {
|
|
32
25
|
const data = require("./Target");
|
|
33
|
-
|
|
34
26
|
_Target = function () {
|
|
35
27
|
return data;
|
|
36
28
|
};
|
|
37
|
-
|
|
38
29
|
return data;
|
|
39
30
|
}
|
|
40
|
-
|
|
41
31
|
function _Xcodeproj() {
|
|
42
32
|
const data = require("./utils/Xcodeproj");
|
|
43
|
-
|
|
44
33
|
_Xcodeproj = function () {
|
|
45
34
|
return data;
|
|
46
35
|
};
|
|
47
|
-
|
|
48
36
|
return data;
|
|
49
37
|
}
|
|
50
|
-
|
|
51
38
|
function getSchemesFromXcodeproj(projectRoot) {
|
|
52
39
|
return (0, _Paths().findSchemeNames)(projectRoot);
|
|
53
40
|
}
|
|
54
|
-
|
|
55
41
|
function getRunnableSchemesFromXcodeproj(projectRoot, {
|
|
56
42
|
configuration = 'Debug'
|
|
57
43
|
} = {}) {
|
|
@@ -59,25 +45,21 @@ function getRunnableSchemesFromXcodeproj(projectRoot, {
|
|
|
59
45
|
return (0, _Target().findSignableTargets)(project).map(([, target]) => {
|
|
60
46
|
let osType = 'iOS';
|
|
61
47
|
const type = (0, _Xcodeproj().unquote)(target.productType);
|
|
62
|
-
|
|
63
48
|
if (type === _Target().TargetType.WATCH) {
|
|
64
49
|
osType = 'watchOS';
|
|
65
|
-
} else if (
|
|
50
|
+
} else if (
|
|
51
|
+
// (apps) com.apple.product-type.application
|
|
66
52
|
// (app clips) com.apple.product-type.application.on-demand-install-capable
|
|
67
53
|
// NOTE(EvanBacon): This matches against `watchOS` as well so we check for watch first.
|
|
68
54
|
type.startsWith(_Target().TargetType.APPLICATION)) {
|
|
69
55
|
// Attempt to resolve the platform SDK for each target so we can filter devices.
|
|
70
56
|
const xcConfigurationList = project.hash.project.objects.XCConfigurationList[target.buildConfigurationList];
|
|
71
|
-
|
|
72
57
|
if (xcConfigurationList) {
|
|
73
58
|
const buildConfiguration = xcConfigurationList.buildConfigurations.find(value => value.comment === configuration) || xcConfigurationList.buildConfigurations[0];
|
|
74
|
-
|
|
75
59
|
if (buildConfiguration !== null && buildConfiguration !== void 0 && buildConfiguration.value) {
|
|
76
60
|
var _project$hash$project;
|
|
77
|
-
|
|
78
61
|
const xcBuildConfiguration = (_project$hash$project = project.hash.project.objects.XCBuildConfiguration) === null || _project$hash$project === void 0 ? void 0 : _project$hash$project[buildConfiguration.value];
|
|
79
62
|
const buildSdkRoot = xcBuildConfiguration.buildSettings.SDKROOT;
|
|
80
|
-
|
|
81
63
|
if (buildSdkRoot === 'appletvos' || 'TVOS_DEPLOYMENT_TARGET' in xcBuildConfiguration.buildSettings) {
|
|
82
64
|
// Is a TV app...
|
|
83
65
|
osType = 'tvOS';
|
|
@@ -87,7 +69,6 @@ function getRunnableSchemesFromXcodeproj(projectRoot, {
|
|
|
87
69
|
}
|
|
88
70
|
}
|
|
89
71
|
}
|
|
90
|
-
|
|
91
72
|
return {
|
|
92
73
|
name: (0, _Xcodeproj().unquote)(target.name),
|
|
93
74
|
osType,
|
|
@@ -95,12 +76,10 @@ function getRunnableSchemesFromXcodeproj(projectRoot, {
|
|
|
95
76
|
};
|
|
96
77
|
});
|
|
97
78
|
}
|
|
98
|
-
|
|
99
79
|
async function readSchemeAsync(projectRoot, scheme) {
|
|
100
80
|
const allSchemePaths = (0, _Paths().findSchemePaths)(projectRoot);
|
|
101
81
|
const re = new RegExp(`/${scheme}.xcscheme`, 'i');
|
|
102
82
|
const schemePath = allSchemePaths.find(i => re.exec(i));
|
|
103
|
-
|
|
104
83
|
if (schemePath) {
|
|
105
84
|
return await (0, _XML().readXMLAsync)({
|
|
106
85
|
path: schemePath
|
|
@@ -109,41 +88,30 @@ async function readSchemeAsync(projectRoot, scheme) {
|
|
|
109
88
|
throw new Error(`scheme '${scheme}' does not exist, make sure it's marked as shared`);
|
|
110
89
|
}
|
|
111
90
|
}
|
|
112
|
-
|
|
113
91
|
async function getApplicationTargetNameForSchemeAsync(projectRoot, scheme) {
|
|
114
92
|
var _schemeXML$Scheme, _schemeXML$Scheme$Bui, _schemeXML$Scheme$Bui2, _schemeXML$Scheme$Bui3, _schemeXML$Scheme$Bui4;
|
|
115
|
-
|
|
116
93
|
const schemeXML = await readSchemeAsync(projectRoot, scheme);
|
|
117
94
|
const buildActionEntry = schemeXML === null || schemeXML === void 0 ? void 0 : (_schemeXML$Scheme = schemeXML.Scheme) === null || _schemeXML$Scheme === void 0 ? void 0 : (_schemeXML$Scheme$Bui = _schemeXML$Scheme.BuildAction) === null || _schemeXML$Scheme$Bui === void 0 ? void 0 : (_schemeXML$Scheme$Bui2 = _schemeXML$Scheme$Bui[0]) === null || _schemeXML$Scheme$Bui2 === void 0 ? void 0 : (_schemeXML$Scheme$Bui3 = _schemeXML$Scheme$Bui2.BuildActionEntries) === null || _schemeXML$Scheme$Bui3 === void 0 ? void 0 : (_schemeXML$Scheme$Bui4 = _schemeXML$Scheme$Bui3[0]) === null || _schemeXML$Scheme$Bui4 === void 0 ? void 0 : _schemeXML$Scheme$Bui4.BuildActionEntry;
|
|
118
95
|
const targetName = (buildActionEntry === null || buildActionEntry === void 0 ? void 0 : buildActionEntry.length) === 1 ? getBlueprintName(buildActionEntry[0]) : getBlueprintName(buildActionEntry === null || buildActionEntry === void 0 ? void 0 : buildActionEntry.find(entry => {
|
|
119
96
|
var _entry$BuildableRefer, _entry$BuildableRefer2, _entry$BuildableRefer3, _entry$BuildableRefer4;
|
|
120
|
-
|
|
121
97
|
return (_entry$BuildableRefer = entry.BuildableReference) === null || _entry$BuildableRefer === void 0 ? void 0 : (_entry$BuildableRefer2 = _entry$BuildableRefer[0]) === null || _entry$BuildableRefer2 === void 0 ? void 0 : (_entry$BuildableRefer3 = _entry$BuildableRefer2['$']) === null || _entry$BuildableRefer3 === void 0 ? void 0 : (_entry$BuildableRefer4 = _entry$BuildableRefer3.BuildableName) === null || _entry$BuildableRefer4 === void 0 ? void 0 : _entry$BuildableRefer4.endsWith('.app');
|
|
122
98
|
}));
|
|
123
|
-
|
|
124
99
|
if (!targetName) {
|
|
125
100
|
throw new Error(`${scheme}.xcscheme seems to be corrupted`);
|
|
126
101
|
}
|
|
127
|
-
|
|
128
102
|
return targetName;
|
|
129
103
|
}
|
|
130
|
-
|
|
131
104
|
async function getArchiveBuildConfigurationForSchemeAsync(projectRoot, scheme) {
|
|
132
105
|
var _schemeXML$Scheme2, _schemeXML$Scheme2$Ar, _schemeXML$Scheme2$Ar2, _schemeXML$Scheme2$Ar3;
|
|
133
|
-
|
|
134
106
|
const schemeXML = await readSchemeAsync(projectRoot, scheme);
|
|
135
107
|
const buildConfiguration = schemeXML === null || schemeXML === void 0 ? void 0 : (_schemeXML$Scheme2 = schemeXML.Scheme) === null || _schemeXML$Scheme2 === void 0 ? void 0 : (_schemeXML$Scheme2$Ar = _schemeXML$Scheme2.ArchiveAction) === null || _schemeXML$Scheme2$Ar === void 0 ? void 0 : (_schemeXML$Scheme2$Ar2 = _schemeXML$Scheme2$Ar[0]) === null || _schemeXML$Scheme2$Ar2 === void 0 ? void 0 : (_schemeXML$Scheme2$Ar3 = _schemeXML$Scheme2$Ar2['$']) === null || _schemeXML$Scheme2$Ar3 === void 0 ? void 0 : _schemeXML$Scheme2$Ar3.buildConfiguration;
|
|
136
|
-
|
|
137
108
|
if (!buildConfiguration) {
|
|
138
109
|
throw new Error(`${scheme}.xcscheme seems to be corrupted`);
|
|
139
110
|
}
|
|
140
|
-
|
|
141
111
|
return buildConfiguration;
|
|
142
112
|
}
|
|
143
|
-
|
|
144
113
|
function getBlueprintName(entry) {
|
|
145
114
|
var _entry$BuildableRefer5, _entry$BuildableRefer6, _entry$BuildableRefer7;
|
|
146
|
-
|
|
147
115
|
return entry === null || entry === void 0 ? void 0 : (_entry$BuildableRefer5 = entry.BuildableReference) === null || _entry$BuildableRefer5 === void 0 ? void 0 : (_entry$BuildableRefer6 = _entry$BuildableRefer5[0]) === null || _entry$BuildableRefer6 === void 0 ? void 0 : (_entry$BuildableRefer7 = _entry$BuildableRefer6['$']) === null || _entry$BuildableRefer7 === void 0 ? void 0 : _entry$BuildableRefer7.BlueprintName;
|
|
148
116
|
}
|
|
149
117
|
//# sourceMappingURL=BuildScheme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildScheme.js","names":["getSchemesFromXcodeproj","projectRoot","findSchemeNames","getRunnableSchemesFromXcodeproj","configuration","project","getPbxproj","findSignableTargets","map","target","osType","type","unquote","productType","TargetType","WATCH","startsWith","APPLICATION","xcConfigurationList","hash","objects","XCConfigurationList","buildConfigurationList","buildConfiguration","buildConfigurations","find","value","comment","xcBuildConfiguration","XCBuildConfiguration","buildSdkRoot","buildSettings","SDKROOT","name","readSchemeAsync","scheme","allSchemePaths","findSchemePaths","re","RegExp","schemePath","i","exec","readXMLAsync","path","Error","getApplicationTargetNameForSchemeAsync","schemeXML","buildActionEntry","Scheme","BuildAction","BuildActionEntries","BuildActionEntry","targetName","length","getBlueprintName","entry","BuildableReference","BuildableName","endsWith","getArchiveBuildConfigurationForSchemeAsync","ArchiveAction","BlueprintName"],"sources":["../../src/ios/BuildScheme.ts"],"sourcesContent":["import { readXMLAsync } from '../utils/XML';\nimport { findSchemeNames, findSchemePaths } from './Paths';\nimport { findSignableTargets, TargetType } from './Target';\nimport { getPbxproj, unquote } from './utils/Xcodeproj';\n\ninterface SchemeXML {\n Scheme?: {\n BuildAction?: {\n BuildActionEntries?: {\n BuildActionEntry?: BuildActionEntryType[];\n }[];\n }[];\n ArchiveAction?: {\n $?: {\n buildConfiguration?: string;\n };\n }[];\n };\n}\n\ninterface BuildActionEntryType {\n BuildableReference?: {\n $?: {\n BlueprintName?: string;\n BuildableName?: string;\n };\n }[];\n}\n\nexport function getSchemesFromXcodeproj(projectRoot: string): string[] {\n return findSchemeNames(projectRoot);\n}\n\nexport function getRunnableSchemesFromXcodeproj(\n projectRoot: string,\n { configuration = 'Debug' }: { configuration?: 'Debug' | 'Release' } = {}\n): { name: string; osType: string; type: string }[] {\n const project = getPbxproj(projectRoot);\n\n return findSignableTargets(project).map(([, target]) => {\n let osType = 'iOS';\n const type = unquote(target.productType);\n\n if (type === TargetType.WATCH) {\n osType = 'watchOS';\n } else if (\n // (apps) com.apple.product-type.application\n // (app clips) com.apple.product-type.application.on-demand-install-capable\n // NOTE(EvanBacon): This matches against `watchOS` as well so we check for watch first.\n type.startsWith(TargetType.APPLICATION)\n ) {\n // Attempt to resolve the platform SDK for each target so we can filter devices.\n const xcConfigurationList =\n project.hash.project.objects.XCConfigurationList[target.buildConfigurationList];\n\n if (xcConfigurationList) {\n const buildConfiguration =\n xcConfigurationList.buildConfigurations.find(\n (value: { comment: string; value: string }) => value.comment === configuration\n ) || xcConfigurationList.buildConfigurations[0];\n if (buildConfiguration?.value) {\n const xcBuildConfiguration =\n project.hash.project.objects.XCBuildConfiguration?.[buildConfiguration.value];\n\n const buildSdkRoot = xcBuildConfiguration.buildSettings.SDKROOT;\n if (\n buildSdkRoot === 'appletvos' ||\n 'TVOS_DEPLOYMENT_TARGET' in xcBuildConfiguration.buildSettings\n ) {\n // Is a TV app...\n osType = 'tvOS';\n } else if (buildSdkRoot === 'iphoneos') {\n osType = 'iOS';\n }\n }\n }\n }\n\n return {\n name: unquote(target.name),\n osType,\n type: unquote(target.productType),\n };\n });\n}\n\nasync function readSchemeAsync(\n projectRoot: string,\n scheme: string\n): Promise<SchemeXML | undefined> {\n const allSchemePaths = findSchemePaths(projectRoot);\n const re = new RegExp(`/${scheme}.xcscheme`, 'i');\n const schemePath = allSchemePaths.find((i) => re.exec(i));\n if (schemePath) {\n return (await readXMLAsync({ path: schemePath })) as unknown as SchemeXML | undefined;\n } else {\n throw new Error(`scheme '${scheme}' does not exist, make sure it's marked as shared`);\n }\n}\n\nexport async function getApplicationTargetNameForSchemeAsync(\n projectRoot: string,\n scheme: string\n): Promise<string> {\n const schemeXML = await readSchemeAsync(projectRoot, scheme);\n const buildActionEntry =\n schemeXML?.Scheme?.BuildAction?.[0]?.BuildActionEntries?.[0]?.BuildActionEntry;\n const targetName =\n buildActionEntry?.length === 1\n ? getBlueprintName(buildActionEntry[0])\n : getBlueprintName(\n buildActionEntry?.find((entry) => {\n return entry.BuildableReference?.[0]?.['$']?.BuildableName?.endsWith('.app');\n })\n );\n if (!targetName) {\n throw new Error(`${scheme}.xcscheme seems to be corrupted`);\n }\n return targetName;\n}\n\nexport async function getArchiveBuildConfigurationForSchemeAsync(\n projectRoot: string,\n scheme: string\n): Promise<string> {\n const schemeXML = await readSchemeAsync(projectRoot, scheme);\n const buildConfiguration = schemeXML?.Scheme?.ArchiveAction?.[0]?.['$']?.buildConfiguration;\n if (!buildConfiguration) {\n throw new Error(`${scheme}.xcscheme seems to be corrupted`);\n }\n return buildConfiguration;\n}\n\nfunction getBlueprintName(entry?: BuildActionEntryType): string | undefined {\n return entry?.BuildableReference?.[0]?.['$']?.BlueprintName;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"BuildScheme.js","names":["getSchemesFromXcodeproj","projectRoot","findSchemeNames","getRunnableSchemesFromXcodeproj","configuration","project","getPbxproj","findSignableTargets","map","target","osType","type","unquote","productType","TargetType","WATCH","startsWith","APPLICATION","xcConfigurationList","hash","objects","XCConfigurationList","buildConfigurationList","buildConfiguration","buildConfigurations","find","value","comment","xcBuildConfiguration","XCBuildConfiguration","buildSdkRoot","buildSettings","SDKROOT","name","readSchemeAsync","scheme","allSchemePaths","findSchemePaths","re","RegExp","schemePath","i","exec","readXMLAsync","path","Error","getApplicationTargetNameForSchemeAsync","schemeXML","buildActionEntry","Scheme","BuildAction","BuildActionEntries","BuildActionEntry","targetName","length","getBlueprintName","entry","BuildableReference","BuildableName","endsWith","getArchiveBuildConfigurationForSchemeAsync","ArchiveAction","BlueprintName"],"sources":["../../src/ios/BuildScheme.ts"],"sourcesContent":["import { readXMLAsync } from '../utils/XML';\nimport { findSchemeNames, findSchemePaths } from './Paths';\nimport { findSignableTargets, TargetType } from './Target';\nimport { getPbxproj, unquote } from './utils/Xcodeproj';\n\ninterface SchemeXML {\n Scheme?: {\n BuildAction?: {\n BuildActionEntries?: {\n BuildActionEntry?: BuildActionEntryType[];\n }[];\n }[];\n ArchiveAction?: {\n $?: {\n buildConfiguration?: string;\n };\n }[];\n };\n}\n\ninterface BuildActionEntryType {\n BuildableReference?: {\n $?: {\n BlueprintName?: string;\n BuildableName?: string;\n };\n }[];\n}\n\nexport function getSchemesFromXcodeproj(projectRoot: string): string[] {\n return findSchemeNames(projectRoot);\n}\n\nexport function getRunnableSchemesFromXcodeproj(\n projectRoot: string,\n { configuration = 'Debug' }: { configuration?: 'Debug' | 'Release' } = {}\n): { name: string; osType: string; type: string }[] {\n const project = getPbxproj(projectRoot);\n\n return findSignableTargets(project).map(([, target]) => {\n let osType = 'iOS';\n const type = unquote(target.productType);\n\n if (type === TargetType.WATCH) {\n osType = 'watchOS';\n } else if (\n // (apps) com.apple.product-type.application\n // (app clips) com.apple.product-type.application.on-demand-install-capable\n // NOTE(EvanBacon): This matches against `watchOS` as well so we check for watch first.\n type.startsWith(TargetType.APPLICATION)\n ) {\n // Attempt to resolve the platform SDK for each target so we can filter devices.\n const xcConfigurationList =\n project.hash.project.objects.XCConfigurationList[target.buildConfigurationList];\n\n if (xcConfigurationList) {\n const buildConfiguration =\n xcConfigurationList.buildConfigurations.find(\n (value: { comment: string; value: string }) => value.comment === configuration\n ) || xcConfigurationList.buildConfigurations[0];\n if (buildConfiguration?.value) {\n const xcBuildConfiguration =\n project.hash.project.objects.XCBuildConfiguration?.[buildConfiguration.value];\n\n const buildSdkRoot = xcBuildConfiguration.buildSettings.SDKROOT;\n if (\n buildSdkRoot === 'appletvos' ||\n 'TVOS_DEPLOYMENT_TARGET' in xcBuildConfiguration.buildSettings\n ) {\n // Is a TV app...\n osType = 'tvOS';\n } else if (buildSdkRoot === 'iphoneos') {\n osType = 'iOS';\n }\n }\n }\n }\n\n return {\n name: unquote(target.name),\n osType,\n type: unquote(target.productType),\n };\n });\n}\n\nasync function readSchemeAsync(\n projectRoot: string,\n scheme: string\n): Promise<SchemeXML | undefined> {\n const allSchemePaths = findSchemePaths(projectRoot);\n const re = new RegExp(`/${scheme}.xcscheme`, 'i');\n const schemePath = allSchemePaths.find((i) => re.exec(i));\n if (schemePath) {\n return (await readXMLAsync({ path: schemePath })) as unknown as SchemeXML | undefined;\n } else {\n throw new Error(`scheme '${scheme}' does not exist, make sure it's marked as shared`);\n }\n}\n\nexport async function getApplicationTargetNameForSchemeAsync(\n projectRoot: string,\n scheme: string\n): Promise<string> {\n const schemeXML = await readSchemeAsync(projectRoot, scheme);\n const buildActionEntry =\n schemeXML?.Scheme?.BuildAction?.[0]?.BuildActionEntries?.[0]?.BuildActionEntry;\n const targetName =\n buildActionEntry?.length === 1\n ? getBlueprintName(buildActionEntry[0])\n : getBlueprintName(\n buildActionEntry?.find((entry) => {\n return entry.BuildableReference?.[0]?.['$']?.BuildableName?.endsWith('.app');\n })\n );\n if (!targetName) {\n throw new Error(`${scheme}.xcscheme seems to be corrupted`);\n }\n return targetName;\n}\n\nexport async function getArchiveBuildConfigurationForSchemeAsync(\n projectRoot: string,\n scheme: string\n): Promise<string> {\n const schemeXML = await readSchemeAsync(projectRoot, scheme);\n const buildConfiguration = schemeXML?.Scheme?.ArchiveAction?.[0]?.['$']?.buildConfiguration;\n if (!buildConfiguration) {\n throw new Error(`${scheme}.xcscheme seems to be corrupted`);\n }\n return buildConfiguration;\n}\n\nfunction getBlueprintName(entry?: BuildActionEntryType): string | undefined {\n return entry?.BuildableReference?.[0]?.['$']?.BlueprintName;\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AA0BO,SAASA,uBAAuB,CAACC,WAAmB,EAAY;EACrE,OAAO,IAAAC,wBAAe,EAACD,WAAW,CAAC;AACrC;AAEO,SAASE,+BAA+B,CAC7CF,WAAmB,EACnB;EAAEG,aAAa,GAAG;AAAiD,CAAC,GAAG,CAAC,CAAC,EACvB;EAClD,MAAMC,OAAO,GAAG,IAAAC,uBAAU,EAACL,WAAW,CAAC;EAEvC,OAAO,IAAAM,6BAAmB,EAACF,OAAO,CAAC,CAACG,GAAG,CAAC,CAAC,GAAGC,MAAM,CAAC,KAAK;IACtD,IAAIC,MAAM,GAAG,KAAK;IAClB,MAAMC,IAAI,GAAG,IAAAC,oBAAO,EAACH,MAAM,CAACI,WAAW,CAAC;IAExC,IAAIF,IAAI,KAAKG,oBAAU,CAACC,KAAK,EAAE;MAC7BL,MAAM,GAAG,SAAS;IACpB,CAAC,MAAM;IACL;IACA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;AAEO,eAAeO,0CAA0C,CAC9D3D,WAAmB,EACnBkC,MAAc,EACG;EAAA;EACjB,MAAMY,SAAS,GAAG,MAAMb,eAAe,CAACjC,WAAW,EAAEkC,MAAM,CAAC;EAC5D,MAAMZ,kBAAkB,GAAGwB,SAAS,aAATA,SAAS,6CAATA,SAAS,CAAEE,MAAM,gFAAjB,mBAAmBY,aAAa,oFAAhC,sBAAmC,CAAC,CAAC,qFAArC,uBAAwC,GAAG,CAAC,2DAA5C,uBAA8CtC,kBAAkB;EAC3F,IAAI,CAACA,kBAAkB,EAAE;IACvB,MAAM,IAAIsB,KAAK,CAAE,GAAEV,MAAO,iCAAgC,CAAC;EAC7D;EACA,OAAOZ,kBAAkB;AAC3B;AAEA,SAASgC,gBAAgB,CAACC,KAA4B,EAAsB;EAAA;EAC1E,OAAOA,KAAK,aAALA,KAAK,iDAALA,KAAK,CAAEC,kBAAkB,qFAAzB,uBAA4B,CAAC,CAAC,qFAA9B,uBAAiC,GAAG,CAAC,2DAArC,uBAAuCK,aAAa;AAC7D"}
|
|
@@ -11,136 +11,102 @@ exports.setBundleIdentifier = setBundleIdentifier;
|
|
|
11
11
|
exports.setBundleIdentifierForPbxproj = setBundleIdentifierForPbxproj;
|
|
12
12
|
exports.updateBundleIdentifierForPbxproj = updateBundleIdentifierForPbxproj;
|
|
13
13
|
exports.withBundleIdentifier = void 0;
|
|
14
|
-
|
|
15
14
|
function _plist() {
|
|
16
15
|
const data = _interopRequireDefault(require("@expo/plist"));
|
|
17
|
-
|
|
18
16
|
_plist = function () {
|
|
19
17
|
return data;
|
|
20
18
|
};
|
|
21
|
-
|
|
22
19
|
return data;
|
|
23
20
|
}
|
|
24
|
-
|
|
25
21
|
function _assert() {
|
|
26
22
|
const data = _interopRequireDefault(require("assert"));
|
|
27
|
-
|
|
28
23
|
_assert = function () {
|
|
29
24
|
return data;
|
|
30
25
|
};
|
|
31
|
-
|
|
32
26
|
return data;
|
|
33
27
|
}
|
|
34
|
-
|
|
35
28
|
function _fs() {
|
|
36
29
|
const data = _interopRequireDefault(require("fs"));
|
|
37
|
-
|
|
38
30
|
_fs = function () {
|
|
39
31
|
return data;
|
|
40
32
|
};
|
|
41
|
-
|
|
42
33
|
return data;
|
|
43
34
|
}
|
|
44
|
-
|
|
45
35
|
function _xcode() {
|
|
46
36
|
const data = _interopRequireDefault(require("xcode"));
|
|
47
|
-
|
|
48
37
|
_xcode = function () {
|
|
49
38
|
return data;
|
|
50
39
|
};
|
|
51
|
-
|
|
52
40
|
return data;
|
|
53
41
|
}
|
|
54
|
-
|
|
55
42
|
function _withDangerousMod() {
|
|
56
43
|
const data = require("../plugins/withDangerousMod");
|
|
57
|
-
|
|
58
44
|
_withDangerousMod = function () {
|
|
59
45
|
return data;
|
|
60
46
|
};
|
|
61
|
-
|
|
62
47
|
return data;
|
|
63
48
|
}
|
|
64
|
-
|
|
65
49
|
function _Paths() {
|
|
66
50
|
const data = require("./Paths");
|
|
67
|
-
|
|
68
51
|
_Paths = function () {
|
|
69
52
|
return data;
|
|
70
53
|
};
|
|
71
|
-
|
|
72
54
|
return data;
|
|
73
55
|
}
|
|
74
|
-
|
|
75
56
|
function _Target() {
|
|
76
57
|
const data = require("./Target");
|
|
77
|
-
|
|
78
58
|
_Target = function () {
|
|
79
59
|
return data;
|
|
80
60
|
};
|
|
81
|
-
|
|
82
61
|
return data;
|
|
83
62
|
}
|
|
84
|
-
|
|
85
63
|
function _Xcodeproj() {
|
|
86
64
|
const data = require("./utils/Xcodeproj");
|
|
87
|
-
|
|
88
65
|
_Xcodeproj = function () {
|
|
89
66
|
return data;
|
|
90
67
|
};
|
|
91
|
-
|
|
92
68
|
return data;
|
|
93
69
|
}
|
|
94
|
-
|
|
95
70
|
function _string() {
|
|
96
71
|
const data = require("./utils/string");
|
|
97
|
-
|
|
98
72
|
_string = function () {
|
|
99
73
|
return data;
|
|
100
74
|
};
|
|
101
|
-
|
|
102
75
|
return data;
|
|
103
76
|
}
|
|
104
|
-
|
|
105
77
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
106
|
-
|
|
107
78
|
const withBundleIdentifier = (config, {
|
|
108
79
|
bundleIdentifier
|
|
109
80
|
}) => {
|
|
110
81
|
return (0, _withDangerousMod().withDangerousMod)(config, ['ios', async config => {
|
|
111
82
|
var _config$ios;
|
|
112
|
-
|
|
113
83
|
const bundleId = bundleIdentifier !== null && bundleIdentifier !== void 0 ? bundleIdentifier : (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.bundleIdentifier;
|
|
114
84
|
(0, _assert().default)(bundleId, '`bundleIdentifier` must be defined in the app config (`expo.ios.bundleIdentifier`) or passed to the plugin `withBundleIdentifier`.');
|
|
115
85
|
await setBundleIdentifierForPbxproj(config.modRequest.projectRoot, bundleId);
|
|
116
86
|
return config;
|
|
117
87
|
}]);
|
|
118
88
|
};
|
|
119
|
-
|
|
120
89
|
exports.withBundleIdentifier = withBundleIdentifier;
|
|
121
|
-
|
|
122
90
|
function getBundleIdentifier(config) {
|
|
123
91
|
var _config$ios$bundleIde, _config$ios2;
|
|
124
|
-
|
|
125
92
|
return (_config$ios$bundleIde = (_config$ios2 = config.ios) === null || _config$ios2 === void 0 ? void 0 : _config$ios2.bundleIdentifier) !== null && _config$ios$bundleIde !== void 0 ? _config$ios$bundleIde : null;
|
|
126
93
|
}
|
|
94
|
+
|
|
127
95
|
/**
|
|
128
96
|
* In Turtle v1 we set the bundleIdentifier directly on Info.plist rather
|
|
129
97
|
* than in pbxproj
|
|
130
98
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
99
|
function setBundleIdentifier(config, infoPlist) {
|
|
134
100
|
const bundleIdentifier = getBundleIdentifier(config);
|
|
135
|
-
|
|
136
101
|
if (!bundleIdentifier) {
|
|
137
102
|
return infoPlist;
|
|
138
103
|
}
|
|
139
|
-
|
|
140
|
-
|
|
104
|
+
return {
|
|
105
|
+
...infoPlist,
|
|
141
106
|
CFBundleIdentifier: bundleIdentifier
|
|
142
107
|
};
|
|
143
108
|
}
|
|
109
|
+
|
|
144
110
|
/**
|
|
145
111
|
* Gets the bundle identifier defined in the Xcode project found in the project directory.
|
|
146
112
|
*
|
|
@@ -156,55 +122,45 @@ function setBundleIdentifier(config, infoPlist) {
|
|
|
156
122
|
* @param {string} buildConfiguration Build configuration. Defaults to 'Release'.
|
|
157
123
|
* @returns {string | null} bundle identifier of the Xcode project or null if the project is not configured
|
|
158
124
|
*/
|
|
159
|
-
|
|
160
|
-
|
|
161
125
|
function getBundleIdentifierFromPbxproj(projectRoot, {
|
|
162
126
|
targetName,
|
|
163
127
|
buildConfiguration = 'Release'
|
|
164
128
|
} = {}) {
|
|
165
129
|
let pbxprojPath;
|
|
166
|
-
|
|
167
130
|
try {
|
|
168
131
|
pbxprojPath = (0, _Paths().getPBXProjectPath)(projectRoot);
|
|
169
132
|
} catch {
|
|
170
133
|
return null;
|
|
171
134
|
}
|
|
172
|
-
|
|
173
135
|
const project = _xcode().default.project(pbxprojPath);
|
|
174
|
-
|
|
175
136
|
project.parseSync();
|
|
176
137
|
const xcBuildConfiguration = (0, _Target().getXCBuildConfigurationFromPbxproj)(project, {
|
|
177
138
|
targetName,
|
|
178
139
|
buildConfiguration
|
|
179
140
|
});
|
|
180
|
-
|
|
181
141
|
if (!xcBuildConfiguration) {
|
|
182
142
|
return null;
|
|
183
143
|
}
|
|
184
|
-
|
|
185
144
|
return getProductBundleIdentifierFromBuildConfiguration(xcBuildConfiguration);
|
|
186
145
|
}
|
|
187
|
-
|
|
188
146
|
function getProductBundleIdentifierFromBuildConfiguration(xcBuildConfiguration) {
|
|
189
147
|
const bundleIdentifierRaw = xcBuildConfiguration.buildSettings.PRODUCT_BUNDLE_IDENTIFIER;
|
|
190
|
-
|
|
191
148
|
if (bundleIdentifierRaw) {
|
|
192
|
-
const bundleIdentifier = (0, _string().trimQuotes)(bundleIdentifierRaw);
|
|
149
|
+
const bundleIdentifier = (0, _string().trimQuotes)(bundleIdentifierRaw);
|
|
150
|
+
// it's possible to use interpolation for the bundle identifier
|
|
193
151
|
// the most common case is when the last part of the id is set to `$(PRODUCT_NAME:rfc1034identifier)`
|
|
194
152
|
// in this case, PRODUCT_NAME should be replaced with its value
|
|
195
153
|
// the `rfc1034identifier` modifier replaces all non-alphanumeric characters with dashes
|
|
196
|
-
|
|
197
154
|
const bundleIdentifierParts = bundleIdentifier.split('.');
|
|
198
|
-
|
|
199
155
|
if (bundleIdentifierParts[bundleIdentifierParts.length - 1] === '$(PRODUCT_NAME:rfc1034identifier)' && xcBuildConfiguration.buildSettings.PRODUCT_NAME) {
|
|
200
156
|
bundleIdentifierParts[bundleIdentifierParts.length - 1] = xcBuildConfiguration.buildSettings.PRODUCT_NAME.replace(/[^a-zA-Z0-9]/g, '-');
|
|
201
157
|
}
|
|
202
|
-
|
|
203
158
|
return bundleIdentifierParts.join('.');
|
|
204
159
|
} else {
|
|
205
160
|
return null;
|
|
206
161
|
}
|
|
207
162
|
}
|
|
163
|
+
|
|
208
164
|
/**
|
|
209
165
|
* Updates the bundle identifier for a given pbxproj
|
|
210
166
|
*
|
|
@@ -212,31 +168,25 @@ function getProductBundleIdentifierFromBuildConfiguration(xcBuildConfiguration)
|
|
|
212
168
|
* @param {string} bundleIdentifier Bundle identifier to set in the pbxproj
|
|
213
169
|
* @param {boolean} [updateProductName=true] Whether to update PRODUCT_NAME
|
|
214
170
|
*/
|
|
215
|
-
|
|
216
|
-
|
|
217
171
|
function updateBundleIdentifierForPbxproj(pbxprojPath, bundleIdentifier, updateProductName = true) {
|
|
218
172
|
const project = _xcode().default.project(pbxprojPath);
|
|
219
|
-
|
|
220
173
|
project.parseSync();
|
|
221
174
|
const [, nativeTarget] = (0, _Target().findFirstNativeTarget)(project);
|
|
222
175
|
(0, _Xcodeproj().getBuildConfigurationsForListId)(project, nativeTarget.buildConfigurationList).forEach(([, item]) => {
|
|
223
176
|
if (item.buildSettings.PRODUCT_BUNDLE_IDENTIFIER === bundleIdentifier) {
|
|
224
177
|
return;
|
|
225
178
|
}
|
|
226
|
-
|
|
227
179
|
item.buildSettings.PRODUCT_BUNDLE_IDENTIFIER = `"${bundleIdentifier}"`;
|
|
228
|
-
|
|
229
180
|
if (updateProductName) {
|
|
230
181
|
const productName = bundleIdentifier.split('.').pop();
|
|
231
|
-
|
|
232
182
|
if (!(productName !== null && productName !== void 0 && productName.includes('$'))) {
|
|
233
183
|
item.buildSettings.PRODUCT_NAME = productName;
|
|
234
184
|
}
|
|
235
185
|
}
|
|
236
186
|
});
|
|
237
|
-
|
|
238
187
|
_fs().default.writeFileSync(pbxprojPath, project.writeSync());
|
|
239
188
|
}
|
|
189
|
+
|
|
240
190
|
/**
|
|
241
191
|
* Updates the bundle identifier for pbx projects inside the ios directory of the given project root
|
|
242
192
|
*
|
|
@@ -244,52 +194,43 @@ function updateBundleIdentifierForPbxproj(pbxprojPath, bundleIdentifier, updateP
|
|
|
244
194
|
* @param {string} bundleIdentifier Desired bundle identifier
|
|
245
195
|
* @param {boolean} [updateProductName=true] Whether to update PRODUCT_NAME
|
|
246
196
|
*/
|
|
247
|
-
|
|
248
|
-
|
|
249
197
|
function setBundleIdentifierForPbxproj(projectRoot, bundleIdentifier, updateProductName = true) {
|
|
250
198
|
// Get all pbx projects in the ${projectRoot}/ios directory
|
|
251
199
|
let pbxprojPaths = [];
|
|
252
|
-
|
|
253
200
|
try {
|
|
254
201
|
pbxprojPaths = (0, _Paths().getAllPBXProjectPaths)(projectRoot);
|
|
255
202
|
} catch {}
|
|
256
|
-
|
|
257
203
|
for (const pbxprojPath of pbxprojPaths) {
|
|
258
204
|
updateBundleIdentifierForPbxproj(pbxprojPath, bundleIdentifier, updateProductName);
|
|
259
205
|
}
|
|
260
206
|
}
|
|
207
|
+
|
|
261
208
|
/**
|
|
262
209
|
* Reset bundle identifier field in Info.plist to use PRODUCT_BUNDLE_IDENTIFIER, as recommended by Apple.
|
|
263
210
|
*/
|
|
264
211
|
|
|
265
|
-
|
|
266
212
|
const defaultBundleId = '$(PRODUCT_BUNDLE_IDENTIFIER)';
|
|
267
|
-
|
|
268
213
|
function resetAllPlistBundleIdentifiers(projectRoot) {
|
|
269
214
|
const infoPlistPaths = (0, _Paths().getAllInfoPlistPaths)(projectRoot);
|
|
270
|
-
|
|
271
215
|
for (const plistPath of infoPlistPaths) {
|
|
272
216
|
resetPlistBundleIdentifier(plistPath);
|
|
273
217
|
}
|
|
274
218
|
}
|
|
275
|
-
|
|
276
219
|
function resetPlistBundleIdentifier(plistPath) {
|
|
277
220
|
const rawPlist = _fs().default.readFileSync(plistPath, 'utf8');
|
|
278
|
-
|
|
279
221
|
const plistObject = _plist().default.parse(rawPlist);
|
|
280
|
-
|
|
281
222
|
if (plistObject.CFBundleIdentifier) {
|
|
282
|
-
if (plistObject.CFBundleIdentifier === defaultBundleId) return;
|
|
223
|
+
if (plistObject.CFBundleIdentifier === defaultBundleId) return;
|
|
283
224
|
|
|
225
|
+
// attempt to match default Info.plist format
|
|
284
226
|
const format = {
|
|
285
227
|
pretty: true,
|
|
286
228
|
indent: `\t`
|
|
287
229
|
};
|
|
288
|
-
|
|
289
|
-
|
|
230
|
+
const xml = _plist().default.build({
|
|
231
|
+
...plistObject,
|
|
290
232
|
CFBundleIdentifier: defaultBundleId
|
|
291
233
|
}, format);
|
|
292
|
-
|
|
293
234
|
if (xml !== rawPlist) {
|
|
294
235
|
_fs().default.writeFileSync(plistPath, xml);
|
|
295
236
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleIdentifier.js","names":["withBundleIdentifier","config","bundleIdentifier","withDangerousMod","bundleId","ios","assert","setBundleIdentifierForPbxproj","modRequest","projectRoot","getBundleIdentifier","setBundleIdentifier","infoPlist","CFBundleIdentifier","getBundleIdentifierFromPbxproj","targetName","buildConfiguration","pbxprojPath","getPBXProjectPath","project","xcode","parseSync","xcBuildConfiguration","getXCBuildConfigurationFromPbxproj","getProductBundleIdentifierFromBuildConfiguration","bundleIdentifierRaw","buildSettings","PRODUCT_BUNDLE_IDENTIFIER","trimQuotes","bundleIdentifierParts","split","length","PRODUCT_NAME","replace","join","updateBundleIdentifierForPbxproj","updateProductName","nativeTarget","findFirstNativeTarget","getBuildConfigurationsForListId","buildConfigurationList","forEach","item","productName","pop","includes","fs","writeFileSync","writeSync","pbxprojPaths","getAllPBXProjectPaths","defaultBundleId","resetAllPlistBundleIdentifiers","infoPlistPaths","getAllInfoPlistPaths","plistPath","resetPlistBundleIdentifier","rawPlist","readFileSync","plistObject","plist","parse","format","pretty","indent","xml","build"],"sources":["../../src/ios/BundleIdentifier.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport plist, { PlistObject } from '@expo/plist';\nimport assert from 'assert';\nimport fs from 'fs';\nimport xcode, { XCBuildConfiguration } from 'xcode';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withDangerousMod } from '../plugins/withDangerousMod';\nimport { InfoPlist } from './IosConfig.types';\nimport { getAllInfoPlistPaths, getAllPBXProjectPaths, getPBXProjectPath } from './Paths';\nimport { findFirstNativeTarget, getXCBuildConfigurationFromPbxproj } from './Target';\nimport { ConfigurationSectionEntry, getBuildConfigurationsForListId } from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\n\nexport const withBundleIdentifier: ConfigPlugin<{ bundleIdentifier?: string }> = (\n config,\n { bundleIdentifier }\n) => {\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n const bundleId = bundleIdentifier ?? config.ios?.bundleIdentifier;\n assert(\n bundleId,\n '`bundleIdentifier` must be defined in the app config (`expo.ios.bundleIdentifier`) or passed to the plugin `withBundleIdentifier`.'\n );\n await setBundleIdentifierForPbxproj(config.modRequest.projectRoot, bundleId!);\n return config;\n },\n ]);\n};\n\nfunction getBundleIdentifier(config: Pick<ExpoConfig, 'ios'>): string | null {\n return config.ios?.bundleIdentifier ?? null;\n}\n\n/**\n * In Turtle v1 we set the bundleIdentifier directly on Info.plist rather\n * than in pbxproj\n */\nfunction setBundleIdentifier(config: ExpoConfig, infoPlist: InfoPlist): InfoPlist {\n const bundleIdentifier = getBundleIdentifier(config);\n\n if (!bundleIdentifier) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleIdentifier: bundleIdentifier,\n };\n}\n\n/**\n * Gets the bundle identifier defined in the Xcode project found in the project directory.\n *\n * A bundle identifier is stored as a value in XCBuildConfiguration entry.\n * Those entries exist for every pair (build target, build configuration).\n * Unless target name is passed, the first target defined in the pbxproj is used\n * (to keep compatibility with the inaccurate legacy implementation of this function).\n * The build configuration is usually 'Release' or 'Debug'. However, it could be any arbitrary string.\n * Defaults to 'Release'.\n *\n * @param {string} projectRoot Path to project root containing the ios directory\n * @param {string} targetName Target name\n * @param {string} buildConfiguration Build configuration. Defaults to 'Release'.\n * @returns {string | null} bundle identifier of the Xcode project or null if the project is not configured\n */\nfunction getBundleIdentifierFromPbxproj(\n projectRoot: string,\n {\n targetName,\n buildConfiguration = 'Release',\n }: { targetName?: string; buildConfiguration?: string } = {}\n): string | null {\n let pbxprojPath: string;\n try {\n pbxprojPath = getPBXProjectPath(projectRoot);\n } catch {\n return null;\n }\n const project = xcode.project(pbxprojPath);\n project.parseSync();\n\n const xcBuildConfiguration = getXCBuildConfigurationFromPbxproj(project, {\n targetName,\n buildConfiguration,\n });\n if (!xcBuildConfiguration) {\n return null;\n }\n return getProductBundleIdentifierFromBuildConfiguration(xcBuildConfiguration);\n}\n\nfunction getProductBundleIdentifierFromBuildConfiguration(\n xcBuildConfiguration: XCBuildConfiguration\n): string | null {\n const bundleIdentifierRaw = xcBuildConfiguration.buildSettings.PRODUCT_BUNDLE_IDENTIFIER;\n if (bundleIdentifierRaw) {\n const bundleIdentifier = trimQuotes(bundleIdentifierRaw);\n // it's possible to use interpolation for the bundle identifier\n // the most common case is when the last part of the id is set to `$(PRODUCT_NAME:rfc1034identifier)`\n // in this case, PRODUCT_NAME should be replaced with its value\n // the `rfc1034identifier` modifier replaces all non-alphanumeric characters with dashes\n const bundleIdentifierParts = bundleIdentifier.split('.');\n if (\n bundleIdentifierParts[bundleIdentifierParts.length - 1] ===\n '$(PRODUCT_NAME:rfc1034identifier)' &&\n xcBuildConfiguration.buildSettings.PRODUCT_NAME\n ) {\n bundleIdentifierParts[bundleIdentifierParts.length - 1] =\n xcBuildConfiguration.buildSettings.PRODUCT_NAME.replace(/[^a-zA-Z0-9]/g, '-');\n }\n return bundleIdentifierParts.join('.');\n } else {\n return null;\n }\n}\n\n/**\n * Updates the bundle identifier for a given pbxproj\n *\n * @param {string} pbxprojPath Path to pbxproj file\n * @param {string} bundleIdentifier Bundle identifier to set in the pbxproj\n * @param {boolean} [updateProductName=true] Whether to update PRODUCT_NAME\n */\nfunction updateBundleIdentifierForPbxproj(\n pbxprojPath: string,\n bundleIdentifier: string,\n updateProductName: boolean = true\n): void {\n const project = xcode.project(pbxprojPath);\n project.parseSync();\n\n const [, nativeTarget] = findFirstNativeTarget(project);\n\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList).forEach(\n ([, item]: ConfigurationSectionEntry) => {\n if (item.buildSettings.PRODUCT_BUNDLE_IDENTIFIER === bundleIdentifier) {\n return;\n }\n\n item.buildSettings.PRODUCT_BUNDLE_IDENTIFIER = `\"${bundleIdentifier}\"`;\n\n if (updateProductName) {\n const productName = bundleIdentifier.split('.').pop();\n if (!productName?.includes('$')) {\n item.buildSettings.PRODUCT_NAME = productName;\n }\n }\n }\n );\n fs.writeFileSync(pbxprojPath, project.writeSync());\n}\n\n/**\n * Updates the bundle identifier for pbx projects inside the ios directory of the given project root\n *\n * @param {string} projectRoot Path to project root containing the ios directory\n * @param {string} bundleIdentifier Desired bundle identifier\n * @param {boolean} [updateProductName=true] Whether to update PRODUCT_NAME\n */\nfunction setBundleIdentifierForPbxproj(\n projectRoot: string,\n bundleIdentifier: string,\n updateProductName: boolean = true\n): void {\n // Get all pbx projects in the ${projectRoot}/ios directory\n let pbxprojPaths: string[] = [];\n try {\n pbxprojPaths = getAllPBXProjectPaths(projectRoot);\n } catch {}\n\n for (const pbxprojPath of pbxprojPaths) {\n updateBundleIdentifierForPbxproj(pbxprojPath, bundleIdentifier, updateProductName);\n }\n}\n\n/**\n * Reset bundle identifier field in Info.plist to use PRODUCT_BUNDLE_IDENTIFIER, as recommended by Apple.\n */\n\nconst defaultBundleId = '$(PRODUCT_BUNDLE_IDENTIFIER)';\n\nfunction resetAllPlistBundleIdentifiers(projectRoot: string): void {\n const infoPlistPaths = getAllInfoPlistPaths(projectRoot);\n\n for (const plistPath of infoPlistPaths) {\n resetPlistBundleIdentifier(plistPath);\n }\n}\n\nfunction resetPlistBundleIdentifier(plistPath: string): void {\n const rawPlist = fs.readFileSync(plistPath, 'utf8');\n const plistObject = plist.parse(rawPlist) as PlistObject;\n\n if (plistObject.CFBundleIdentifier) {\n if (plistObject.CFBundleIdentifier === defaultBundleId) return;\n\n // attempt to match default Info.plist format\n const format = { pretty: true, indent: `\\t` };\n\n const xml = plist.build(\n {\n ...plistObject,\n CFBundleIdentifier: defaultBundleId,\n },\n format\n );\n\n if (xml !== rawPlist) {\n fs.writeFileSync(plistPath, xml);\n }\n }\n}\n\nexport {\n getBundleIdentifier,\n setBundleIdentifier,\n getBundleIdentifierFromPbxproj,\n updateBundleIdentifierForPbxproj,\n setBundleIdentifierForPbxproj,\n resetAllPlistBundleIdentifiers,\n resetPlistBundleIdentifier,\n};\n"],"mappings":";;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;A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;;EAEA,KAAK,MAAM8C,SAAX,IAAwBF,cAAxB,EAAwC;IACtCG,0BAA0B,CAACD,SAAD,CAA1B;EACD;AACF;;AAED,SAASC,0BAAT,CAAoCD,SAApC,EAA6D;EAC3D,MAAME,QAAQ,GAAGX,aAAA,CAAGY,YAAH,CAAgBH,SAAhB,EAA2B,MAA3B,CAAjB;;EACA,MAAMI,WAAW,GAAGC,gBAAA,CAAMC,KAAN,CAAYJ,QAAZ,CAApB;;EAEA,IAAIE,WAAW,CAAC9C,kBAAhB,EAAoC;IAClC,IAAI8C,WAAW,CAAC9C,kBAAZ,KAAmCsC,eAAvC,EAAwD,OADtB,CAGlC;;IACA,MAAMW,MAAM,GAAG;MAAEC,MAAM,EAAE,IAAV;MAAgBC,MAAM,EAAG;IAAzB,CAAf;;IAEA,MAAMC,GAAG,GAAGL,gBAAA,CAAMM,KAAN,CACV,EACE,GAAGP,WADL;MAEE9C,kBAAkB,EAAEsC;IAFtB,CADU,EAKVW,MALU,CAAZ;;IAQA,IAAIG,GAAG,KAAKR,QAAZ,EAAsB;MACpBX,aAAA,CAAGC,aAAH,CAAiBQ,SAAjB,EAA4BU,GAA5B;IACD;EACF;AACF"}
|
|
1
|
+
{"version":3,"file":"BundleIdentifier.js","names":["withBundleIdentifier","config","bundleIdentifier","withDangerousMod","bundleId","ios","assert","setBundleIdentifierForPbxproj","modRequest","projectRoot","getBundleIdentifier","setBundleIdentifier","infoPlist","CFBundleIdentifier","getBundleIdentifierFromPbxproj","targetName","buildConfiguration","pbxprojPath","getPBXProjectPath","project","xcode","parseSync","xcBuildConfiguration","getXCBuildConfigurationFromPbxproj","getProductBundleIdentifierFromBuildConfiguration","bundleIdentifierRaw","buildSettings","PRODUCT_BUNDLE_IDENTIFIER","trimQuotes","bundleIdentifierParts","split","length","PRODUCT_NAME","replace","join","updateBundleIdentifierForPbxproj","updateProductName","nativeTarget","findFirstNativeTarget","getBuildConfigurationsForListId","buildConfigurationList","forEach","item","productName","pop","includes","fs","writeFileSync","writeSync","pbxprojPaths","getAllPBXProjectPaths","defaultBundleId","resetAllPlistBundleIdentifiers","infoPlistPaths","getAllInfoPlistPaths","plistPath","resetPlistBundleIdentifier","rawPlist","readFileSync","plistObject","plist","parse","format","pretty","indent","xml","build"],"sources":["../../src/ios/BundleIdentifier.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport plist, { PlistObject } from '@expo/plist';\nimport assert from 'assert';\nimport fs from 'fs';\nimport xcode, { XCBuildConfiguration } from 'xcode';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withDangerousMod } from '../plugins/withDangerousMod';\nimport { InfoPlist } from './IosConfig.types';\nimport { getAllInfoPlistPaths, getAllPBXProjectPaths, getPBXProjectPath } from './Paths';\nimport { findFirstNativeTarget, getXCBuildConfigurationFromPbxproj } from './Target';\nimport { ConfigurationSectionEntry, getBuildConfigurationsForListId } from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\n\nexport const withBundleIdentifier: ConfigPlugin<{ bundleIdentifier?: string }> = (\n config,\n { bundleIdentifier }\n) => {\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n const bundleId = bundleIdentifier ?? config.ios?.bundleIdentifier;\n assert(\n bundleId,\n '`bundleIdentifier` must be defined in the app config (`expo.ios.bundleIdentifier`) or passed to the plugin `withBundleIdentifier`.'\n );\n await setBundleIdentifierForPbxproj(config.modRequest.projectRoot, bundleId!);\n return config;\n },\n ]);\n};\n\nfunction getBundleIdentifier(config: Pick<ExpoConfig, 'ios'>): string | null {\n return config.ios?.bundleIdentifier ?? null;\n}\n\n/**\n * In Turtle v1 we set the bundleIdentifier directly on Info.plist rather\n * than in pbxproj\n */\nfunction setBundleIdentifier(config: ExpoConfig, infoPlist: InfoPlist): InfoPlist {\n const bundleIdentifier = getBundleIdentifier(config);\n\n if (!bundleIdentifier) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleIdentifier: bundleIdentifier,\n };\n}\n\n/**\n * Gets the bundle identifier defined in the Xcode project found in the project directory.\n *\n * A bundle identifier is stored as a value in XCBuildConfiguration entry.\n * Those entries exist for every pair (build target, build configuration).\n * Unless target name is passed, the first target defined in the pbxproj is used\n * (to keep compatibility with the inaccurate legacy implementation of this function).\n * The build configuration is usually 'Release' or 'Debug'. However, it could be any arbitrary string.\n * Defaults to 'Release'.\n *\n * @param {string} projectRoot Path to project root containing the ios directory\n * @param {string} targetName Target name\n * @param {string} buildConfiguration Build configuration. Defaults to 'Release'.\n * @returns {string | null} bundle identifier of the Xcode project or null if the project is not configured\n */\nfunction getBundleIdentifierFromPbxproj(\n projectRoot: string,\n {\n targetName,\n buildConfiguration = 'Release',\n }: { targetName?: string; buildConfiguration?: string } = {}\n): string | null {\n let pbxprojPath: string;\n try {\n pbxprojPath = getPBXProjectPath(projectRoot);\n } catch {\n return null;\n }\n const project = xcode.project(pbxprojPath);\n project.parseSync();\n\n const xcBuildConfiguration = getXCBuildConfigurationFromPbxproj(project, {\n targetName,\n buildConfiguration,\n });\n if (!xcBuildConfiguration) {\n return null;\n }\n return getProductBundleIdentifierFromBuildConfiguration(xcBuildConfiguration);\n}\n\nfunction getProductBundleIdentifierFromBuildConfiguration(\n xcBuildConfiguration: XCBuildConfiguration\n): string | null {\n const bundleIdentifierRaw = xcBuildConfiguration.buildSettings.PRODUCT_BUNDLE_IDENTIFIER;\n if (bundleIdentifierRaw) {\n const bundleIdentifier = trimQuotes(bundleIdentifierRaw);\n // it's possible to use interpolation for the bundle identifier\n // the most common case is when the last part of the id is set to `$(PRODUCT_NAME:rfc1034identifier)`\n // in this case, PRODUCT_NAME should be replaced with its value\n // the `rfc1034identifier` modifier replaces all non-alphanumeric characters with dashes\n const bundleIdentifierParts = bundleIdentifier.split('.');\n if (\n bundleIdentifierParts[bundleIdentifierParts.length - 1] ===\n '$(PRODUCT_NAME:rfc1034identifier)' &&\n xcBuildConfiguration.buildSettings.PRODUCT_NAME\n ) {\n bundleIdentifierParts[bundleIdentifierParts.length - 1] =\n xcBuildConfiguration.buildSettings.PRODUCT_NAME.replace(/[^a-zA-Z0-9]/g, '-');\n }\n return bundleIdentifierParts.join('.');\n } else {\n return null;\n }\n}\n\n/**\n * Updates the bundle identifier for a given pbxproj\n *\n * @param {string} pbxprojPath Path to pbxproj file\n * @param {string} bundleIdentifier Bundle identifier to set in the pbxproj\n * @param {boolean} [updateProductName=true] Whether to update PRODUCT_NAME\n */\nfunction updateBundleIdentifierForPbxproj(\n pbxprojPath: string,\n bundleIdentifier: string,\n updateProductName: boolean = true\n): void {\n const project = xcode.project(pbxprojPath);\n project.parseSync();\n\n const [, nativeTarget] = findFirstNativeTarget(project);\n\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList).forEach(\n ([, item]: ConfigurationSectionEntry) => {\n if (item.buildSettings.PRODUCT_BUNDLE_IDENTIFIER === bundleIdentifier) {\n return;\n }\n\n item.buildSettings.PRODUCT_BUNDLE_IDENTIFIER = `\"${bundleIdentifier}\"`;\n\n if (updateProductName) {\n const productName = bundleIdentifier.split('.').pop();\n if (!productName?.includes('$')) {\n item.buildSettings.PRODUCT_NAME = productName;\n }\n }\n }\n );\n fs.writeFileSync(pbxprojPath, project.writeSync());\n}\n\n/**\n * Updates the bundle identifier for pbx projects inside the ios directory of the given project root\n *\n * @param {string} projectRoot Path to project root containing the ios directory\n * @param {string} bundleIdentifier Desired bundle identifier\n * @param {boolean} [updateProductName=true] Whether to update PRODUCT_NAME\n */\nfunction setBundleIdentifierForPbxproj(\n projectRoot: string,\n bundleIdentifier: string,\n updateProductName: boolean = true\n): void {\n // Get all pbx projects in the ${projectRoot}/ios directory\n let pbxprojPaths: string[] = [];\n try {\n pbxprojPaths = getAllPBXProjectPaths(projectRoot);\n } catch {}\n\n for (const pbxprojPath of pbxprojPaths) {\n updateBundleIdentifierForPbxproj(pbxprojPath, bundleIdentifier, updateProductName);\n }\n}\n\n/**\n * Reset bundle identifier field in Info.plist to use PRODUCT_BUNDLE_IDENTIFIER, as recommended by Apple.\n */\n\nconst defaultBundleId = '$(PRODUCT_BUNDLE_IDENTIFIER)';\n\nfunction resetAllPlistBundleIdentifiers(projectRoot: string): void {\n const infoPlistPaths = getAllInfoPlistPaths(projectRoot);\n\n for (const plistPath of infoPlistPaths) {\n resetPlistBundleIdentifier(plistPath);\n }\n}\n\nfunction resetPlistBundleIdentifier(plistPath: string): void {\n const rawPlist = fs.readFileSync(plistPath, 'utf8');\n const plistObject = plist.parse(rawPlist) as PlistObject;\n\n if (plistObject.CFBundleIdentifier) {\n if (plistObject.CFBundleIdentifier === defaultBundleId) return;\n\n // attempt to match default Info.plist format\n const format = { pretty: true, indent: `\\t` };\n\n const xml = plist.build(\n {\n ...plistObject,\n CFBundleIdentifier: defaultBundleId,\n },\n format\n );\n\n if (xml !== rawPlist) {\n fs.writeFileSync(plistPath, xml);\n }\n }\n}\n\nexport {\n getBundleIdentifier,\n setBundleIdentifier,\n getBundleIdentifierFromPbxproj,\n updateBundleIdentifierForPbxproj,\n setBundleIdentifierForPbxproj,\n resetAllPlistBundleIdentifiers,\n resetPlistBundleIdentifier,\n};\n"],"mappings":";;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA4C;AAErC,MAAMA,oBAAiE,GAAG,CAC/EC,MAAM,EACN;EAAEC;AAAiB,CAAC,KACjB;EACH,OAAO,IAAAC,oCAAgB,EAACF,MAAM,EAAE,CAC9B,KAAK,EACL,MAAOA,MAAM,IAAK;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AACJ,QAAQ,CAAgB;EAExD,IAAIE,WAAW,CAAC9C,kBAAkB,EAAE;IAClC,IAAI8C,WAAW,CAAC9C,kBAAkB,KAAKsC,eAAe,EAAE;;IAExD;IACA,MAAMW,MAAM,GAAG;MAAEC,MAAM,EAAE,IAAI;MAAEC,MAAM,EAAG;IAAI,CAAC;IAE7C,MAAMC,GAAG,GAAGL,gBAAK,CAACM,KAAK,CACrB;MACE,GAAGP,WAAW;MACd9C,kBAAkB,EAAEsC;IACtB,CAAC,EACDW,MAAM,CACP;IAED,IAAIG,GAAG,KAAKR,QAAQ,EAAE;MACpBX,aAAE,CAACC,aAAa,CAACQ,SAAS,EAAEU,GAAG,CAAC;IAClC;EACF;AACF"}
|
|
@@ -9,27 +9,20 @@ exports.getIsTabletOnly = getIsTabletOnly;
|
|
|
9
9
|
exports.getSupportsTablet = getSupportsTablet;
|
|
10
10
|
exports.setDeviceFamily = setDeviceFamily;
|
|
11
11
|
exports.withDeviceFamily = void 0;
|
|
12
|
-
|
|
13
12
|
function _iosPlugins() {
|
|
14
13
|
const data = require("../plugins/ios-plugins");
|
|
15
|
-
|
|
16
14
|
_iosPlugins = function () {
|
|
17
15
|
return data;
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
return data;
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
function _warnings() {
|
|
24
20
|
const data = require("../utils/warnings");
|
|
25
|
-
|
|
26
21
|
_warnings = function () {
|
|
27
22
|
return data;
|
|
28
23
|
};
|
|
29
|
-
|
|
30
24
|
return data;
|
|
31
25
|
}
|
|
32
|
-
|
|
33
26
|
const withDeviceFamily = config => {
|
|
34
27
|
return (0, _iosPlugins().withXcodeProject)(config, async config => {
|
|
35
28
|
config.modResults = await setDeviceFamily(config, {
|
|
@@ -38,32 +31,24 @@ const withDeviceFamily = config => {
|
|
|
38
31
|
return config;
|
|
39
32
|
});
|
|
40
33
|
};
|
|
41
|
-
|
|
42
34
|
exports.withDeviceFamily = withDeviceFamily;
|
|
43
|
-
|
|
44
35
|
function getSupportsTablet(config) {
|
|
45
36
|
var _config$ios;
|
|
46
|
-
|
|
47
37
|
return !!((_config$ios = config.ios) !== null && _config$ios !== void 0 && _config$ios.supportsTablet);
|
|
48
38
|
}
|
|
49
|
-
|
|
50
39
|
function getIsTabletOnly(config) {
|
|
51
40
|
var _config$ios2;
|
|
52
|
-
|
|
53
41
|
return !!(config !== null && config !== void 0 && (_config$ios2 = config.ios) !== null && _config$ios2 !== void 0 && _config$ios2.isTabletOnly);
|
|
54
42
|
}
|
|
55
|
-
|
|
56
43
|
function getDeviceFamilies(config) {
|
|
57
44
|
var _config$ios3;
|
|
58
|
-
|
|
59
45
|
const supportsTablet = getSupportsTablet(config);
|
|
60
46
|
const isTabletOnly = getIsTabletOnly(config);
|
|
61
|
-
|
|
62
47
|
if (isTabletOnly && ((_config$ios3 = config.ios) === null || _config$ios3 === void 0 ? void 0 : _config$ios3.supportsTablet) === false) {
|
|
63
48
|
(0, _warnings().addWarningIOS)('ios.supportsTablet', `Found contradictory values: \`{ ios: { isTabletOnly: true, supportsTablet: false } }\`. Using \`{ isTabletOnly: true }\`.`);
|
|
64
|
-
}
|
|
65
|
-
|
|
49
|
+
}
|
|
66
50
|
|
|
51
|
+
// 1 is iPhone, 2 is iPad
|
|
67
52
|
if (isTabletOnly) {
|
|
68
53
|
return [2];
|
|
69
54
|
} else if (supportsTablet) {
|
|
@@ -73,27 +58,25 @@ function getDeviceFamilies(config) {
|
|
|
73
58
|
return [1];
|
|
74
59
|
}
|
|
75
60
|
}
|
|
61
|
+
|
|
76
62
|
/**
|
|
77
63
|
* Wrapping the families in double quotes is the only way to set a value with a comma in it.
|
|
78
64
|
*
|
|
79
65
|
* @param deviceFamilies
|
|
80
66
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
67
|
function formatDeviceFamilies(deviceFamilies) {
|
|
84
68
|
return `"${deviceFamilies.join(',')}"`;
|
|
85
69
|
}
|
|
70
|
+
|
|
86
71
|
/**
|
|
87
72
|
* Add to pbxproj under TARGETED_DEVICE_FAMILY
|
|
88
73
|
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
74
|
function setDeviceFamily(config, {
|
|
92
75
|
project
|
|
93
76
|
}) {
|
|
94
77
|
const deviceFamilies = formatDeviceFamilies(getDeviceFamilies(config));
|
|
95
|
-
const configurations = project.pbxXCBuildConfigurationSection();
|
|
96
|
-
|
|
78
|
+
const configurations = project.pbxXCBuildConfigurationSection();
|
|
79
|
+
// @ts-ignore
|
|
97
80
|
for (const {
|
|
98
81
|
buildSettings
|
|
99
82
|
} of Object.values(configurations || {})) {
|
|
@@ -103,7 +86,6 @@ function setDeviceFamily(config, {
|
|
|
103
86
|
buildSettings.TARGETED_DEVICE_FAMILY = deviceFamilies;
|
|
104
87
|
}
|
|
105
88
|
}
|
|
106
|
-
|
|
107
89
|
return project;
|
|
108
90
|
}
|
|
109
91
|
//# sourceMappingURL=DeviceFamily.js.map
|