Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 81118200BAB for ; Fri, 7 Oct 2016 10:03:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7FBEF160AD6; Fri, 7 Oct 2016 08:03:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CF691160AE9 for ; Fri, 7 Oct 2016 10:03:44 +0200 (CEST) Received: (qmail 82528 invoked by uid 500); 7 Oct 2016 08:03:43 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 81867 invoked by uid 99); 7 Oct 2016 08:03:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Oct 2016 08:03:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 216F0DFF5A; Fri, 7 Oct 2016 08:03:43 +0000 (UTC) From: shazron To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-ios pull request #265: CB-11952 - Introduce buildFlag option Content-Type: text/plain Message-Id: <20161007080343.216F0DFF5A@git1-us-west.apache.org> Date: Fri, 7 Oct 2016 08:03:43 +0000 (UTC) archived-at: Fri, 07 Oct 2016 08:03:45 -0000 Github user shazron commented on a diff in the pull request: https://github.com/apache/cordova-ios/pull/265#discussion_r82344457 --- Diff: bin/templates/scripts/cordova/lib/build.js --- @@ -199,33 +220,54 @@ module.exports.findXCodeProjectIn = findXCodeProjectIn; * @param {Boolean} isDevice Flag that specify target for package (device/emulator) * @return {Array} Array of arguments that could be passed directly to spawn method */ -function getXcodeBuildArgs(projectName, projectPath, configuration, isDevice) { +function getXcodeBuildArgs(projectName, projectPath, configuration, isDevice, buildFlags) { var xcodebuildArgs; + var options; + var buildActions = [ 'build' ]; + var settings; + var customArgs = {}; + customArgs.otherFlags = []; + + if (buildFlags) { + if (typeof buildFlags === 'string' || buildFlags instanceof String) { + parseBuildFlag(buildFlags, customArgs); + } else { // buildFlags is an Array of strings + buildFlags.forEach( function(flag) { + parseBuildFlag(flag, customArgs); + }); + } + } + if (isDevice) { - xcodebuildArgs = [ - '-xcconfig', path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'), - '-workspace', projectName + '.xcworkspace', - '-scheme', projectName, - '-configuration', configuration, - '-destination', 'generic/platform=iOS', - '-archivePath', projectName + '.xcarchive', - 'archive', - 'CONFIGURATION_BUILD_DIR=' + path.join(projectPath, 'build', 'device'), - 'SHARED_PRECOMPS_DIR=' + path.join(projectPath, 'build', 'sharedpch') + options = [ + '-xcconfig', customArgs.xcconfig || path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'), + '-project', customArgs.project || projectName + '.xcodeproj', + customArgs.archs || 'ARCHS=armv7 arm64', + '-target', customArgs.target || projectName, + '-configuration', customArgs.configuration || configuration, + '-sdk', customArgs.sdk || 'iphoneos' + ]; + settings = [ + customArgs.valid_archs || 'VALID_ARCHS=armv7 arm64', + customArgs.configuration_build_dir || 'CONFIGURATION_BUILD_DIR=' + path.join(projectPath, 'build', 'device'), + customArgs.shared_precomps_dir || 'SHARED_PRECOMPS_DIR=' + path.join(projectPath, 'build', 'sharedpch') ]; } else { // emulator - xcodebuildArgs = [ - '-xcconfig', path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'), - '-workspace', projectName + '.xcworkspace', - '-scheme', projectName , - '-configuration', configuration, - '-sdk', 'iphonesimulator', - '-destination', 'platform=iOS Simulator,name=iPhone 5s', - 'build', - 'CONFIGURATION_BUILD_DIR=' + path.join(projectPath, 'build', 'emulator'), - 'SHARED_PRECOMPS_DIR=' + path.join(projectPath, 'build', 'sharedpch') + options = [ + '-xcconfig', customArgs.xcconfig || path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'), + '-project', customArgs.project || projectName + '.xcodeproj', + customArgs.archs || 'ARCHS=x86_64 i386', + '-target', customArgs.target || projectName, + '-configuration', customArgs.configuration || configuration, + '-sdk', customArgs.sdk || 'iphonesimulator' + ]; + settings = [ --- End diff -- Same as above. All missing flags are essential. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org