New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-24057] Adapt native CocoaPods build behavior (2_0_X) #97
Conversation
7913bcb
to
0bab0de
Compare
runPodInstallIfRequired(basedir, function (err) { | ||
if (err) { return callback(err); } | ||
runCocoaPodsBuild(basedir, appDir, sdkType, sdkVersion, minSDKVersion, xcodesettings, function (err, libs, libDir) { | ||
runCocoaPodsBuild(basedir, iosBuilder, function (err, libs, libDir) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do understand that you rather want to pass the whole iosBuilder
object instead some of it's values. But can you ensure this does not effect the performance? Since there are many more values in there, that's probably why Jeff implemented it like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Objects are passed by reference so this doesn't affect performance at all.
if (iosBuilder.simHandle) { | ||
// Manually set the arch for simulator builds since we cannot use -destination | ||
// because the Pods project has no scheme. | ||
args.push('-arch', process.arch === 'x64' ? 'x86_64' : 'i386'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test this on both sim and device? We use the following to use archs in other places:
if (xcodeTargetOS === 'iphoneos') {
// armv7 for all devices. Note that we also could use armv7s or arm64 here
args.push('armv7-apple-ios' + iosMinVersion);
} else {
var simArch = process.arch === 'i386' ? 'i386' : 'x86_64';
args.push(simArch + '-apple-ios' + iosMinVersion);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code snippet is for swiftc which uses different arch specifiers. The arch
argument will only be set when we have a sim handle so it doesn't affect device builds (We do something similar here in our main iOS build)
function runCocoaPodsBuild (basedir, appDir, sdkType, sdkVersion, minSDKVersion, xcodesettings, callback) { | ||
var spawn = require('child_process').spawn, | ||
function runCocoaPodsBuild (basedir, iosBuilder, callback) { | ||
var appDir = iosBuilder.xcodeAppDir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually call this object iOSBuilder
in the iOS build process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to not capitalize any acronyms or abbreviations, but i'll change it for the sake of consistency 👍
0bab0de
to
e10e287
Compare
e10e287
to
6c43066
Compare
CR + FT passed, PR approved! 🚀 |
JIRA: https://jira.appcelerator.org/browse/TIMOB-24057
Changes the CocoaPods build to run with the same build configuration und to use the same build output dir as our main iOS build.