Xcode does not compile Swift source files that are present in DerivedSources

Originator:nate
Number:rdar://24419577 Date Originated:2016-01-29
Status:Open Resolved:
Product:Xcode Product Version:7.2
Classification:Other Bug Reproducible:Always
 
Summary:
My understanding is that Obj-C source files that are placed into DerivedSources (i.e. DERIVED_FILE_DIR) are automatically compiled into the target executable (i.e. the app). However, this does not seem to occur for Swift source files placed into that directory.

Steps to Reproduce:
Create a Run Script Build Phase that copies a .swift file into DERIVED_FILE_DIR. Note that it does not appear to be built (intermediate object files are not present in the build directory, and the contained class is not available at runtime).

Alternatively, use a Build Rule to manually copy one of your Swift files into DERIVED_FILE_DIR instead of being compiled normally.

Expected Results:
The copied Swift source file should be complied into the executable.

Actual Results:
The copied Swift file is apparently ignored by the compiler.

Comments


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!