rules_spm
rules_spm copied to clipboard
Add support for setting defines of declared swift_library
While trying to use Auth0.swift I realized it failed to compile because WEB_AUTH_PLATFORM wasn't defined.
This patch adds support to adding the output of manifest.settings.kind["define"] to the defines of the generated swift_library (I use spm_repositories in bazel mode).
EDIT: ~~I haven't added support to the spm_swift_library counterpart, and I could give it a try if you'd like me to.~~ this is obviously not necessary because spm handles this properly.
Thanks for the contribution! What do you think would be a good test for this functionality?
Good point. I guess I could expand the JSON from https://github.com/cgrindel/rules_spm/blob/main/test/json_test_data.bzl or introduce another one and check that the final target compiles with the right defines?
Is it possible to add Auth0.swift to the interesting_deps example where it uses a define?
Is it possible to add Auth0.swift to the interesting_deps example where it uses a define?
I just did this, it should be good enough as a test (the extra example wouldn't build without the extra defines).
To fix the failing CI tests, run bazel run //:update_all, then commit and push any changes that have been made.
@cgrindel it should be fine now!
@gferon I just used GitHub to update your PR with the AsyncMain fix. I hope that this will address the failing CI job.
@cgrindel I'm not exactly sure which steps I need to take to get CI to pass, could you point me in the right direction? Thanks!