Closed
requested to merge github/fork/ProfessaA/project_generator_excludes_host_app_deps_from_application_test into master
Created by: ProfessaA
background
When xcode projects are generated, application tests currently include libraries in their "Link Binary With Libraries" phase that are also linked by their host app. This causes two versions of the class to get loaded (one for each binary image) and leads to unexpected behavior with mocks and categories involving these classes. This problem is already addressed for buck builds in AppleTestDescription#createBuildRule
by black listing the host apps linkable dependencies, so this PR only address project generation.
change
ProjectGenerator
now excludes the host app's dependencies from being included in the application test's Frameworks PBXBuildPhase
.
verification
-
add test case to ProjectGeneratorTest
to ensure that application tests don't try to link dependencies shared with the host app -
add test case to ProjectGeneratorTest
to ensure that UI tests continue to link all dependencies regardless of also being included by the host app -
verify that an application test target and ui test target in a generated project have the correct dependencies in their "Link Binary With Libraries" phases