forceios 13.2.0-alpha.0 → 13.2.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/package.json +3 -2
- package/shared/constants.js +8 -8
- package/shared/createHelper.js +101 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forceios",
|
|
3
|
-
"version": "13.2.0
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "Utilities for creating mobile apps based on the Salesforce Mobile SDK for iOS",
|
|
5
5
|
"keywords": [ "mobilesdk", "ios", "salesforce", "mobile", "sdk" ],
|
|
6
6
|
"homepage": "https://github.com/forcedotcom/SalesforceMobileSDK-iOS",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"shelljs": "0.8.5",
|
|
18
18
|
"ajv": "^8.11.0",
|
|
19
|
-
"jsonlint": "^1.6.3"
|
|
19
|
+
"jsonlint": "^1.6.3",
|
|
20
|
+
"change-case": "^4.1.2"
|
|
20
21
|
},
|
|
21
22
|
"repository": {
|
|
22
23
|
"type" : "git",
|
package/shared/constants.js
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
var path = require('path'),
|
|
29
29
|
shelljs = require('shelljs');
|
|
30
30
|
|
|
31
|
-
var VERSION= '13.2.0
|
|
31
|
+
var VERSION= '13.2.0';
|
|
32
32
|
|
|
33
33
|
module.exports = {
|
|
34
34
|
version: VERSION,
|
|
@@ -40,11 +40,11 @@ module.exports = {
|
|
|
40
40
|
},
|
|
41
41
|
node: {
|
|
42
42
|
checkCmd: 'node --version',
|
|
43
|
-
minVersion: '
|
|
43
|
+
minVersion: '20'
|
|
44
44
|
},
|
|
45
45
|
npm: {
|
|
46
46
|
checkCmd: 'npm -v',
|
|
47
|
-
minVersion: '
|
|
47
|
+
minVersion: '10'
|
|
48
48
|
},
|
|
49
49
|
yarn: {
|
|
50
50
|
checkCmd: 'yarn -v',
|
|
@@ -60,9 +60,9 @@ module.exports = {
|
|
|
60
60
|
},
|
|
61
61
|
cordova: {
|
|
62
62
|
checkCmd: 'cordova -v',
|
|
63
|
-
pluginRepoUri: 'https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin#dev', // dev
|
|
64
|
-
minVersion: '
|
|
65
|
-
|
|
63
|
+
// pluginRepoUri: 'https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin#dev', // dev
|
|
64
|
+
minVersion: '13.0.0',
|
|
65
|
+
pluginRepoUri: 'salesforce-mobilesdk-cordova-plugin@v' + VERSION, // GA
|
|
66
66
|
platformVersion: {
|
|
67
67
|
ios: '7.1.1',
|
|
68
68
|
android: '14.0.1'
|
|
@@ -79,8 +79,8 @@ module.exports = {
|
|
|
79
79
|
android: 'Android Studio'
|
|
80
80
|
},
|
|
81
81
|
|
|
82
|
-
templatesRepoUri: 'https://github.com/forcedotcom/SalesforceMobileSDK-Templates#dev', // dev
|
|
83
|
-
|
|
82
|
+
// templatesRepoUri: 'https://github.com/forcedotcom/SalesforceMobileSDK-Templates#dev', // dev
|
|
83
|
+
templatesRepoUri: 'https://github.com/forcedotcom/SalesforceMobileSDK-Templates#v' + VERSION, // GA
|
|
84
84
|
|
|
85
85
|
forceclis: {
|
|
86
86
|
forceios: {
|
package/shared/createHelper.js
CHANGED
|
@@ -35,8 +35,7 @@ var path = require('path'),
|
|
|
35
35
|
fs = require('fs'),
|
|
36
36
|
Ajv = require('ajv'),
|
|
37
37
|
COLOR = require('./outputColors'),
|
|
38
|
-
readJsonFile = require('./jsonChecker').readJsonFile
|
|
39
|
-
JSON5 = require('json5');
|
|
38
|
+
readJsonFile = require('./jsonChecker').readJsonFile;
|
|
40
39
|
|
|
41
40
|
// Constant
|
|
42
41
|
var SERVER_PROJECT_DIR = 'server';
|
|
@@ -113,6 +112,11 @@ function createHybridApp(config) {
|
|
|
113
112
|
// Run cordova prepare
|
|
114
113
|
utils.runProcessThrowError('cordova prepare', config.projectDir);
|
|
115
114
|
|
|
115
|
+
// Remove CordovaLib subproject from iOS workspace to fix archiving issue
|
|
116
|
+
if (config.platform.split(',').includes('ios')) {
|
|
117
|
+
removeCordovaLibFromWorkspace(config.projectDir, config.appname);
|
|
118
|
+
}
|
|
119
|
+
|
|
116
120
|
// Add theme for Android API 35
|
|
117
121
|
if (config.platform.split(',').includes('android')) {
|
|
118
122
|
createAndroidAPI35Theme(config.projectDir);
|
|
@@ -122,9 +126,103 @@ function createHybridApp(config) {
|
|
|
122
126
|
return prepareResult;
|
|
123
127
|
}
|
|
124
128
|
|
|
129
|
+
//
|
|
130
|
+
// Remove CordovaLib subproject from iOS project
|
|
131
|
+
// This fixes the "Generic Xcode Archive" issue when archiving
|
|
132
|
+
//
|
|
133
|
+
function removeCordovaLibFromWorkspace(projectDir, appname) {
|
|
134
|
+
const projectPath = path.join(projectDir, 'platforms', 'ios', appname + '.xcodeproj');
|
|
135
|
+
const pbxprojPath = path.join(projectPath, 'project.pbxproj');
|
|
136
|
+
|
|
137
|
+
if (!fs.existsSync(pbxprojPath)) {
|
|
138
|
+
utils.logDebug('Project file not found, skipping CordovaLib removal: ' + pbxprojPath);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
try {
|
|
143
|
+
// Read the project file
|
|
144
|
+
let content = fs.readFileSync(pbxprojPath, 'utf8');
|
|
145
|
+
const originalContent = content;
|
|
146
|
+
|
|
147
|
+
// Step 1: Find and store the CordovaLib file reference ID
|
|
148
|
+
const fileRefMatch = content.match(/([A-F0-9]+)\s*\/\*\s*CordovaLib\.xcodeproj\s*\*\/\s*=\s*\{isa\s*=\s*PBXFileReference[^}]*CordovaLib\/CordovaLib\.xcodeproj[^}]*\}/);
|
|
149
|
+
if (!fileRefMatch) {
|
|
150
|
+
utils.logDebug('CordovaLib file reference not found in project');
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const cordovaLibId = fileRefMatch[1];
|
|
154
|
+
|
|
155
|
+
// Step 2: Find all PBXContainerItemProxy IDs that reference CordovaLib (need to track for PBXReferenceProxy removal)
|
|
156
|
+
const containerProxyIds = [];
|
|
157
|
+
const proxyRegex = /([A-F0-9]+)\s*\/\*\s*PBXContainerItemProxy\s*\*\/\s*=\s*\{[^}]*containerPortal\s*=\s*[A-F0-9]+[^}]*remoteInfo\s*=\s*CordovaLib[^}]*\}/g;
|
|
158
|
+
let match;
|
|
159
|
+
while ((match = proxyRegex.exec(content)) !== null) {
|
|
160
|
+
containerProxyIds.push(match[1]);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Step 3: Find all PBXTargetDependency IDs that reference CordovaLib (we need to track these)
|
|
164
|
+
const targetDepIds = [];
|
|
165
|
+
const targetDepRegex = /([A-F0-9]+)\s*\/\*\s*PBXTargetDependency\s*\*\/\s*=\s*\{[^}]*name\s*=\s*CordovaLib;[^}]*\}/g;
|
|
166
|
+
while ((match = targetDepRegex.exec(content)) !== null) {
|
|
167
|
+
targetDepIds.push(match[1]);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Step 4: Find the Products group ID from projectReferences
|
|
171
|
+
const productsGroupMatch = content.match(/ProductGroup\s*=\s*([A-F0-9]+)\s*\/\*\s*Products\s*\*\/\s*;\s*ProjectRef\s*=\s*[A-F0-9]+\s*\/\*\s*CordovaLib\.xcodeproj/);
|
|
172
|
+
const productsGroupId = productsGroupMatch ? productsGroupMatch[1] : null;
|
|
173
|
+
|
|
174
|
+
// Step 5: Remove all PBXContainerItemProxy entries that reference CordovaLib
|
|
175
|
+
content = content.replace(new RegExp(`\\s*[A-F0-9]+\\s*\\/\\*\\s*PBXContainerItemProxy\\s*\\*\\/\\s*=\\s*\\{[^}]*containerPortal\\s*=\\s*${cordovaLibId}[^}]*\\};?`, 'g'), '');
|
|
176
|
+
|
|
177
|
+
// Step 6: Remove PBXReferenceProxy entries that reference the deleted PBXContainerItemProxy
|
|
178
|
+
containerProxyIds.forEach(id => {
|
|
179
|
+
content = content.replace(new RegExp(`\\s*[A-F0-9]+\\s*\\/\\*\\s*[^*]+\\*\\/\\s*=\\s*\\{[^}]*remoteRef\\s*=\\s*${id}[^}]*\\};?`, 'g'), '');
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// Step 7: Remove the Products group if it exists and references deleted proxies
|
|
183
|
+
if (productsGroupId) {
|
|
184
|
+
content = content.replace(new RegExp(`\\s*${productsGroupId}\\s*\\/\\*\\s*Products\\s*\\*\\/\\s*=\\s*\\{[^}]*\\};?`, 'g'), '');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Step 8: Remove PBXTargetDependency entries that reference CordovaLib
|
|
188
|
+
content = content.replace(/\s*[A-F0-9]+\s*\/\*\s*PBXTargetDependency\s*\*\/\s*=\s*\{[^}]*name\s*=\s*CordovaLib;[^}]*\};?/g, '');
|
|
189
|
+
|
|
190
|
+
// Step 9: Remove references to PBXTargetDependency IDs from dependencies arrays
|
|
191
|
+
targetDepIds.forEach(id => {
|
|
192
|
+
content = content.replace(new RegExp(`\\s*${id}\\s*\\/\\*\\s*PBXTargetDependency\\s*\\*\\/\\s*,?`, 'g'), '');
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// Step 10: Remove the PBXFileReference entry for CordovaLib.xcodeproj
|
|
196
|
+
content = content.replace(new RegExp(`\\s*${cordovaLibId}\\s*\\/\\*\\s*CordovaLib\\.xcodeproj\\s*\\*\\/\\s*=\\s*\\{[^}]*\\};?`, 'g'), '');
|
|
197
|
+
|
|
198
|
+
// Step 11: Remove references to CordovaLib ID from arrays (children, projectReferences, etc.)
|
|
199
|
+
content = content.replace(new RegExp(`\\s*${cordovaLibId}\\s*\\/\\*\\s*CordovaLib\\.xcodeproj\\s*\\*\\/\\s*,?`, 'g'), '');
|
|
200
|
+
|
|
201
|
+
// Step 12: Remove entire projectReferences array entries that contain CordovaLib (including ones with empty ProjectRef)
|
|
202
|
+
content = content.replace(/\s*\{\s*ProductGroup\s*=\s*[A-F0-9]+\s*\/\*\s*Products\s*\*\/\s*;\s*ProjectRef\s*=\s*([A-F0-9]*)\s*(\/\*\s*CordovaLib\.xcodeproj\s*\*\/)?\s*;\s*\}\s*,?/g, '');
|
|
203
|
+
|
|
204
|
+
// Step 13: Remove the entire projectReferences property if it becomes empty
|
|
205
|
+
content = content.replace(/\s*projectReferences\s*=\s*\(\s*\);?/g, '');
|
|
206
|
+
|
|
207
|
+
// Step 14: Clean up any resulting empty lines or trailing commas
|
|
208
|
+
content = content.replace(/,(\s*\))/g, '$1'); // Remove trailing commas before closing parentheses
|
|
209
|
+
content = content.replace(/\n\s*\n\s*\n/g, '\n\n'); // Reduce multiple blank lines to double
|
|
210
|
+
|
|
211
|
+
// Only write back if something was changed
|
|
212
|
+
if (content !== originalContent) {
|
|
213
|
+
fs.writeFileSync(pbxprojPath, content, 'utf8');
|
|
214
|
+
utils.log('Removed CordovaLib subproject from Xcode project');
|
|
215
|
+
} else {
|
|
216
|
+
utils.logDebug('No CordovaLib references found to remove');
|
|
217
|
+
}
|
|
218
|
+
} catch (error) {
|
|
219
|
+
utils.logError('Failed to remove CordovaLib from project', error);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
125
223
|
//
|
|
126
224
|
// Add Android API 35 theme file
|
|
127
|
-
//
|
|
225
|
+
//
|
|
128
226
|
function createAndroidAPI35Theme(projectDir) {
|
|
129
227
|
const dirPath = path.join(projectDir, 'platforms', 'android', 'app', 'src', 'main', 'res', 'values-v35');
|
|
130
228
|
const filePath = path.join(dirPath, 'themes.xml');
|