Xcode doesn't offer Build Configuration control over Xcode subprojects

Originator:joshavant
Number:rdar://12649742 Date Originated:06-Nov-2012 06:08 PM
Status:Duplicate of 7630382 Resolved:
Product:Xcode Product Version:4G182
Classification:Enhancement Reproducible:Always
 
06-Nov-2012 06:08 PM Josh Avant:
Summary:
A parent Xcode project cannot control which Build Configuration to use when building Xcode subprojects.

Additionally, if a parent project's Build Configuration name doesn't match any of the subproject's Build Configuration names, the subproject will default to the Build Configuration setting in the 'Use XXXXX for command-line builds' dropdown (located in the Project's Info window, beneath the Configurations table).

This is problematic when a parent project has different Build Configurations from its subprojects and decreases modularity.

Steps to Reproduce:
1. Create one project that will serve as the parent Xcode project (for example, Foo).

2. Create a second project that will serve as the subproject (for example, Bar).

3. Open Bar.xcodeproj in Xcode.

4. In Bar's Project settings, add a target for a 'Cocoa Touch Static Library'.

5. Close Bar and open Foo.xcodeproj.

6. Drag Bar.xcodeproj into Foo to add Bar as a subproject.

7. In Foo's project settings -> 'Foo' target -> Build Phases -> Target Dependencies, click the + and add Bar's static library.

8. In Foo's project settings -> 'Foo' target -> Build Phases -> Add Build Phase -> Add Run Script, add the following script:
echo "${CONFIGURATION}" > ~/Desktop/parent_configuration

9. In Bar's project settings -> static library target -> Build Phases -> Add Build Phase -> Add Run Script, add the following script:
echo "${CONFIGURATION}" > ~/Desktop/subproject_configuration

10. Build Foo with the 'Debug' Build Configuration.

11. Note the contents of these files:
~/Desktop/parent_configuration
~/Desktop/subproject_configuration
(this will be referred to as Result Set 1).

12. In Foo's project settings -> 'Foo' project -> Configurations table, rename 'Debug' to 'NewConfig'.

13. Note the contents of these files:
~/Desktop/parent_configuration
~/Desktop/subproject_configuration
(this will be referred to as Result Set 2).

Actual Results:

Both files (parent_configuration and subproject_configuration) contain the CONFIGURATION build setting, identifying the name of the Build Configuration used, when built.

In Result Set 1, both files contain 'Debug'.
In Result Set 2, parent_configuration contains 'NewConfig' and subproject_configuration contains 'Release'.

(In Result Set 2, Bar automatically defaults to the Build Configuration set in the 'Use XXXXX for command-line builds' dropdown in the Project settings, due to the mismatch.)

There was no mechanism to control NewConfig's mapping to any of Bar's Build Configurations. It will only map to the default Build Configuration set in the dropdown.

Expected Results:

A mechanism to control NewConfig's mapping to Bar's Build Configurations.


The project described in the steps above has been attached.

06-Nov-2012 06:08 PM Josh Avant:
'Foo.zip' was successfully uploaded

Comments

Apple Developer Relations30-Sep-2015 10:30 AM

Engineering has determined that your bug report is a duplicate of another issue and will be closed.

The open or closed status of the original bug report your issue was duplicated to appears in the yellow "Duplicate of XXXXXXXX" section of the bug reporter user interface. This section appears near the top of the right column's bug detail view just under the bug number, title, state, product and rank.

If you have any questions or concerns, please update your report directly here: http://bugreport.apple.com/.

By joshavant at Nov. 3, 2015, 6:53 p.m. (reply...)

Closed

I closed this issue, since it fell out-of-date.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!