[ 
https://issues.apache.org/jira/browse/CB-11952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15554471#comment-15554471
 ] 

ASF GitHub Bot commented on CB-11952:
-------------------------------------

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.


> Should be able to pass flags to xcodebuild
> ------------------------------------------
>
>                 Key: CB-11952
>                 URL: https://issues.apache.org/jira/browse/CB-11952
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: iOS
>            Reporter: Andrew Zellman
>            Assignee: Shazron Abdullah
>              Labels: features
>
> Cordova developers should be able to pass additional flags to xcodebuild when 
> compiling their projects. This can be done by adding a --buildFlag option in 
> cordova-ios that allows multiples declarations. There will need to be 
> additional attention to conflicts that may happen with xcodebuild arguments 
> injected by Cordova.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to