[
https://issues.apache.org/jira/browse/CB-11952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15554473#comment-15554473
]
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_r82344533
--- Diff: tests/spec/unit/build.spec.js ---
@@ -0,0 +1,255 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var path = require('path');
+var rewire = require('rewire');
+var build = rewire('../../../bin/templates/scripts/cordova/lib/build');
+
+describe('build', function () {
+ var testProjectPath = path.join('/test', 'project', 'path');
+
+ describe('getXcodeBuildArgs method', function() {
+
+ var getXcodeBuildArgs = build.__get__('getXcodeBuildArgs');
+ build.__set__('__dirname', path.join('/test', 'dir'));
+
+ it('should generate appropriate args if a single buildFlag is
passed in', function(done) {
+ var isDevice = true;
+ var buildFlags = '-xcconfig TestXcconfigFlag';
+
+ var args = getXcodeBuildArgs('TestProjectName',
testProjectPath, 'TestConfiguration', isDevice, buildFlags);
+ expect(args[0]).toEqual('-xcconfig');
+ expect(args[1]).toEqual('TestXcconfigFlag');
+ expect(args[2]).toEqual('-project');
+ expect(args[3]).toEqual('TestProjectName.xcodeproj');
+ expect(args[4]).toEqual('ARCHS=armv7 arm64');
+ expect(args[5]).toEqual('-target');
+ expect(args[6]).toEqual('TestProjectName');
+ expect(args[7]).toEqual('-configuration');
+ expect(args[8]).toEqual('TestConfiguration');
+ expect(args[9]).toEqual('-sdk');
+ expect(args[10]).toEqual('iphoneos');
+ expect(args[11]).toEqual('build');
+ expect(args[12]).toEqual('VALID_ARCHS=armv7 arm64');
+ expect(args[13]).toEqual('CONFIGURATION_BUILD_DIR=' +
path.join(testProjectPath, 'build', 'device'));
+ expect(args[14]).toEqual('SHARED_PRECOMPS_DIR=' +
path.join(testProjectPath, 'build', 'sharedpch'));
+ expect(args.length).toEqual(15);
+ done();
+ });
--- End diff --
Tests need to be updated once the missing flags are put back.
> 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]