Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow headers in test bundles /apps to be imported the same as in Xcode #18

Merged
merged 12 commits into from
Feb 20, 2020

Conversation

segiddins
Copy link
Member

With these changes, we can successfully run almost all of our apps & tests!

  • Add a test for a test target importing headers from its test host

  • Tag internally expanded rules as manual

  • Don’t try to gather direct_modulemaps from a swift target

    apple_common.Objc.direct_module_maps is broken coming from swift_library
    (it contains one level of transitive module maps), so ignore SwiftInfo from swift_library,
    since it doesn't have a module_map field anyway

  • Stop generating modulemaps for tests & apps

    This matches CocoaPods’ behavior

    • The namespace for header names is the Test/Framework name, rather than the module name
    • Test/Framework don’t use -import-underlying-modulemap, allowing bridging headers to be used
  • Specify custom swift_librart generated_header_name

  • Update to Bazel 2.1 and HEAD of apple rules

  • Infer LaunchScreen.storyboard from resources filegroup

  • Don’t default packaging rule attrs to none unecessarily

    We can have them not even be in the kwargs dict

We can have them not even be in the kwargs dict
This matches CocoaPods’ behavior

- The namespace for header names is the Test/Framework name, rather than the module name
- Test/Framework don’t use -import-underlying-modulemap, allowing bridging headers to be used
apple_common.Objc.direct_module_maps is broken coming from swift_library
(it contains one level of transitive module maps), so ignore SwiftInfo from swift_library,
since it doesn't have a module_map field anyway
@segiddins
Copy link
Member Author

@ob @chenxiao0228 btw this both adds a new test (:yay:) and uses generates_header_name so imports of -Swift.h headers will work!

Copy link
Member

@ob ob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool PR... thanks!

@@ -15,6 +15,8 @@ PrivateHeaders = provider(
},
)

_MANUAL = ["manual"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, good idea tagging these as "manual"

@ob ob merged commit c0e637e into master Feb 20, 2020
@segiddins segiddins deleted the segiddins/importable-test-hosts branch March 20, 2021 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants