-
Notifications
You must be signed in to change notification settings - Fork 14
/
build_ios_frameworks.js
30 lines (26 loc) · 1.02 KB
/
build_ios_frameworks.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module.exports = function(context) {
var fs = require('fs');
var Q = require('q');
var exec = require('child_process').exec;
var deferral = new Q.defer();
const dir = context.opts.plugin.dir;
const skip = "true" === process.env.VOXEET_SKIP_IOS_BUILD;
function exec_callback(error, stdout, stderr) {
error && console.log(error);
stdout && console.log(stdout);
stderr && console.log(stderr);
deferral.resolve();
}
if (!skip && fs.existsSync(dir)) {
// Waiting for Carthage / Xcode 12 fix
// exec(`carthage update --platform ios --project-directory ${dir}/src/ios`, exec_callback);
// Temporary fix
console.log("Installing Carthage dependencies... (this operation can take few minutes)");
exec(`chmod +x ${dir}/carthage.sh`);
exec(`${dir}/carthage.sh update --use-xcframeworks --platform ios --no-use-binaries --project-directory ${dir}/src/ios`, exec_callback);
} else {
console.log("skipping script installation...");
deferral.resolve();
}
return deferral.promise;
}