forceios 11.1.0 → 12.0.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/package.json +1 -1
- package/shared/constants.js +6 -6
- package/shared/createHelper.js +33 -38
- package/shared/utils.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forceios",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.1",
|
|
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",
|
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= '
|
|
31
|
+
var VERSION= '12.0.1';
|
|
32
32
|
|
|
33
33
|
module.exports = {
|
|
34
34
|
version: VERSION,
|
|
@@ -64,13 +64,13 @@ module.exports = {
|
|
|
64
64
|
minVersion: '12.0.0',
|
|
65
65
|
pluginRepoUri: 'salesforce-mobilesdk-cordova-plugin@v' + VERSION, // GA
|
|
66
66
|
platformVersion: {
|
|
67
|
-
ios: '7.0
|
|
67
|
+
ios: '7.1.0',
|
|
68
68
|
android: '12.0.1'
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
|
|
72
|
-
checkCmd: '
|
|
73
|
-
minVersion: '
|
|
71
|
+
sf: {
|
|
72
|
+
checkCmd: 'sf -v',
|
|
73
|
+
minVersion: '2.0.0'
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
|
|
@@ -117,7 +117,7 @@ module.exports = {
|
|
|
117
117
|
purpose: 'a hybrid mobile application',
|
|
118
118
|
dir: 'hybrid',
|
|
119
119
|
platforms: ['ios', 'android'],
|
|
120
|
-
toolNames: ['git', 'node', 'npm', 'cordova', '
|
|
120
|
+
toolNames: ['git', 'node', 'npm', 'cordova', 'sf'],
|
|
121
121
|
appTypes: ['hybrid_local', 'hybrid_remote', 'hybrid_lwc'],
|
|
122
122
|
appTypesToPath: {
|
|
123
123
|
'hybrid_local': 'HybridLocalTemplate',
|
package/shared/createHelper.js
CHANGED
|
@@ -90,7 +90,7 @@ function createHybridApp(config) {
|
|
|
90
90
|
// Merge files from template into it
|
|
91
91
|
if (utils.dirExists(path.join(webDir, SERVER_PROJECT_DIR))) {
|
|
92
92
|
config.serverDir = path.join(config.projectDir, SERVER_PROJECT_DIR)
|
|
93
|
-
utils.runProcessThrowError('
|
|
93
|
+
utils.runProcessThrowError('sf force project create -n ' + SERVER_PROJECT_DIR, config.projectDir);
|
|
94
94
|
|
|
95
95
|
// Copy cordova js to static resources
|
|
96
96
|
for (var platform of config.platform.split(',')) {
|
|
@@ -110,13 +110,7 @@ function createHybridApp(config) {
|
|
|
110
110
|
utils.runProcessThrowError('cordova prepare', config.projectDir);
|
|
111
111
|
|
|
112
112
|
if (config.platform.split(',').indexOf('ios') != -1) {
|
|
113
|
-
|
|
114
|
-
// Use legacy build for xcode 13 and older
|
|
115
|
-
useLegacyBuild(config, path.join('platforms', 'ios'));
|
|
116
|
-
} else {
|
|
117
|
-
// Patch podfile for xcode 14
|
|
118
|
-
fixPods(config, path.join('platforms', 'ios'));
|
|
119
|
-
}
|
|
113
|
+
fixPods(config, path.join('platforms', 'ios'));
|
|
120
114
|
|
|
121
115
|
// Remove libCordova.a from build
|
|
122
116
|
utils.logInfo('Updating xcode project file');
|
|
@@ -129,29 +123,6 @@ function createHybridApp(config) {
|
|
|
129
123
|
|
|
130
124
|
// Done
|
|
131
125
|
return prepareResult;
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
//
|
|
136
|
-
// Use legacy build system in XCode
|
|
137
|
-
//
|
|
138
|
-
function useLegacyBuild(config, iosSubDir) {
|
|
139
|
-
var xcSettingsDir = path.join(config.projectDir, iosSubDir, config.appname + '.xcworkspace', 'xcshareddata')
|
|
140
|
-
var xcSettingsFile = path.join(xcSettingsDir, 'WorkspaceSettings.xcsettings');
|
|
141
|
-
var plistFileContent = '<?xml version="1.0" encoding="UTF-8"?>\n' +
|
|
142
|
-
'<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n' +
|
|
143
|
-
'<plist version="1.0">\n' +
|
|
144
|
-
'<dict>\n' +
|
|
145
|
-
'<key>BuildSystemType</key>\n' +
|
|
146
|
-
'<string>Original</string>\n' +
|
|
147
|
-
'<key>DisableBuildSystemDeprecationDiagnostic</key>\n' +
|
|
148
|
-
'<true/>\n' +
|
|
149
|
-
'</dict>\n' +
|
|
150
|
-
'</plist>\n';
|
|
151
|
-
utils.logInfo('Creating WorkspaceSettings.xcsettings for project. Setting the BuildSystemType to original in ' + xcSettingsFile);
|
|
152
|
-
utils.mkDirIfNeeded(xcSettingsDir)
|
|
153
|
-
fs.writeFileSync(xcSettingsFile,plistFileContent,'utf8');
|
|
154
|
-
utils.logInfo('Created WorkspaceSettings.xcsettings for project ' + config.appname);
|
|
155
126
|
}
|
|
156
127
|
|
|
157
128
|
//
|
|
@@ -237,9 +208,30 @@ function printNextSteps(ide, projectPath, result) {
|
|
|
237
208
|
'Before you ship, make sure to plug your OAuth Client ID and Callback URI,',
|
|
238
209
|
'and OAuth Scopes into ' + bootconfigFile,
|
|
239
210
|
]);
|
|
240
|
-
|
|
241
211
|
};
|
|
242
212
|
|
|
213
|
+
//
|
|
214
|
+
// Print next steps for Native Login
|
|
215
|
+
//
|
|
216
|
+
function printNextStepsForNativeLogin(ide, projectPath, result) {
|
|
217
|
+
var workspacePath = path.join(projectPath, result.workspacePath);
|
|
218
|
+
var bootconfigFile = path.join(projectPath, result.bootconfigFile);
|
|
219
|
+
var entryFile = (ide === 'XCode') ? 'SceneDelegate' : 'MainApplication';
|
|
220
|
+
|
|
221
|
+
// Printing out next steps
|
|
222
|
+
utils.logParagraph(['Next steps' + (result.platform ? ' for ' + result.platform : '') + ':',
|
|
223
|
+
'',
|
|
224
|
+
'Your application project is ready in ' + projectPath + '.',
|
|
225
|
+
'To use your new application in ' + ide + ', do the following:',
|
|
226
|
+
' - open ' + workspacePath + ' in ' + ide,
|
|
227
|
+
' - Update the OAuth Client ID, Callback URI, and Community URL in ' + entryFile + ' class.',
|
|
228
|
+
' - build and run',
|
|
229
|
+
'Before you ship, make sure to plug your OAuth Client ID and Callback URI,',
|
|
230
|
+
'and OAuth Scopes into ' + bootconfigFile + ', since it is still used for',
|
|
231
|
+
'authentication if we fallback on the webview.'
|
|
232
|
+
]);
|
|
233
|
+
}
|
|
234
|
+
|
|
243
235
|
//
|
|
244
236
|
// Print next steps for server project if present
|
|
245
237
|
//
|
|
@@ -252,15 +244,13 @@ function printNextStepsForServerProjectIfNeeded(projectPath) {
|
|
|
252
244
|
'Make sure to deploy it to your org before running your application.',
|
|
253
245
|
'',
|
|
254
246
|
'From ' + projectPath + ' do the following to setup a scratch org, push the server code:',
|
|
255
|
-
' -
|
|
247
|
+
' - sf force org create -f server/config/project-scratch-def.json -a MyOrg',
|
|
256
248
|
' - cd server',
|
|
257
|
-
' -
|
|
249
|
+
' - sf force source push -u MyOrg',
|
|
258
250
|
'You also need a password to login to the scratch org from the mobile app:',
|
|
259
|
-
' -
|
|
251
|
+
' - sf force user password generate -u MyOrg'
|
|
260
252
|
]);
|
|
261
253
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
254
|
}
|
|
265
255
|
|
|
266
256
|
//
|
|
@@ -386,7 +376,12 @@ function actuallyCreateApp(forcecli, config) {
|
|
|
386
376
|
if (!(results instanceof Array)) { results = [results] };
|
|
387
377
|
for (var result of results) {
|
|
388
378
|
var ide = SDK.ides[result.platform || config.platform.split(',')[0]];
|
|
389
|
-
|
|
379
|
+
|
|
380
|
+
if (config.templatepath != undefined && config.templatepath.includes('NativeLogin')) {
|
|
381
|
+
printNextStepsForNativeLogin(ide, config.projectPath, result);
|
|
382
|
+
} else {
|
|
383
|
+
printNextSteps(ide, config.projectPath, result);
|
|
384
|
+
}
|
|
390
385
|
}
|
|
391
386
|
printNextStepsForServerProjectIfNeeded(config.projectPath);
|
|
392
387
|
|
package/shared/utils.js
CHANGED
|
@@ -123,7 +123,8 @@ function getToolVersion(cmd) {
|
|
|
123
123
|
var toolVersion;
|
|
124
124
|
try {
|
|
125
125
|
var result = runProcessThrowError(cmd, null, true /* return output */);
|
|
126
|
-
|
|
126
|
+
// Remove @salesforce/cli/ from the beginning of sf cli version.
|
|
127
|
+
toolVersion = result.replace(/\r?\n|\r/, '').replace(/[^0-9\.]*/, '').replace('@salesforce/cli/', '');
|
|
127
128
|
}
|
|
128
129
|
catch (error) {
|
|
129
130
|
throw new Error(toolName + ' is required but could not be found. Please install ' + toolName + '.');
|